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!