[Closed] Over-rotation of the AMR in the opposite direction before taking turns

I am working on a project where in the robot moves in a specific path (coordinates provided via csv format). I have noticed that before it rotates left, it always rotates 10-20 degrees right and then rotates left and starts moving towards next goal, while on the other hand it rotates perfectly on the left side as per the angle provided via csv file. This leads to increase in the overall time of the loop.
I am using ROS2 and I am controlling the mobile robot via python code

Please find below my launch file final.launch

<launch>
    <include file="$(find my_navigation)/launch/individual_launch/trial.launch" />
    <include file="$(find rplidar_ros)/launch/rplidar_s2.launch" />
    <include file="$(find my_navigation)/launch/individual_launch/movebase.launch" />
    <!--include file="$(find my_navigation)/launch/individual_launch/goal_seq.launch"-->
</launch>

And also the trial.launch file

  <launch>
      <node name="i_o_datarequest" pkg="my_navigation" type="i_o_datarequest.py">
    </node>
  
      <!-- Map File -->
    <arg name="map_file" default="$(find my_navigation)/maps/trimline_8dec_half_edit.yaml"/> 
    <!-- Map Server -->
    <!-- Publish: /map, /map_metadata -->
    <node pkg="map_server" name="map_server" type="map_server" args="$(arg map_file)"> </node>
  
  
    <param name="robot_description" command="$(find xacro)/xacro.py  '$(find m2wr_description)/urdf/tata_amr.xacro'"/> 
    <!-- send fake joint values -->
    <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
      <param name="use_gui" value="False"/>
    </node>
    <!-- Combine joint values -->
    <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher">
    <param name="publish_frequency" type="double" value="50"/>
    </node>
    <!-- Show in Rviz   -->
    <node name="rviz" pkg="rviz" type="rviz" />
    
    <node pkg="tf" type="static_transform_publisher" name="base_footprint_to_base_link" args="0 0 0.075 0 0 0 base_footprint base_link  100" />
    
  
    <rosparam command="load" file="$(find roboteq_motor_controller_driver)/config/query.yaml" />
    <node name = "roboteq_motor_controller_driver" pkg = "roboteq_motor_controller_driver" type = "roboteq_motor_controller_driver_node" output = "screen">
    <remap from="/cmd_vel" to ="/amr/cmd_vel"/>
    </node>
  
    <node name = "cmd_vel_to_amr_vel" pkg = "roboteq_motor_controller_driver" type = "cmd_vel_to_amr_vel.py" output = "screen">
    </node> 
  
    <node name = "odom_from_encoder" pkg = "roboteq_motor_controller_driver" type = "odom_from_encoder.py" output = "screen">
    </node>
  
  
  	
  
    <node pkg="laser_filters" type="scan_to_scan_filter_chain"
        name="laser_filter">
      <rosparam command="load" file="$(find laser_filters)/param/my_laser_config.yaml" />
      <param name="tf_message_filter_target_frame"    type="string"   value="sensor_laser"/>
    </node>
    <node pkg="my_navigation" type="sound.py"
        name="sounds">
    </node>
  
    <!-- Add AMCL example for differential drive robots for Localization -->
    <!-- Subscribe: /scan, /tf, /initialpose, /map -->
    <!-- Publish: /amcl_pose, /particlecloud, /tf -->
    <!--include file="$(find amcl)/examples/amcl_diff.launch"/-->
  
    <node pkg="amcl" type="amcl" name="amcl" output="screen">
      <!-- Publish scans from best pose at a max of 10 Hz -->
      <remap from="scan" to ="/scan_filtered"/>
      <param name="odom_model_type" value="diff"/>
      <param name="use_map_topic" value="false"/>
      <!--param name="odom_alpha5" value="0.1"/-->
      <param name="transform_tolerance" value="0.5" />
      <param name="gui_publish_rate" value="10.0"/>
      <param name="laser_max_beams" value="180"/>
      <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="1.5"/>
      <param name="odom_alpha2" value="1.0"/>
      <!-- translation std dev, m -->
      <param name="odom_alpha3" value="0.5"/>
      <param name="odom_alpha4" value="0.5"/>
      <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.7"/>
      <param name="laser_sigma_hit" value="0.2"/>
      <param name="laser_lambda_short" value="0.1"/>
      <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.1"/>
      <param name="update_min_a" value="0.2"/>
      <param name="odom_frame_id" value="odom"/>
      <param name="resample_interval" value="1"/>
      <param name="recovery_alpha_slow" value="0.0"/>
      <param name="recovery_alpha_fast" value="0.0"/>
      <param name="initial_pose_x" value="16.05"/>
      <param name="initial_pose_y" value="21.5"/>
  
    </node>
  </launch>

I have already switched off the recovery behavior of the robot and also defined the latch_xy_goal_tolerance as False

Can someone please guide me through any way out?

Hello @User_19 and welcome to the Husarion Community

We will take a closer look at this issue and let you know in a few days! In the meantime, I encourage the rest of the community to help out.

Best regards
Jan Brzyk

1 Like

Hi @User_19!
Please send me a repository what your project is based on.

You are using ROS 2 to control the robot but the navigation stack is on ROS 1 yes?
Best regards,
Jakub Delicat

Hi @JakubDelicat , yes that’s right.

I couldn’t understand what exactly the repository you are talking about, do you mean the catkin package file ?

Hi @User_19 ,
the ROS 1 navigation system for ROSbot is out of date. We are following the newest versions and releases for ROS 2. I recommend you to check rosbot-navigation demo which is up-to-date. Try to make your project on this template. If you have any issues just write!

Best regards,
Jakub Delicat

Alright, that’s gonna take time since the system is working well just except the over-rotation issue
Can you point out or have idea about any such causes related to over-rotation inspite of no such commands being given to the bot?

I don’t understand what package/program exactly sets velocities for the robot. What is publisher on /cmd_vel?

Your project is open? Could you share the repository?