diff --git a/robomaster_pi/robot_ros_odom.py b/robomaster_pi/robot_ros_odom.py index 3fda405776303294d3fbf062ac3c13c7772503b3..c68e32358b8e9b05ed90b9ad24bae910786620d0 100644 --- a/robomaster_pi/robot_ros_odom.py +++ b/robomaster_pi/robot_ros_odom.py @@ -60,6 +60,7 @@ class Robomaster_odom(Node): def __init__(self, ep_chassis): super().__init__("robomaster_odom") + def sub_position_handler(position_info): print("handler") tf_broadcaster = TransformBroadcaster() @@ -77,6 +78,7 @@ class Robomaster_odom(Node): t.transform.rotation.w = q[3] tf_broadcaster.sendTransform(t) print("ok") + ep_chassis.sub_position(freq=10, callback=sub_position_handler) print("sub") diff --git a/setup.py b/setup.py index 0f00793748b5d011ad860ec23ec2f688243fdf87..e9011849217150d2f57ec72c0e63bcc7cb2d03e8 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ setup( tests_require=['pytest'], entry_points={ 'console_scripts': [ - "connection = robomaster_pi.conn_odom:main", + "conn_odom = robomaster_pi.conn_odom:main", "connection = robomaster_pi.connection:main", "robot_ros_vel = robomaster_pi.robot_ros_vel:main", "robot_ros_odom = robomaster_pi.robot_ros_odom:main",