Ask Your Question

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: 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.


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

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.


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;


range_msg.range = measure;
range_msg.header.stamp =;
edit flag offensive delete link more


Thanks Galdeano. When I write the code then, where should I put the declaration? It's not shown in the tutorial here: 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: and 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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


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

Seen: 1,004 times

Last updated: Dec 13 '13