How do i modify/change base_footprint by program?

asked 2018-01-02 05:00:02 -0600

Liuche gravatar image

updated 2018-01-04 20:13:50 -0600

Hello everybody!

Thank for your attention!

Dose anyone know how to modify/change the pose by code?

It means I want to change the base_footprint(robot's location).

What I want to do is when I use RFID Tag as a checkpoint.

When the robot Check checkpoint, program will modify the current location of the robot(base_footprint's location).

I had try this. Here is my code :

from nav_msgs.msg import Odometry
import rospy

odom = Odometry()

pose_pub = rospy.Publisher("/odom", Odometry, queue_size=10)

rospy.init_node('test')

odom.pose.pose.position.x = 1
odom.pose.pose.position.y = 1
odom.pose.pose.position.z = 0

while not rospy.is_shutdown():
      pose_pub.publish(odom)

It's only response when the code is running.

But when I close the code , the Pose will return to the old data

(I use rostopic info to check /odom, I saw

Publisher: * /mobile_base_nodelet_manager ( http://127.0.0.1:37999/ )

Subscribers: None

Maybe it's why to be this.)

Is there a way to modify the base_footprint's location by code?

edit retag flag offensive close merge delete

Comments

What do you mean by 'the Pose will return to the old data'? Is there another publisher of Pose (which is perhaps latched?)?

lucasw gravatar image lucasw  ( 2018-01-02 11:16:11 -0600 )edit

HI, lucasw!

I only launch the turtlebot minimal.launch.

I use rostopic info to check /odom, I saw

Publisher: * /mobile_base_nodelet_manager ( http://127.0.0.1:37999/ )

Subscribers: None

Maybe it's why to be this.

But I need to find another way to change the Pose.

Liuche gravatar image Liuche  ( 2018-01-02 19:04:48 -0600 )edit

I want to do is like ('/mobile_base/commands/rest_odometry'). That means it won't return the old data after I run finish.

Liuche gravatar image Liuche  ( 2018-01-02 19:07:57 -0600 )edit

I have seen <remap from="mobile_base/odom" to="odom"/>.

But when I use rostopic list, I don't see the mobile_base/odom.

Liuche gravatar image Liuche  ( 2018-01-02 19:55:37 -0600 )edit