ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Adding ultrasonic sensor to the robot

asked 2017-04-24 15:59:39 -0500

FAIZ gravatar image

Hello everyone. I am new to ROS and was using gazebo for simulation of Innok_Heros robot. Is it possible to add ultrasonic sensor to this robot, if yes can someone please hint me on the method to do the same.

Thank you.


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2017-04-24 20:45:30 -0500

Geoff gravatar image

updated 2017-04-24 20:45:51 -0500

You can use the gazebo_ros_range plugin to simulate an ultrasonic (sonar) sensor. Look at lines 82 to 115 of this test world file to see how to add one to your own simulated robot.

edit flag offensive delete link more


Thank you for the reply, I am using urdf file. Will this work on that.

FAIZ gravatar image FAIZ  ( 2017-04-25 00:10:31 -0500 )edit

Yes, you can put the relevant information in your URDF file wrapped in a <gazebo> tag. See this tutorial on using URDF with Gazebo and this one on adding a laser scanner to the URDF.

Geoff gravatar image Geoff  ( 2017-04-25 00:32:22 -0500 )edit

Does this work for ROS2 ?

Ahmad Altarabeen gravatar image Ahmad Altarabeen  ( 2022-05-18 16:29:57 -0500 )edit

answered 2020-07-08 07:17:21 -0500

mananmadman gravatar image

I agree with the top answer, I tried it, it worked for me.

You can have a look at my code if you want: :)

The code for the sensor is plugin is in this file:

edit flag offensive delete link more


works for me on Noetic.

amjack gravatar image amjack  ( 2022-08-04 04:17:24 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2017-04-24 15:59:39 -0500

Seen: 5,583 times

Last updated: Apr 24 '17