Reset Turtlebot odometry in a Python script
I am using rostopic pub /mobile_base/commands/reset_odometry std_msgs/Empty
to reset odometry on Turtlebot. It works fine but I want to do the same thing in a Python script. Here is my code:
import rospy
from std_msgs.msg import Empty
rospy.init_node('reset_odom')
pub = rospy.Publisher('/mobile_base/commands/reset_odometry', Empty, queue_size=10)
pub.publish(Empty())
It doesn't work. Could you point out what is wrong with it? Thanks!
I have the same issue, did you get any response ??
In my initial explorations, if that command goes in the main control loop, it seems to work, but if it's only published a couple times, it fails to reset