Navigation problem: Robot does not move while there is no obstacle

asked 2020-12-19 10:12:42 -0500

Eman.m gravatar image

updated 2020-12-22 14:42:53 -0500

Hi I am using simulated robot Rosbot2.0. I wrote: the lunch file for the navigation stack with all required yaml files. However, the robot does not move.

Here is my lanuch file: rosbot_navigation_move_rosbot.launch

<launch>
     <arg name="use_rosbot" default="false"/>
<arg name="use_gazebo" default="true"/>

<param if="$(arg use_gazebo)" name="use_sim_time" value="true"/>

 <!-- Bring the ROSbot model and show it in Gazebo and in Rviz  -->
 <include file="$(find rosbot_description)/launch/rosbot_rviz.launch"/>

<!-- Map server -->
<arg name="map_file" default="$(find rosbot_navigation)/maps/gridMap8by8.yaml"/>
<node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />

<!--- tf -->
<node if="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="base_link_to_laser" args="0 0 0 3.14 0 0 base_link laser 100" />


<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -x 5.5 -y 6.5 -z 0.0 -model rosbot" />

<node pkg="joint_state_publisher" type="joint_state_publisher" name="joint_state_publisher">
<param name="publish_frequency" type="double" value="30.0" />
</node>

 <!--- Localization: Run AMCL -->
<node pkg="amcl" type="amcl" name="amcl" output="screen">
    <remap from="scan" to="/scan"/>
    <param name="odom_frame_id" value="odom"/>
    <!-- <param name="odom_model_type" value="diff-corrected"/> --> 
    <param name="odom_model_type" value="diff"/>
    <param name="base_frame_id" value="base_link"/>
    <param name="update_min_d" value="0.05"/>
    <param name="update_min_a" value="0.1"/>
    <param name="min_particles" value="500"/>
    <param name="max_particles" value="10000"/>
    <param name="initial_pose_x" value="5.5"/>
    <param name="initial_pose_y" value="6.5"/>
</node>

<!-- Move base -->
<node pkg="move_base" type="move_base" name="move_base" output="screen">
    <param name="controller_frequency" value="2.0"/>
    <rosparam file="$(find rosbot_navigation)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find rosbot_navigation)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find rosbot_navigation)/config/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find rosbot_navigation)/config/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find rosbot_navigation)/config/trajectory_planner.yaml" command="load" />
</node>

</launch>

The yaml files: costmap_common_params.yaml

obstacle_range: 6.0
raytrace_range: 8.5
footprint: [[0.12, 0.14], [0.12, -0.14], [-0.12, -0.14], [-0.12, 0.14]]
map_topic: /map
subscribe_to_updates: true
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: scan, marking: true, clearing: true}
global_frame: map 
robot_base_frame: base_link
always_send_full_costmap: true

global_costmap_params.yaml

  global_costmap:
      global_frame: map
      update_frequency: 0.5
      publish_frequency: 1.5
      transform_tolerance: 0.5
      width: 8
      height: 8
      origin_x: 0
      origin_y: 0
      rolling_window: false
      inflation_radius: 0.0 
      cost_scaling_factor: 1.0 
      resolution: 1
      plugins:
    - {name: static_layer, type: "costmap_2d::StaticLayer"}

local_costmap_params.yaml

local_costmap:
  global_frame: odom
  update_frequency: 2.5
  publish_frequency: 2.5
  transform_tolerance: 0.25
  static_map: false 
  rolling_window: true
  width: 3 
  height: 3
  origin_x: 0
  origin_y: 0
  resolution: 1
   inflation_radius: 0.0 
   cost_scaling_factor: 1.0

trajectory_planner.yaml

   TrajectoryPlannerROS:
 max_vel_x: 0.1
 min_vel_x: 0.05
 max_vel_theta: 2.5
 min_vel_theta: -2.5
 min_in_place_vel_theta: 0.5
 acc_lim_theta: 1.0
 acc_lim_x: 1.5
 acc_lim_Y: 1.5
 holonomic_robot: false

 xy_goal_tolerance: 1.0 # was 0.1
 yaw_goal_tolerance: 6.26 ...
(more)
edit retag flag offensive close merge delete

Comments

Hello, Please Subscribe to cmd_vel while defining a goal and tell me the results. Is the algorithm sending command to your robot?

navid gravatar image navid  ( 2020-12-20 02:10:18 -0500 )edit

Many Thanks. I am new to ROS. How can I subscribe to cmd_vel while defining a goal ?

After I set the goal, I run:

rostopic echo cmd_vel

WARNING: no messages received and simulated time is active. Is /clock being published?

Eman.m gravatar image Eman.m  ( 2020-12-20 02:25:17 -0500 )edit

I have read that if the goal is close to a wall, the recovery behavior starts.

Eman.m gravatar image Eman.m  ( 2020-12-20 02:37:14 -0500 )edit

so I tried to set a goal that is not close to any obstacle, I will post the results here.

Eman.m gravatar image Eman.m  ( 2020-12-20 02:38:03 -0500 )edit

The edit is in the post above.

Eman.m gravatar image Eman.m  ( 2020-12-20 03:15:20 -0500 )edit

First see if cmd_vel is published using:

rostopic list

Then:

rostopic echo /cmd_vel
navid gravatar image navid  ( 2020-12-20 04:06:13 -0500 )edit

Is the blue line the global plan? Also, try changing resolution in both global and local costmap parameters to something smaller, like 0.1. It may be that the planner can't find a path because its choices are limited by the resolution.

tryan gravatar image tryan  ( 2020-12-21 08:57:29 -0500 )edit

Thanks navidzarrabi .

rostopic list ==> gives /cmd_vel

However, rostopic echo /cmd_vel ==> gives:

WARNING: no messages received and simulated time is active.

Is /clock being published?

Eman.m gravatar image Eman.m  ( 2020-12-22 11:55:45 -0500 )edit