0
$\begingroup$

Rosanswers logo

Using RPLIDAR A1M8 on ROS2, navigation 2. I am getting very buggy and odd movement and then during SLAM testing I realized that it is detecting backwards.

I put my hand in front of the robot/LIDAR and then the RVIZ updates behind the robot and also left/right is mixed up.

I cant find much of anything online for this issue anyone seen this?


Originally posted by philmurp on ROS Answers with karma: 26 on 2021-10-20

Post score: 0


Original comments

Comment by gvdhoorn on 2021-10-21:
REP-103: Standard Units of Measure and Coordinate Conventions - Coordinate Frame Conventions dictates the "forward direction" is along X+.

Is your lidar (or its TF frame) mounted with its X+ frame in the forward direction in your URDF?

If not, that could be the cause of what you describe.

And pedantic, but your lidar is not "sending backwards" (as it can't do that). It's more likely the data is being interpreted in an incorrect way due to a modelling error/mistake.

Comment by philmurp on 2021-10-21:
According to the URDF model when I visualize it, the LIDAR is on the front of the robot and pointing forward towards X+.

I looked into the URDF .xacro file and was able to change the last digit of the 'rpy' to 3.14 and that worked.

 <xacro:property name="laser_pose">
    <origin xyz="0.12 0 0.33" rpy="0 0 3.14"/>
  </xacro:property>

Now it senses properly and my localization is working. However I am having two major issues trying to figure out:

  1. I can use SLAM and save a map, then when I open navigation it loses the map and starts in the unknown. Picture 1

  2. I have odometry issues I believe. When I set initial post the RVIZ map starts to vibrate, and then the planned path is super choppy and robot takes forever to get to even the simplest route. I tried adjusting AMCL alpha parameters up or down, no luck and then the particle cloud delocalizes to the robot. Pics 2 and 3

Comment by Mike Scheutzow on 2021-10-22:
@philmurp It's ok for you to answer your own question if you figured it out.

Regarding your new questions: this site is organized as 1 question per post. After you make an effort to search the site for a answers to your new questions, feel free to ask a new question if you can't find a good answer. I'll point out that there are many existing answers related to configuring slam.

Comment by philmurp on 2021-10-22:
Good input I should not have layered on to this same question.

Actually I think this is still giving me trouble. Although my laser scans make sense when I put objects up to the LIDAR, as you can see in this Picture ; the frame of the laser is still opposite from the rest of the robot base. So when navigating the arrow comes up pointing backwards when I move forwards, I can imagine this is resulting in a lot of my issues with obstacle avoidance etc.

I tries flipping all the parameters, I just cant seem to figure out how to adjust the incoming laser scans from flipping. Also in that picture you can see the map and odom frame as disconnected from the bas, sure that isnt good either.

Comment by Mike Scheutzow on 2021-10-23:
There is nothing wrong with a sensor's Transform Frame not aligned with the base_link frame. It happens all the time. If it bothers you, then change how the lidar is mounted on the robot (and make the corresponding change to the urdf.)

You have not provided enough information for me to know what "the arrow comes up pointing backwards" means.

Comment by philmurp on 2021-10-23:
When I change rpy as above to 3.14, the laser scans perform as normal: I put an obstacle in front of the robot and the scan shows it in front (where as previously I put obstacle in front of the robot and the scan behind the robot would adjust).

But the laser axes are opposite than the rest of the base. The X-axis on the laser is pointing backwards when visualizing in URDF / SLAM when showing axes. So when I run navigation and give a goal and the robot starts moving towards that spot, RVIZ generates a "circle" around the robot and then an arrow of movement, that arrow is pointing backwards as the robot moves forward.

I am not sure, but think this might be why the robot doesnt avoid obstacles, I can usually send the robot to a location but if I put something in front of it, it runs into it. Tried reversing everything in URDF .xacro file with no luck.

There is a rplidar_compostion line when I run Bring_Up "flip_x_axis=0" but cant find where that is. Also maybe flip lase topic?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

So I took another look through my entire installation process and looked around on the hardware side. Based on RPLIDAR ROS Sheet I reversed how the RPLIDAR hardware was mounted.

Seemed to work, so now my frames and scans are aligned. Doing some testing still, not really avoiding obstacles yet either. I may play with some AMCL parameters to fine tune.

For this specific question I believe it is close for now unless something comes up in my further testing. Thank you for the help, it was much appreciated. Next, I will focus on the map issue now, where I save map in SLAM and then when I open navigation it starts from an unknown area.


Originally posted by philmurp with karma: 26 on 2021-10-23

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by gvdhoorn on 2021-10-24:
I've converted this to an answer as it seems to be the answer.

$\endgroup$

Your Answer

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