diff --git a/mecharm/mecharm_communication/launch/communication_topic_pi.launch b/mecharm/mecharm_communication/launch/communication_topic_pi.launch index 959557e..d3d255e 100644 --- a/mecharm/mecharm_communication/launch/communication_topic_pi.launch +++ b/mecharm/mecharm_communication/launch/communication_topic_pi.launch @@ -1,4 +1,4 @@ - +3 diff --git a/mecharm/mecharm_communication/scripts/mecharm_topics.py b/mecharm/mecharm_communication/scripts/mecharm_topics.py index 799fe4b..02c3934 100755 --- a/mecharm/mecharm_communication/scripts/mecharm_topics.py +++ b/mecharm/mecharm_communication/scripts/mecharm_topics.py @@ -70,7 +70,7 @@ class MycobotTopics(object): rospy.init_node("mycobot_topics") rospy.loginfo("start ...") - port = rospy.get_param("~port", "/dev/ttyUSB0") + port = rospy.get_param("~port", os.popen("ls /dev/ttyUSB*").readline()[:-1]) baud = rospy.get_param("~baud", 115200) rospy.loginfo("%s,%s" % (port, baud)) self.mc = MyCobot(port, baud) diff --git a/mecharm/mecharm_communication/scripts/mecharm_topics_pi.py b/mecharm/mecharm_communication/scripts/mecharm_topics_pi.py index 39be565..857650c 100755 --- a/mecharm/mecharm_communication/scripts/mecharm_topics_pi.py +++ b/mecharm/mecharm_communication/scripts/mecharm_topics_pi.py @@ -74,7 +74,7 @@ class MycobotTopics(object): rospy.init_node("mycobot_topics_pi") rospy.loginfo("start ...") # problem - port = rospy.get_param("~port", "/dev/ttyAMA0") + 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 diff --git a/mycobot_ai/myCobot_280/launch/vision_pi.launch b/mycobot_ai/myCobot_280/launch/vision_pi.launch index a01ed45..5187d9e 100644 --- a/mycobot_ai/myCobot_280/launch/vision_pi.launch +++ b/mycobot_ai/myCobot_280/launch/vision_pi.launch @@ -14,13 +14,13 @@ - + - + diff --git a/mycobot_ai/myCobot_280/scripts/combine_detect_obj_color .py b/mycobot_ai/myCobot_280/scripts/combine_detect_obj_color .py index a2f624c..da902ee 100755 --- a/mycobot_ai/myCobot_280/scripts/combine_detect_obj_color .py +++ b/mycobot_ai/myCobot_280/scripts/combine_detect_obj_color .py @@ -77,7 +77,7 @@ class Object_detect(Movement): "yellow": [np.array([11, 115, 70]), np.array([40, 255, 245])], "red": [np.array([0, 43, 46]), np.array([8, 255, 255])], "green": [np.array([35, 43, 46]), np.array([77, 255, 255])], - "blue": [np.array([100, 43, 46]), np.array([124, 255, 255])], + # "blue": [np.array([100, 43, 46]), np.array([124, 255, 255])], "cyan": [np.array([78, 43, 46]), np.array([99, 255, 255])], } # use to calculate coord between cube and mycobot diff --git a/mycobot_communication/scripts/mycobot_topics.py b/mycobot_communication/scripts/mycobot_topics.py index 799fe4b..5039b0d 100755 --- a/mycobot_communication/scripts/mycobot_topics.py +++ b/mycobot_communication/scripts/mycobot_topics.py @@ -70,7 +70,9 @@ class MycobotTopics(object): rospy.init_node("mycobot_topics") rospy.loginfo("start ...") - port = rospy.get_param("~port", "/dev/ttyUSB0") + port = rospy.get_param("~port", os.popen("ls /dev/ttyUSB*").readline()[:-1]) + if not port: + port = rospy.get_param("~port", os.popen("ls /dev/ttyACM*").readline()[:-1]) baud = rospy.get_param("~baud", 115200) rospy.loginfo("%s,%s" % (port, baud)) self.mc = MyCobot(port, baud) diff --git a/mycobot_communication/scripts/mycobot_topics_pi.py b/mycobot_communication/scripts/mycobot_topics_pi.py index 1ccf23c..ae09c88 100755 --- a/mycobot_communication/scripts/mycobot_topics_pi.py +++ b/mycobot_communication/scripts/mycobot_topics_pi.py @@ -74,7 +74,7 @@ class MycobotTopics(object): rospy.init_node("mycobot_topics_pi") rospy.loginfo("start ...") # problem - port = rospy.get_param("~port", "/dev/ttyAMA0") + 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 diff --git a/mypalletizer_260/mypalletizer_communication/scripts/mypal_topics_pi.py b/mypalletizer_260/mypalletizer_communication/scripts/mypal_topics_pi.py index 4af28ee..b0f2ea9 100755 --- a/mypalletizer_260/mypalletizer_communication/scripts/mypal_topics_pi.py +++ b/mypalletizer_260/mypalletizer_communication/scripts/mypal_topics_pi.py @@ -69,7 +69,7 @@ class MypalTopics(object): rospy.init_node("mypal_topics_pi") rospy.loginfo("start ...") # problem - port = rospy.get_param("~port", "/dev/ttyAMA0") + 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