Hello, if you write the code for the sensor publication, you can declare the min and max value every time you publish the distance or set these values when you declare the sensor.
Declaration:
range_msg.radiation_type = sensor_msgs::Range::ULTRASOUND;
range_msg.header.frame_id = frameid;
range_msg.field_of_view = 0.2;
range_msg.min_range = 0.0; // modification on min-max distance are made here.
range_msg.max_range = 2.0;
Publisher:
range_msg.range = measure;
range_msg.header.stamp = nh.now();
pub_range.publish(&range_msg);
Originally posted by David Galdeano with karma: 357 on 2013-12-12
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by dragowill on 2013-12-13:
Thanks Galdeano. When I write the code then, where should I put the declaration? It's not shown in the tutorial here:http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28python%29. Would that work in Python? Is there any command line action that would change the max_range in the robot?
Comment by David Galdeano on 2013-12-13:
I think that you can take inspiration from:
http://docs.ros.org/hydro/api/arbotix_sensors/html/ir__ranger_8py_source.html
and
http://docs.ros.org/hydro/api/arbotix_sensors/html/max__sonar_8py_source.html
for more details, it helps to know what hardware is used: what ultrasonic sensor and what controller are used?
Comment by dragowill on 2013-12-13:
Thanks for your help Galdeano. I am using a Baxter research robot IR range finder from Rethink Robotics inc just so you know. I think those links will help me figure out. I'll mark your answer as the answer.