Non-GPS Navigation using Rover with ROS/Google Cartographer


This is a first test of using Google Cartographer with ArduPilot Rover-3.5-dev with the help of ROS/mavros. There’s a GPS on the vehicle but it is disabled for this test as is the object avoidance.

The hardware used is:

The results are OK but not great (yet). Cartographer was certainly better than the earlier test with HectorSLAM (video, wiki) which is expected because Cartographer is 3D while HectorSLAM is only 2D.

For the most part, Cartographer was able to estimate the vehicle’s position within about 1m but there were times where it would suddenly deviate by 3 or 4 meters (look at the video around 1:30 and compare what the rover on the map does compared to the actual rover).

This is a work-in-progress and we’ve got some ideas to improve performance including:

  • upgrade the lidar to an RPLidarA3 (with 25m range)
  • check the update rate of IMU data flowing from ArduPilot to ROS/Cartographer. We should try and achieve at least 50hz I think
  • check the overall lag in the system by moving the rover back and forth and then compare the IMU data (from ArduPilot’s IMUs) to the position estimates received by ArduPilot from Cartographer (these appear in the VISP messages in the dataflash logs)
  • improve the clock syncronisation between the Cube and TX2 to better account for the lag in the system

As always this is all fully open source so you can find setup instructions are here on the developer wiki. If you’re interested in getting involved with this or other non-GPS navigation projects, you’ll find a helpful band of skilled developers the ArduPilot/VisionProjects Gitter channel.

Special thanks to Mario Rodriguez from EAMS Lab who has been doing the bulk of the work on this project.

6 Likes

very nice! I hope we can renforce our tutorial with more example from ROS!

1 Like

Hi @rmackay9,
Cheers for a great guide. I have Cartographer running with RPLidarA2. MavRos is working pretty well.
One problem I am having is with time sync. I followed the guide and made the suggested changes but am still receiving the same old errors. Wrong FCU time and RTT too high. The FCU doesn’t seem to have a time set.

Any thoughts? Thanks heaps, Ben

Hello, starting with the same configuration.Any advice appreciated.The sync error are to be accepted for now.Actually i am trying with ROS, because i hope for better precision on slow 2wd robot.If only i could set a lower values than one meter for avoidance in pixhawk.The Rplidar A2 shows objects below 1m but i can not use it in cca 2m wide corridor.Perhaps i should have installed two front unidirectional lidars instead . I hope you will continue to adapt the avoiding logic for use in slow moving rovers.Thanks

1 Like

@BenBBB,

Sorry for missing this message. I think the cause of the problem is Rover’s main loop only runs at 50hz which means that responses to time sync messages can be anywhere from 0ms to 20ms after the request. The time sync code in mavros expects a response within 10ms and if it doesn’t get it, it sends out that message.

There is a parameter SCHED_LOOP_RATE (or similar) which allows increasing the Rover’s main loop rate to 200hz and if that’s done I think the messages will mostly go away.

Again, sorry for the slow response.

Great, will try that.Thanks for all the work.
Its off topic, but can i expect
a change of functionality for 360 lidar to use it in “dodge” mode.(i need it for situation as in your video with cones left and right)Or should i go for cheaper and simplier solution with two benewake lidars?
I know you warned in wiki that 360 lidar is not to be used for that.

Thanks @rmackay9

I think I wrote that before you’d updated the guide with advice on changing those parameters. I changed them appropriately but still suffered the problem. Hoping to have a better result from the TX2 I just received. Takes the serial converter out of the loop.

Cheers,

Ben

Ok, i see i miss the point as it is not about avoidance but autonomous navigation in question.Still interested though and have it all set.I am guessing the changes about IMU in latest firmware 3.5.1 will help with accuracy.

Hi,

I know this post is quite old, but I’m trying to run cartographer on a pixhawk 4 and Nvidia TX2 and am trying to troubleshoot.

I get stuck at the setup instructions from: http://ardupilot.org/dev/docs/ros-cartographer-slam.html

In particular, the step of roslaunch mavros apm.launch fcu_url:=udp://:14855@

The pixhawk is connected over UART, so we actually have:

roslaunch mavros apm.launch fcu_url:="/dev/ttyTHS2:921600"

(A baud rate of 1500000 wasn’t being accepted)

but once I launch this command, I see nothing from Mission Planner. It connects fine normally (the components we’re using have some built-in software and we’re still trying to figure out how that was originally configured) but when I try to connect deliberately over mavlink this way I can’t get mission planner to connect also. The ros command appears to work fine, and the ROS/LiDAR end of the system appears to be working fine as well.

Any thoughts would be greatly appreciated!

1 Like

Hi @triton,

Although I wrote the post I’m not much of an expert on this sort of thing. Maybe trying asking in our gitter channel for “vision projects” - I think there’s a higher chance that someone there will know the answer.

Hello @triton, this command can help if you want to be connected to Pixhawk through serial and GCS (through WiFi for example) :
roslaunch mavros apm.launch fcu_url:=[port]:[baudrate] gcs_url:=udp://[Jetson_IP]:[port]@[GCS_IP]:[port]
http://wiki.ros.org/mavros#gcs_bridge

1 Like

Hello, i got the system working with RPI3. I set Home and Ekf home through mission planner. I have to have VISO_TYPE = 1 to be able to put it in auto mode.I have skid steering servo setup and it kinda works, but the orientation within mission planner is allways reversed. I tried many things, turning RPlidar arround even changing VISO_ORIENT, but the robot allways behaves inverted in relation to the North. As it turns correctly regarding relative bearing, it is still usable, but a bit awkward to plan a path. I allways start it turned to north (aproximately), but it does not help. I will also try to change the servo to normal throttle - steering configuration, as i noticed that at least in SITL the skid Rover behaves weird even when starting with --model=rover-skid. Thanks for any idea regarding the subject.

Update on Rplidar orientation.
I have phisically oriented pixhawk to the north and Rplidar to the east before booting the system.In misson planner all looks good,and wehicle simbol is facing east according to Rplidar.So there is obviously a 90 degree offset between Ros and Pixhawk imu. @rmackay9 do you have a hint on how to correct this. In Ros or in the Pixhawk ?Or could you point me at where to look for the answer ?
Thanks a lot.

Update:After some reading i can see it is not that simple and simply offsetting for 90 degrees does not make much sense.I returned FMu to aligned position and it works the same.Sorry for the “noise”

why the obstacle distance is not detected like in your video?

Hi @Hanifwj,

Re obstacles not being detected, can you provide more info on the setup and an onboard log in a new topic in the Rover 4.x support forums?

Solved, the solution like this topic in How to add obstacle_distance plugin in mavros? - #3 by siddharth_b
Thanks for your respon @rmackay9