ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Just posting this for those who venture into ROS and Python and got a bit lost like me!

Odometry was fairly simple, but the Laser/PML sensor was a bit more fickle:

I found this:

http://ttp://forums.trossenrobotics.com/printthread.php?t=4304&pp=10&page=8)

for which I was very grateful, thanks

PML or poor man's laser a sharp IR range finder in my case:

From the Trossen Forum

Finally, my version of your PML node to simulate the laser scan:

the code block seems to misbehave to scroll down

you might need to add top line...

!/usr/bin/env python

Notice.....

rospy.init_node("base_scan") scanPub = rospy.Publisher('base_scan', LaserScan) scanBroadcaster = TransformBroadcaster()

I got stuck on that....

and.......

scan.header.frame_id = "base_link"

also:

The scan.ranges is a list, so you collate the ranges from your sensor, and assign that to scan.ranges

If the min max and inc angles are set properly it works....

You also need a transform

This is commented out in the above code snippet

something like this:

!/usr/bin/env python
import roslib roslib.load_manifest('<your package="" name="">') import rospy import tf

if __name__ == '__main__': rospy.init_node('my_tf_broadcaster') br = tf.TransformBroadcaster() rate = rospy.Rate(10.0) while not rospy.is_shutdown(): br.sendTransform((0.16, 0.0, 0.11), (0.0, 0.0, 0.0, 1.0), rospy.Time.now(), "base_scan", "base_link") print ".",
rate.sleep()

------end------------------