mirror of
https://github.com/elephantrobotics/mycobot_ros.git
synced 2026-07-05 19:47:04 +00:00
fix bug
This commit is contained in:
parent
5252c6a8e2
commit
252e89c9bb
4 changed files with 13 additions and 7 deletions
|
|
@ -425,12 +425,16 @@ class Object_detect(Movement):
|
|||
# The path to save the image folder
|
||||
def parse_folder(folder):
|
||||
restore = []
|
||||
path1 = '/home/ubuntu/catkin_ws/src/mycobot_ros/mycobot_ai/ai_mycobot_280' + folder
|
||||
path = ''
|
||||
path1 = '/home/ubuntu/catkin_ws/src/mycobot_ros/mycobot_ai/ai_mycobot_280/' + folder
|
||||
path2 = '/home/h/catkin_ws/src/mycobot_ros/mycobot_ai/ai_mycobot_280/' + folder
|
||||
if os.path.exists(path1):
|
||||
path = path1
|
||||
elif os.path.exists(path2):
|
||||
path = path2
|
||||
|
||||
print("path:",path)
|
||||
|
||||
for i, j, k in os.walk(path):
|
||||
for l in k:
|
||||
restore.append(cv2.imread(folder + '/{}'.format(l)))
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -5,13 +5,13 @@ from pymycobot import PI_PORT, PI_BAUD # 当使用树莓派版本的mycobot时
|
|||
import time
|
||||
|
||||
# mc = MyCobot("/dev/ttyACM0", 115200)
|
||||
mc = MyCobot("/dev/ttyUSB0", 115200)
|
||||
# mc = MyCobot("/dev/ttyAMA0", 1000000)
|
||||
# mc = MyCobot("/dev/ttyUSB0", 115200)
|
||||
mc = MyCobot("/dev/ttyAMA0", 1000000)
|
||||
|
||||
# mc.send_angles([0,0,0,0,0,0], 25)
|
||||
mc.send_angles([0,0,0,0,0,0], 25)
|
||||
# print(mc.get_angles())
|
||||
mc.send_angles([-7.11, -6.94, -55.01, -24.16, 0.0, -15], 30)
|
||||
time.sleep(4)
|
||||
# mc.send_angles([-7.11, -6.94, -55.01, -24.16, 0.0, -15], 30)
|
||||
# time.sleep(4)
|
||||
# print(mc.get_angles())
|
||||
|
||||
# mc.send_coords([120.8, -134.4, 258.0, -172.72, -5.31, -109.09], 30, 1) # red bucket
|
||||
|
|
@ -35,6 +35,8 @@ time.sleep(4)
|
|||
|
||||
|
||||
# mc.release_all_servos()
|
||||
# mc.release_servo(1)
|
||||
# mc.set_servo_calibration(1)
|
||||
# time.sleep(1)
|
||||
# while True:
|
||||
# print("angles:%s"% mc.get_angles())
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class MycobotTopics(object):
|
|||
rospy.init_node("mycobot_topics_pi")
|
||||
rospy.loginfo("start ...")
|
||||
# problem
|
||||
port = rospy.get_param("~port", os.popen("ls /dev/ttyAMA*").readline()[:-1]")
|
||||
port = rospy.get_param("~port", os.popen("ls /dev/ttyAMA*").readline()[:-1])
|
||||
baud = rospy.get_param("~baud", 1000000)
|
||||
rospy.loginfo("%s,%s" % (port, baud))
|
||||
self.mc = MyCobotSocket(port, baud) # port
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue