From 36af40a7f18b791258a549b273aa2e7e2c543cfc Mon Sep 17 00:00:00 2001 From: weijian Date: Tue, 13 Jun 2023 14:00:28 +0800 Subject: [PATCH] add aikit-320 ros --- .../launch/communication_topic_pi.launch | 2 +- .../scripts/mycobot_topics_pi.py | 6 ++---- mycobot_ai/aikit_320_pi/config/aikit_320_pi.rviz | 9 +++++++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/mycobot_320/mycobot_320_communication/launch/communication_topic_pi.launch b/mycobot_320/mycobot_320_communication/launch/communication_topic_pi.launch index 176f231..a623b6c 100644 --- a/mycobot_320/mycobot_320_communication/launch/communication_topic_pi.launch +++ b/mycobot_320/mycobot_320_communication/launch/communication_topic_pi.launch @@ -4,7 +4,7 @@ - + diff --git a/mycobot_320/mycobot_320_communication/scripts/mycobot_topics_pi.py b/mycobot_320/mycobot_320_communication/scripts/mycobot_topics_pi.py index 935cef3..ecce12f 100644 --- a/mycobot_320/mycobot_320_communication/scripts/mycobot_topics_pi.py +++ b/mycobot_320/mycobot_320_communication/scripts/mycobot_topics_pi.py @@ -19,8 +19,7 @@ from mycobot_communication.msg import ( -from pymycobot import MyCobotSocket - +from pymycobot import MyCobot class Watcher: """this class solves two problems with multithreaded @@ -77,8 +76,7 @@ class MycobotTopics(object): port = rospy.get_param("~port", "/dev/ttyAMA0") baud = rospy.get_param("~baud", 115200) rospy.loginfo("%s,%s" % (port, baud)) - self.mc = MyCobotSocket(port, baud) # port - self.mc.connect() #pi + self.mc = MyCobot(port, baud) # port self.lock = threading.Lock() def start(self): diff --git a/mycobot_ai/aikit_320_pi/config/aikit_320_pi.rviz b/mycobot_ai/aikit_320_pi/config/aikit_320_pi.rviz index c14d986..9495419 100644 --- a/mycobot_ai/aikit_320_pi/config/aikit_320_pi.rviz +++ b/mycobot_ai/aikit_320_pi/config/aikit_320_pi.rviz @@ -9,6 +9,7 @@ Panels: - /RobotModel1 - /TF1 - /TF1/Tree1 + - /Marker1 Splitter Ratio: 0.5 Tree Height: 603 - Class: rviz/Selection @@ -152,6 +153,14 @@ Visualization Manager: {} Update Interval: 0 Value: true + - Class: rviz/Marker + Enabled: true + Marker Topic: cube + Name: Marker + Namespaces: + {} + Queue Size: 100 + Value: true Enabled: true Global Options: Background Color: 48; 48; 48