# Hires With AprilTags

Source: https://forum.modalai.com/topic/3684/hires-with-apriltags
Category: Autonomy: VIO, Mapping and Navigation (https://forum.modalai.com/category/19/autonomy-vio-mapping-and-navigation)
Tags: apriltag
Posted: 2024-07-28 09:58:03 UTC by jacob yaacubov
Replies: 5 · Views: 4118

## jacob yaacubov · 2024-07-28 09:58:03 UTC

Hi guys i have a hires IMX412 mounted on my drone , my camera is looking to the right side of the drone (Positive y axis on the local frame)

I have configured the tag rotation matrix from tag to fixed correctly my tag is hanged on the wall.

but seems  the drone rotating 90 degrees CCW, I guess its doing this since it assumes the camera which is catching the tag,  is mounted at the front
hence, when right side camera sees the **tag** it rotates to the left (ccw) to "fix" this!

I tried to add extrinsics  to extrinsics.conf  both from IMU to hires and from body to hires with the correct camera name (which used in voxl-camera-server)  
but it has no effect 
any one had this issue ? any suggestions ? does the voxl code is really taking into account that tags are seen only in front of the drone (X axis) 
![Screenshot from 2024-07-28 12-54-01.png](https://forum.modalai.com/assets/uploads/files/1722160678685-screenshot-from-2024-07-28-12-54-01.png) 
Thanks

## Reply by jacob yaacubov · 2024-07-28 09:59:02 UTC

@jacob-yaacubov the picture describes TOP VIEW  the tag is attached to a wall

## Reply by Alex Kushleyev (ModalAI staff) · 2024-07-30 21:00:34 UTC (in reply to jacob yaacubov)

@jacob-yaacubov , it seems the voxl tag detector sends out the tag info with respect to the camera (not drone) frame : https://gitlab.com/voxl-public/voxl-sdk/services/voxl-tag-detector/-/blob/master/server/main.cpp

You can check the consumer of the tag data to see what transforms it is using to put the tag in the global frame.

Alex

## Reply by jacob yaacubov · 2024-07-31 11:55:19 UTC (in reply to Alex Kushleyev)

@Alex-Kushleyev 
basically the consumer is the vision hub 
specifically  [https://gitlab.com/voxl-public/voxl-sdk/services/voxl-vision-hub/-/blob/v1.7.3/src/geometry.c?ref_type=tags](link url) 
as far as i understood 
and i am trying to fix the right part 

the issue lies in this transformation i marked red .. i think i need to change the cam_wrt_to_imu since it looks like 
the code assumes my hires in looking forward of the drone while its actually mounted on the right side ( Local frames  Y axis) 
so tag works well and detection of my tag on fixed is Ok but when afterwards drown is moving with just qvio without tag the axis are flipped 

![d45f4d1b-a3cc-43c3-9681-8353e353be1b-image.png](https://forum.modalai.com/assets/uploads/files/1722422149644-d45f4d1b-a3cc-43c3-9681-8353e353be1b-image.png) 

voxl-vision-hub -g output 
example 
![781e3a82-4240-4564-8fe9-6e1e6b1b655a-image.png](https://forum.modalai.com/assets/uploads/files/1722423195258-781e3a82-4240-4564-8fe9-6e1e6b1b655a-image.png) 

y can see that fixed_wrt_local  x=-0.83  while it corresponds to the local_wrt_fixed y= 0.83 so the frames i get from both arrow in the pic above are not the same do you have suggestions where should i start with , should i modify the geometry.c?

## Reply by Alex Kushleyev (ModalAI staff) · 2024-08-01 16:15:04 UTC (in reply to jacob yaacubov)

@jacob-yaacubov , I am not 100% sure but it looks like the code assumes that the tags are being detected by the same camera that is doing vio (tracking camera). In your case this assumption is not true, because you are using Hires camera for the tag detection.

I need to check with @James-Strawson about this, but he is out of office. I will ask around.

Alex

## Reply by jacob yaacubov · 2024-08-06 08:04:54 UTC (in reply to Alex Kushleyev)

@Alex-Kushleyev yes seems like it, thank you!
