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

rosrun vs roslaunch

asked 2012-05-04 20:54:34 -0600

Torres gravatar image

updated 2012-05-04 21:28:31 -0600

This is a continuation from this problem.

Eric Perko asked me to change odom_frame_id to odom_combined. (I need to change base_frame_id to base_footprint as well)

1st case rosrun:

I have managed to do it using rosrun

rosrun amcl amcl _base_frame_id:=base_footprint _odom_frame_id:=odom_combined

and it works base_frame_id is changed to base_footprint and odom_frame_id is changed to odom_combined.

however

2nd case roslaunch:

I tried using particularly these two lines (the complete code is shown at the bottom of this post amcl_diff_with_map_hwk.launch):

<param name="base_frame_id" value="base_footprint"/>
  <param name="odom_frame_id" value="odom_combined"/>

The base_frame_id is changed to base_footprint however odom_frame_id is still the default value which is odom. (As shown in the rosparam get /amcl below)

image description


****Why the odom_frame_id stays the same in the launch file case?******


amcl_diff_with_map_hwk.launch:

<launch>

<node pkg="amcl" type="amcl" name="amcl" output="screen">
  <!--param name="use_map_topic " value="true"/ -->
  <!-- Publish scans from best pose at a max of 10 Hz -->
  <param name="odom_model_type" value="diff"/>
  <param name="odom_alpha5" value="0.1"/>
  <param name="base_frame_id" value="base_footprint"/>
  <param name="odom_frame_id" value="odom_combined"/>

  <param name="transform_tolerance" value="0.2" />
  <param name="gui_publish_rate" value="10.0"/>
  <param name="laser_max_beams" value="30"/>
  <param name="min_particles" value="500"/>
  <param name="max_particles" value="5000"/>
  <param name="kld_err" value="0.05"/>
  <param name="kld_z" value="0.99"/>
  <param name="odom_alpha1" value="0.2"/>
  <param name="odom_alpha2" value="0.2"/>
  <!-- translation std dev, m -->
  <param name="odom_alpha3" value="0.8"/>
  <param name="odom_alpha4" value="0.2"/>
  <param name="laser_z_hit" value="0.5"/>
  <param name="laser_z_short" value="0.05"/>
  <param name="laser_z_max" value="0.05"/>
  <param name="laser_z_rand" value="0.5"/>
  <param name="laser_sigma_hit" value="0.2"/>
  <param name="laser_lambda_short" value="0.1"/>
  <param name="laser_model_type" value="likelihood_field"/>
  <!-- <param name="laser_model_type" value="beam"/> -->
  <param name="laser_likelihood_max_dist" value="2.0"/>
  <param name="update_min_d" value="0.2"/>
  <param name="update_min_a" value="0.5"/>
  <param name="odom_frame_id" value="odom"/>
  <param name="resample_interval" value="1"/>
  <param name="transform_tolerance" value="0.1"/>
  <param name="recovery_alpha_slow" value="0.0"/>
  <param name="recovery_alpha_fast" value="0.0"/>

</node>
</launch>

move_base.launch:

<launch>
  <master auto="start"/>

  <!-- Run the map server -->
  <node name="map_server" pkg="map_server" type="map_server" args="$(find not_good)/Maps/Slam/slam_map_dark2.pgm 0.05"/>

  <!-- tf /map to /odom_combined -->
  <!-- node pkg="tf" type="static_transform_publisher" name="map_to_odom_combined" args="100 100 0 0 0 0 /map /odom_combined 100"/ -->

  <!--- Run AMCL -->
  <include file="$(find not_good)/amcl_diff_with_map_hwk.launch" />

  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <rosparam file="$(find not_good)/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find not_good)/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find not_good)/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find not_good)/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find not_good)/base_local_planner_params.yaml" command="load" />
  </node>
</launch>

run it using roslaunch move_base.launch

p.s. By the way the <param name="transform_tolerance" value="0.2" /> does not change the default value which is 0.1 as well.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2012-05-05 10:50:39 -0600

Eric Perko gravatar image

In your amcl_diff_with_map_hwk.launch file, you have odom_frame_id listed twice, once near the top with the value of odom_combined and once near the bottom with the value odom. When you have the same parameter listed multiple times, it retains the last value set, in this case, odom. Your transform_tolerance parameter has the same problem.

Remove the extra lines so that you are only setting the parameters once to the value you want and it should work.

edit flag offensive delete link more

Comments

I know it is absolutely a beginner's mistake. Thank you for being patient with me.

Torres gravatar image Torres  ( 2012-05-10 03:37:44 -0600 )edit

Thanks again =)

Torres gravatar image Torres  ( 2012-05-10 03:38:27 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2012-05-04 20:54:34 -0600

Seen: 5,767 times

Last updated: May 05 '12