Problem tf from base_link to laser in python
Hi,
I have a p3dx with ROS indigo runing on ubuntu 14.14 and a LMS100 Laser.
I want to transform data from /base_link topic to /laser using a python script
The program works without error, but the TF is not created
> import roslib import rospy import tf
>
> rospy.init_node('pioneer_tf_broadcast')
>
> rate = rospy.Rate(20.0)
>
> laserBroadcaster =
> tf.TransformBroadcaster()
>
> while not rospy.shutdown():
> laserBroadcaster.sendTransform( (0, 0,
> 0),
> tf.transformations.quaternion_from_euler(0.13,
> 0.0, 0.39),
> rospy.Time.now(),
> "/laser",
> "/base_link"
> )
> rate.sleep()
Here what I get when I used roswtf :
> Beginning tests of your ROS graph.
> These may take awhile... analyzing
> graph... ... done analyzing graph
> running graph rules... ... done
> running graph rules running tf checks,
> this will take a second... ... tf
> checks complete
>
> Online checks summary:
>
> Found 1 warning(s). Warnings are
> things that may be just fine, but are
> sometimes at fault
>
> WARNING The following node
> subscriptions are unconnected: *
> /rqt_gui_py_node_4057: * /tf_static
> * /RosAria: * /RosAria/cmd_vel
also here the frames obtained by rqt :
I cannot help you with the problem, but for what you are trying to do, you could actually use the
static_transform_publisher
. Check out the wiki page hererospy.shutdown
->rospy.is_shutdown
. Shut everything down and run the laser broadcaster by itself then dorosrun tf tf_echo laser base_link
. Also make sure you didn't name that file something like tf.py, which will cause silent problems.ok, so I tried this command and it's worked fine:
The second solution doesn't work, it throws an exception :
thank you guys
It wasn't a solution, just debug steps to help you find what is wrong with your script- I don't think the code ever gets to the sendTransform, it may not even be making it past init_node().
I put an echo message in the loop and it was printed during the execution. I don't understand why the code is not sending the Transform