This commit is contained in:
wangWking 2022-05-10 18:15:22 +08:00
parent 3a06ec4ef8
commit 3244f0246c
2 changed files with 5 additions and 5 deletions

View file

@ -15,8 +15,8 @@ def talker():
rospy.init_node("display", anonymous=True)
print("Try connect real mypal...")
port = rospy.get_param("~port", "/dev/ttyUSB0")
baud = rospy.get_param("~baud", 115200)
port = rospy.get_param("~port", "/dev/ttyAMA0")
baud = rospy.get_param("~baud", 1000000)
print("port: {}, baud: {}\n".format(port, baud))
try:
mypa = MyPalletizer(port, baud)

View file

@ -26,7 +26,7 @@ def callback(data):
data_list = []
for index, value in enumerate(data.position):
data_list.append(value)
del data_list[3] # delete the angle of joint3 to joint4,because it do not exsist actually! 把joint3到joint4的角度删掉因为它实际上不存在
# del data_list[3] # delete the angle of joint3 to joint4,because it do not exsist actually! 把joint3到joint4的角度删掉因为它实际上不存在
# data_list[3] = data_list[4]
# print(data_list)
mc.send_radians(data_list, 80)
@ -38,8 +38,8 @@ def listener():
rospy.init_node("control_slider", anonymous=True)
rospy.Subscriber("joint_states", JointState, callback)
port = rospy.get_param("~port", "/dev/ttyUSB0") # Select connected device. 选择连接设备
baud = rospy.get_param("~baud", 115200)
port = rospy.get_param("~port", "/dev/ttyAMA0") # Select connected device. 选择连接设备
baud = rospy.get_param("~baud", 1000000)
print(port, baud)
mc = MyPalletizer(port, baud)