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

how to set max range on ir range finder sensor

asked 2013-12-12 11:37:49 -0500

dragowill gravatar image

updated 2014-01-28 17:18:49 -0500

ngrennan gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-12-12 21:08:35 -0500

David Galdeano gravatar image

updated 2013-12-12 21:18:56 -0500

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);
edit flag offensive delete link more

Comments

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?

dragowill gravatar image dragowill  ( 2013-12-13 02:37:22 -0500 )edit

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?

David Galdeano gravatar image David Galdeano  ( 2013-12-13 04:10:32 -0500 )edit

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.

dragowill gravatar image dragowill  ( 2013-12-13 04:26:12 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2013-12-12 11:37:49 -0500

Seen: 1,250 times

Last updated: Dec 13 '13