0
$\begingroup$

Rosanswers logo

hi everyone, I'm trying to create a small simulation for my custom robot. everything seems to work properly until I try to send goals to the robot. the robot starts to skid left and right. instead if I send commands via cmd_vel (with rqt), the robot performs well. here a short video to show the problem: https://youtu.be/CMGRvvtjGXY I have checked my launch file and my configuration files several times but I still cannot understand what the error is. i'm working with ros melodic on ubuntu on a virtual machine, and below the files that I am using for my simulation.

launch file:

<launch>
  <!-- Vehicle pose -->
  <arg name="x" default="3.0"/>
  <arg name="y" default="3.0"/>
  <arg name="z" default="0.23"/>
  <arg name="roll" default="0.0"/>
  <arg name="pitch" default="0.0"/>
  <arg name="yaw" default="3.1415"/>

  <arg name="ini_x" default="3.0"/> 
  <arg name="ini_y" default="3.0"/> 
  <arg name="ini_a" default="3.1415"/>

  <!--<param name="/use_sim_time" value="true"/>-->
   <master auto="start"/>


  <!-- Create the world. includo un launch file esterno passandogli "world_name" come argomento-->
  <include file="$(find gazebo_ros)/launch/empty_world.launch" >
    <arg name="world_name" value="$(find world_description)/worlds/factory.world" />
    <!--<arg name="paused" value="false" />
    <arg name="gui" value="false"/>
    <arg name="headless" value="true"/>-->
  </include>

  <!-- Load the URDF into the ROS Parameter Server -->
  <param name="robot_description"
     command="xacro '$(find robot_description)/urdf/differential/differentialRobot_v003/differentialRobot_v003.urdf.xacro'" />

  <!-- Spawn a differential_robot in Gazebo, taking the description from the parameter server -->
  <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model"
        args="-param robot_description -urdf -model differentialRobot
        -x $(arg x) -y $(arg y) -z $(arg z)
        -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)" />

  <!--Convert /joint_states messages published by Gazebo to /tf messages, e.g., for rviz-->
  <node name="robot_state_publisher" pkg="robot_state_publisher"
        type="robot_state_publisher"/>

  <!-- Load a map into the map server-->
  <node name="map_server" pkg="map_server" type="map_server"
        args="$(find world_description)/maps/factory/factory.yaml"/>

  <!-- AMCL node (with initial pose)-->
  <include file="$(find robot_description)/config/differentialRobot_v003/amcl_config/amcl_diff.launch">  
    <arg name="init_x" value="$(arg ini_x)" />
    <arg name="init_y" value="$(arg ini_y)" />
      <arg name="init_a" value="$(arg ini_a)" />
  </include>


  <!-- Navigation stack-->
  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <rosparam file="$(find robot_description)/config/differentialRobot_v003/nav_config/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find robot_description)/config/differentialRobot_v003/nav_config/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find robot_description)/config/differentialRobot_v003/nav_config/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find robot_description)/config/differentialRobot_v003/nav_config/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find robot_description)/config/differentialRobot_v003/nav_config/base_local_planner_params.yaml" command="load" />
    <param name="use_sim_time" value="false" />
  </node>


  <!-- Starting Rviz-->
  <node pkg="rviz" type="rviz" name="rviz" args="-d $(find robot_description)/config/differentialRobot_v003/rviz_config  /differentialRobot_v003.rviz"/>

  <!-- Starting Rqt gui-->
  <node name="rqt_gui" pkg="rqt_gui" type="rqt_gui"/>

</launch>

base_local_planner_params.yaml

TrajectoryPlannerROS:
  max_vel_x: 1.0
  min_vel_x: 0.1
  max_vel_theta: 1.0
  min_in_place_vel_theta: 0.2
  acc_lim_theta: 1
  acc_lim_x: 1
  acc_lim_y: 0
  holonomic_robot: false

costmap_common_params.yaml:

obstacle_range: 3.0
raytrace_range: 3.5
#footprint: [[0.35, 0.15], [0.35, -0.15], [-0.35, -0.15], [-0.35, 0.15]]
robot_radius: 0.8
inflation_radius: 1.0
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: hokuyo_link, data_type: LaserScan, topic: /scan, marking: true, clearing: true}

global_costmap_params.yaml

global_costmap:
global_frame: map
robot_base_frame: base_link
update_frequency: 0.5
static_map: true

local_costmap_params.yaml

local_costmap:
 global_frame: odom
 robot_base_frame: base_link
 update_frequency: 0.5
 publish_frequency: 1
 static_map: flase
 rolling_window: true
 width: 3
 height: 3
 resolution: 0.05

can someone help me?


Originally posted by Davide on ROS Answers with karma: 3 on 2020-05-25

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Hi, some suggestions. Its important that the velocitys and acceleration limitis in base_local_planner.yaml are correct. I red that if they are false the planner might exhibit a behaviour thats similar to a "pid" controller, giving you oscillations. Also this settings should be expressed as floats. not 1 but 1.0 values as it otherwise might lead to unwanted typecasting and unprecise calculations. Further more, most planners (Iam not totally sure about the trajecotryplanner, dwa_local_planner seems to be the way to go now) have oscillation settings. If those are not in harmony with the rest of the parameters they might generate this behaviour, what would be tiny corrections are forbidden and grow to big oscillations. Also some planners have Pathdistance Bias and Goaldistance Bias parameters, they define whats more important, staying on the path or reaching the goal. Your video seems to show high path distance bias. Helpfull tuning guide: link text


Originally posted by Dragonslayer with karma: 574 on 2020-05-25

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Davide on 2020-05-25:
Thanks Dragonslayer! I changed the local_planner, now I use dwa_local_planner, and the situation has improved a lot, even if the parameters I'm using are not exactly correct (I took them from an example found on the net). I will read the guide you linked

you wrote "(Iam not totally sure about the trajecotryplanner, dwa_local_planner seems to be the way to go now)", what do you mean? do you advise another local or global planner?

Comment by Dragonslayer on 2020-05-25:
Your welcome. Dwa_local_planner is "the new" trajectory planner so to speak. Instead of taking "long" trajectories to score, dwa (dynamic window approach) only takes them as long as relevant for the controller step, thus reducing computing resources needed. But there is a parameter simulation_time that lets you take longer trajectories into account. This might come in handy as you will read in the guide. Yes with parameters from the web you can get lucky or end in a nightmare. But as your robot seems turtlebot like you seem to be setup to get good results quickly as its kind of a reference for many standard packages.

Comment by Davide on 2020-05-25:
Ok, thanks fro your suggestions, bye

$\endgroup$

Your Answer

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