ROS Node Publisher and Subscriber Setup
This code segment sets up publishers and subscribers in a ROS node.
- 'self.GoalPub' is a publisher that publishes messages of type 'Marker' to the topic '/GoalPoint' with a queue size of 10.
- 'self.LaserSub' is a subscriber that listens to messages of type 'LaserScan' on the topic '/scan' and calls the callback function 'LaserScanCallBack' whenever a message is received.
- 'self.OdomSub' is a subscriber that listens to messages of type 'Odometry' on the topic '/odom' and calls the callback function 'OdomCallBack' whenever a message is received.
- 'self.goalxSub' is a subscriber that listens to messages of type 'Float32' on the topic '/goal_x' and calls the callback function 'goalxCallBack' whenever a message is received.
- 'self.goalySub' is a subscriber that listens to messages of type 'Float32' on the topic '/goal_y' and calls the callback function 'goalyCallBack' whenever a message is received.
原文地址: https://www.cveoy.top/t/topic/pdSC 著作权归作者所有。请勿转载和采集!