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

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.

-FAIZ.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

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

Comments

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

Look at ROS 2 Migration for the ported version of the range sensor plugin.

mrubio gravatar image mrubio  ( 2022-11-10 08:49:56 -0500 )edit
2

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:

https://github.com/OpenPi-bot/robot-s... :)

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

https://github.com/OpenPi-bot/robot-s...

edit flag offensive delete link more

Comments

works for me on Noetic.

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

Question Tools

2 followers

Stats

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

Seen: 6,761 times

Last updated: Apr 24 '17