0

I am working in a UAV-Team and my task is following and locking another UAV autonomously. I coded my opencv part and I used background substitution method and several filters. I can get absolute result from my code (like to forward go left , go right). My question is how can I send this result to the UAV's motors. How can I communicate with my UAV with C++? I've read lots of documentation from ardupilot, ardurov, opencv and pixhawk. But still couldn't figure it out.

Dan Mašek
  • 17,852
  • 6
  • 57
  • 85

1 Answers1

1

Connect your microprocessor(i.e rasberry Pi) with pixhawk ans use mavlink communication protocols to send command here is link And you can use dronekit also to do that.

Talha Farooq
  • 54
  • 2
  • 8
  • Is set_rc_channel_pwm() function in MAVLINK safe? Because giving some instructions to pwm usually damages the engine. – Türker Berke Yıldırım Feb 21 '19 at 10:33
  • Yes RC is safe but applying directly may cause trouble. – Talha Farooq Feb 21 '19 at 16:12
  • Sir may you give a specific function that i can use; my bachelor is computer science and really doesn't understand about communication issues. I can take x and y coordinates by using OpenCV (from the object should i track) and my middle point of my frame is set as (0,0) so. if the coordinate +,+ region. I want to set my motors direction to +,+ region. But which function should I use? I am using MAVLINK and ArduSub as firmware. – Türker Berke Yıldırım Feb 21 '19 at 20:56