3
$\begingroup$

I am currently working on developing a ROS application for autonomous navigation using AMCl. I am first trying to get move_base to work before continuing with AMCL. I came across an issue that shows the LaserScan rotating in a similar fashion to the robot when I use teleop_twist_keyboard to manually rotate the robot. I am using the rplidar_ros package to run the lidar and the create_autonomy package for controlling the robot. I have tried searching for an issue similar to mine and could not find one.

Hardware: - Robot: iRobot Create 2 - Lidar: RPLidar A1M8 - Computer: Jetson NX with Ubuntu 18 running ROS Melodic

Launch File:

<?xml version="1.0"?>
<launch>

  <arg name="use_robot" default="true" />
  <arg name="use_gazebo" default="false" />
  <arg name="gui" default="false"/>


  <include if="$(arg use_gazebo)" file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(find example_bot_sim)/worlds/maze.world"/>
<arg name="paused" value="false"/>
<arg name="use_sim_time" value="true"/>
<arg name="gui" value="$(arg gui)"/>
    <arg name="headless" value="false"/>
    <arg name="debug" value="false"/>
    <arg name="verbose" value="true"/>
  </include>

  <!-- Spawn Robot 
       This must be the same robot type as the robot application
  -->
  <include if="$(arg use_gazebo)" file="$(find example_bot_sim)/launch/spawn_bot.launch">
      <!-- Override arg parameters here e.g,
          <arg name="x_pos" default="10.0"/>
          <arg name="y_pos" default="5.0"/>
     -->
  </include>



  <include if="$(arg use_robot)" file="$(find ca_driver)/launch/create_2.launch" />


  <node pkg="tf" type="static_transform_publisher" name="laser_broadcaster" args="0 0 0 0 0 0  base_link laser 100" />


  <include if="$(arg use_robot)" file="$(find rplidar_ros)/launch/rplidar.launch" />

  <include file="$(find example_bot_sim)/launch/gmapping.launch"/>

  <include file="$(find example_bot_sim)/launch/move_base.launch"/>


  <node pkg="rviz" type="rviz" name="rviz"/>


</launch>

Initial robot pose:

Robot pose after moving:

rosrun tf view_frames output:

$\endgroup$
1
  • $\begingroup$ I'm having the same problem and wondering if you have solved this issue? $\endgroup$ Apr 5 at 10:42

1 Answer 1

2
$\begingroup$

Behavior like this suggests that your odometry is not being computed properly when the vehicle turns. It's hard to tell but the model appears to have rotated about 90 degrees but the laser scans appear to have rotated close to 180 degrees comparatively. There may be an issue with your wheel radius or some similar setting. Alternatively there could be a sign error on the directions. And thinking about it for a doubling error like that you may have the laser indicated as mounted upside down such that left is right and right is left for the laser. If that's the case you just need to invert the axes for the static transform publisher.

Note that an animation or video of the robot when it's turning will tell you a lot of information about the errors as you can see the progression. It's also helpful to enable the transform tree to debug where they are in space while things are updating.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy