Indoor autonomous flight with Arducopter, ROS and Aruco Boards Detection

Hi Anbello,
I would like to run aruco board detection on a companion computer so I followed your tutorial here: https://ardupilot.org/dev/docs/ros-aruco-detection.html
Thank you for spending time to write your development down. It was very useful for me. Unfortunately the demo python scripts are not working well for me. My drone (149mm) is not able to follow the setpoints correctly. I guess the problem can be the processing power of my RPI. Or the problem can be RPI camera V1.3 or inconsistent frame rates in MAVROS. At first I would like to check the first point. I use Raspberry Pi 3B and not 3B+. Could you please tell me in that tutorial what type of RPI did you use? Maybe the 3B+? I would like to know whether my HW is capable to make the calculation or not.
Thanks for your answer in advance.

Hi Broodie, sorry for late replay.

The Raspberry Pi 3B is OK for this application. One problem could be the camera, I used a RPi camera 2.0, with 1.3 I had some problems, especially because it was a non original one.

Anyway to try to help you let me know if you had some problems in some point of the tutorial.
After launching the ROS nodes in ā€œStarting all ROS nodeā€ paragraph did you have some error?
Did you succeed to see the /mavros/vision_pose/pose and /mavros/local_position/pose messages?

Hi Anbello,

Thank you for your reply. It is glad to hear I donā€™t need to buy another RPi. :slight_smile:
Yes, Iā€™ve got correctly the /mavros/vision_pose/pose and /mavros/local_position/pose messages. I checked them in RVIZ. The /mavros/vision_pose/pose is working smoothly without any lag but the /mavros/local_position/pose is not following the /mavros/vision_pose/pose correctly. There is some delay between the two messages that was not seen in your videos. Currently Iā€™m trying to fine tuning the parameter EK2_EXTNAV_DELAY and set different mavros frame rates. I realized that EK2_EXTNAV_DELAY with value 35 is better for my drone than value 80. Iā€™m going to do some test in the next days and let you know the result. But if I can not manage to do that smooth autonomous moves with my drone like in your videos then I will buy an original V2 camera.
Thank you for your help.

Hi Anbello,

So Iā€™ve done some tests and it is turned out the best settings for me (Cloud-149 drone frame, 3" props, Omnibus F4 Nano V6.1, RPI 3B, Ubuntu20.04, ROS Noetic) is the following:

  • EK2_EXTNAV_DELAY 10
  • 640x480 60fps for V1.3 camera

So my drone can fly smoothly with autonomous control. I only have one problem with it and it is possible that this problem is not with ROS but with Ardupilot. During yaw change the /mavros/vision_pose/pose is working correctly (axes donā€™t change its position in RVIZ at all just heading is changing) because I set ā€˜camera_offset_yā€™ well but the /mavros/local_position/pose does not follow correctly the /mavros/vision_pose/pose topic. You can see there is a drifting on that axes. And this drifting is present during flight as well. The root cause of that is unknown for me at the moment. Do you have any idea maybe what can be the problem here?
Thank you for your answer in advance!
yaw_drifting

I had similar problems in two situations: wrong camera offset and / or wrong time offset (EK2_EXTNAV_DELAY).

You have drifting only on one axis, maybe you have to set also camera_offset_x (and z)? I seem to remember that x and y are swapped with respect to Arducopter frame.

2 Likes

Hı, I am trying to visiualize the mavros topics starting with /mavros/localā€¦ but even if I put the topic into rviz as pose with axes mode but I cannot see and also UI cannot rostopic echo ? How can I solve the problem do you have any idea?