mavlink / c_uart_interface_example

Simple MAVLink to UART interface example for *nix systems
275 stars 260 forks source link

Obstacle avoidance? #22

Closed bmc5469 closed 6 years ago

bmc5469 commented 7 years ago

Hello,

As part of a Senior project I am attempting to implement obstacle avoidance on a DJI F450 quadcopter using the pixhawk, PX4, and 4 HC-SR04 ultrasonic sensor units. My idea to accomplish this is, a raspberry pi would interface the 4 sonar sensors and when a sensor had been triggered the pi would relay mavlink messages to the pixhawk to instruct it to navigate away from the object, and then give control back to the Manual RC input or Qgroundcontrol. I initially intended to utilize MAVproxy to allow the pi to send mavlink messages, however after seeing this repository, I felt it was more suited to the task. In my inital testing I am currently running a C program on the pi that gathers sonar data and executes, system("./mavlink_control -d /dev/ttyAMC0"), which executes a set position mavlink command.

As you can probably tell I am very new to this and was hoping a more experienced developer could answer a few of my questions that I can't seem to find the answer for:

1.) are the axis directions in: set_position(float x, float y, float z, mavlink_set_position_target_local_ned_t &sp) in reference to the quads orientation as in, setting x = x+1.0 will cause the quad to move 1 meter forward or will it cause the quad to move 1 meter true north?

2.) would I be better served to simply set the pitch/roll for a short period of time in the appropriate direction?

3.) does this sound like a reasonable design for a rudimentary avoidance system?

Thanks so much for any help!

Brad