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

my robot seems crazy

asked 2020-05-25 09:56:15 -0500

Davide gravatar image

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 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-05-25 11:11:58 -0500

Dragonslayer gravatar image

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

edit flag offensive delete link more

Comments

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?

Davide gravatar image Davide  ( 2020-05-25 12:36:40 -0500 )edit

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.

Dragonslayer gravatar image Dragonslayer  ( 2020-05-25 13:02:05 -0500 )edit

Ok, thanks fro your suggestions, bye

Davide gravatar image Davide  ( 2020-05-25 13:52:45 -0500 )edit

Question Tools

Stats

Asked: 2020-05-25 09:56:15 -0500

Seen: 152 times

Last updated: May 25 '20