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.


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


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.



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.


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:

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]

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

Bro, I am also building a rover with Pixhawk 2.4.8 and the Jetson Nano, but my rover works outdoors in between plants and agriculture. I recently heard on RPLidar A2 and A3, can I use these? My doubts are: does ROS/Google Cartographer work on Pixhawk 2.4.8 and the Jetson Nano, and which lidar can I use?
I’m hoping you can help me.


Yes, that could work. The ROS/Google Cartographer setup is a little difficult but it should work.

By the way, the RPLidar lidars don’t work very well outdoors. They’re very susceptible to glitches caused by bright sunlight. The A2 is especially bad, the S1 is pretty bad, the S2 might work but I haven’t tested it myself.

Sir could you please suggest me any ways to learn and correctly use Google cartographer with lidar.

Also does these produces work with pixhawk 2.4.8.

Can you please suggest me any lidar on cost effective under 50,000 - 70,000 inr ( Indian rupees ).

Need Help Using ROS Cartographer with Pixhawk 2.4.8 and Jetson Nano

Hi there,

I have a few questions and could use some guidance on using ROS Cartographer with my Pixhawk 2.4.8 and Jetson Nano setup. Can you help me out?

  1. Can I use the Jetson Nano as a companion computer for ROS Cartographer with my Pixhawk 2.4.8?
  2. How should I connect the LiDAR: directly to the Jetson Nano or to the Pixhawk 2.4.8 board?
  3. Do I need to use MAVSDK for this integration ?
  4. To give you context, my project involves a Pixhawk-based rover with skid steering, using ROS for non-GPS navigation. I also have an Arduino Nano for pan and tilt control and want to implement the YOLO algorithm for object detection with a Logitech camera.

I’m a bit stuck and any help would be much appreciated and useful for me. Thanks!