Ultrasound sensor on a servo motor
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?
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?
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.Final comment:
According to sensor_msgs/Range it is not actually:
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?
Usually distance information is only feed into a costmap. Requesting information for a specific angle sounds more like a job for a Service.
Which method is better for a UAV - a rotating 1D range sensor or a 2D range sensor?
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.