0
$\begingroup$

Rosanswers logo

Hi everyone, ROS noob here. Do any of you know how to set the max range on ir range finder sensor shown on this:http://docs.ros.org/api/sensor_msgs/html/msg/Range.html? For some reasons, the IR Range Finder sensor that I run whenever I print the data would give out the max_range of 0.4m and min_range of 0m. Is there a way to change that default? Thanks.

Willi

ps: I haven't wrote the code yet (it is going to be in Python). I was getting the IR Range data of the Baxter robot using the Rostopic echo /robot/range/right_arm_range command. It would then print out the result with max_range 0.4m. Would that mean that is the robot's IR reader limitation then?


Originally posted by dragowill on ROS Answers with karma: 5 on 2013-12-12

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.