Ultrasound sensor on a servo motor

asked 2018-08-26 04:12:14 -0500

lyakh gravatar image

updated 2018-08-26 05:18:31 -0500

gvdhoorn gravatar image

Hi, do I understand it correctly, that there is no standard way under ROS to represent an ultrasound sensor mounted on a servo motor, which seems to be a rather usual design? I've done a range publisher for the sensor itself, but I don't see a way to bind that to an angle? I see there is an API to represent a 2D range sensor, which is usually a laser sensor, but that doesn't map very well to my scenario? Thanks and regards.


Edit: I'm not an expert in sensors, so, I might be just plain wrong. But to me this seems to be different from a 2D laser range sensor because the laser range sensor returns a set of range values for different angles from a single measurement, and the process is relatively quick. You probably also can retrieve single measurements for a specific angle or at least modify the angle to imitate a single direction, but for an ultrasonic sensor on a rotating frame I think the primary mode is measuring a single direction. You can of course model a 2D range sensor by constantly rotating the sensor, but that doesn't seem like a very natural thing to do to me. As for how this should be represented - again, I'm quite new to ROS and its APIs. One thing I would expect from such a "directional 1D" publisher is messages with two values - range and angle. And there should also be a possibility to re-configure that publisher, i.e. to set a new angle. So far I don't see how that can be done with the present publisher-subscriber API?

edit retag flag offensive close merge delete

Comments

there is no standard way under ROS to represent an ultrasound sensor mounted on a servo motor

What makes this special? In the end, it seems to me to just be a range sensor on a rotating TF frame.

Can you clarify how you think this setup should be represented / modelled?

gvdhoorn gravatar image gvdhoorn  ( 2018-08-26 04:19:56 -0500 )edit

but I don't see a way to bind that to an angle?

You don't normally.

Just set the frame_id in the header to the name of the TF frame that corresponds with the frame for the servo motor. Everything else is taken care of for you.

gvdhoorn gravatar image gvdhoorn  ( 2018-08-26 04:31:25 -0500 )edit

Final comment:

I see there is an API to represent a 2D range sensor, which is usually a laser sensor

According to sensor_msgs/Range it is not actually:

This message is not appropriate for laser scanners.

gvdhoorn gravatar image gvdhoorn  ( 2018-08-26 04:33:14 -0500 )edit

Thanks for the TF frame hint, that's useful! So, I can already return orientation to the subscriber with each measurement. But still there's no standard way for the subscriber to request a specific orientation?

lyakh gravatar image lyakh  ( 2018-08-26 05:01:42 -0500 )edit

Usually distance information is only feed into a costmap. Requesting information for a specific angle sounds more like a job for a Service.

Humpelstilzchen gravatar image Humpelstilzchen  ( 2018-08-27 01:07:47 -0500 )edit

Which method is better for a UAV - a rotating 1D range sensor or a 2D range sensor?

Jaroan gravatar image Jaroan  ( 2019-12-09 01:49:53 -0500 )edit

Jaroan: 1) Please do not add your question to another one. This is not a forum. 2) Please ask this in a UAV board/forum since this is not a ROS question.

Humpelstilzchen gravatar image Humpelstilzchen  ( 2020-01-06 08:02:34 -0500 )edit