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

How To? LaserScan and Odom message for navigation

asked 2020-01-17 02:14:51 -0600

sohartma gravatar image

updated 2022-06-12 19:32:20 -0600

lucasw gravatar image

Hi there,

I'm trying to set up the navigation stack for my self built robot. It's equipped with three HC SR04 Ultrasonic Sensors and a MPU 9250/6500 for odometry data. I've read the ROS wiki: for publishing sensor streams, however i have no clue how the example nodes need to be edited to fit my sensors. I have also tried the example node, it publishes the /odom topic, but doesn't display the real data, when i move my MPU...

The rest of my setup: Ubuntu 16, ROS Kinetic, all sensors connected to a RaspberryPi 3. I also have two Arduino boards availble if that helps.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-12-24 12:11:07 -0600

ulashmetalcrush gravatar image

I don't know if there exists a simple tool that publishes odometry information directly from wheel encoders or imu data. In your scenario a quick search for your imu sensor links to :, which might work for outputting IMU messages as outputs. If nothings work for you, read your serial output of your sensor from raspberry pi's pins or usb inputs, and convert them to ros imu message.

You can convert this imu message to odometry via a custom node or with robot localization package( a very good package for fusing many types of sensors information) you can check out the ros wiki for that

For HC-SR04, you can connect that sensor to one of the raspberry pi3's pins. As far as I remember, HC-SR04 was providing analog output corresponding to measurements length, there might be readily available software for it(You can check arduino tutorials for it as well, mapping between analog voltage to distance will be pretty much the same. Then you can convert HC-SR04 distance information to pointcloud or laserscan(assume there is a virtual laserscanner at the centroid of those 3 hcsr04 sensors, and rays are cast from there). You have to work some trigonometry out but you can ask again when you are at that stage. At that same package and publish it as a ros message.

HC-Sr04's are common sensors, there might be rosnodes on github(

Sorry for the long message, I have just focused on how to solve it barebone and forgot to checkout github, but here are some repositories and ideas that can help.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2020-01-17 02:14:51 -0600

Seen: 359 times

Last updated: Jan 17 '20