Aruco Z-error


In “Run Script to Track Aruco” we run our first aruco sim script.

The SITL is instructed to TAKEOFF 3, yet the camera MARKERPOSITION z-error is almost 4 relative to ground. At TAKEOFF 7 the camera shows between 8.5-8.8. So the camera appears to have a positive bias to the vehicle.

In simulation what accounts for this rather large error and how would we know which is most accurate? Does the SITL use GPS or barometric pressure in GUIDED mode? How can we optimize the camera vs vehicle sensor error?


Great question @jax200

I think there are a couple reasons why there could be a descrepency. The main contributing factor I think is the following:


When we import the aruco image into gazebo, we tell it how large we want the image to be in the world file. So if we wanted to import this image into gazebo at 20cm, we could do that. However, actual aruco length is measured from black corner to black corner, so maybe the actual length in the gazebo world is 15 cm. This would make the drone seem as if it is farther away from the target than it really is (because the aruco marker appears ‘smaller’).

Some tweaking could be done to get more exact with the gazebo z reported dimension of the track aruco script. However, we are only using the x,y distance data for our openCV precision landing, and the z data is not used- so tweaking would not improve PL performance.

The SITL vehicle reports altitude with the barometer. Other reasons why there might be a descrepency in the real world:

  • Imperfect camera calibration
  • Imperfect barometer readings

But again, only the x,y errors are used, so the discrepancy isn’t a huge deal. It would be of bigger concern if the z data was being used in place of a rangefinder.

In the real world, here is an example of why the reported openCV z data would be higher than the baro altitude: baro drift pushed the barometer readings lower over time. The green line is the baro and the red line is the more accurate rangefinder altitude

Good question!


As shown above, a rangefinder might have relatively less-variable output that is insensitive to changes of air density, but over some terrain such as fields of corn or heavy brush I thought it could be rather inconsistent, and maybe even more variable than baro?


This is correct, barometers will not respond to the terrain below the drone, rangefinders will. There may be some surfaces that refract the pulsed light from the LiDar unit in a way that is unreadable or inaccurate (baros wouldn’t have this issue), but I believe these surfaces are not really too common. Rangefinders are less prone to output drift, while barometers are. They both bring something to the table.