intel / collision-avoidance-library

A framework for testing and benchmarking collision avoidance strategies
Apache License 2.0
81 stars 39 forks source link

Testbed: Using PX4 autopilot fail to auto collision avoidance #138

Open ChenYunan opened 6 years ago

ChenYunan commented 6 years ago

Hi all: When I followed the step of Quickstart Guide to run this project in simulator. I use PX4 autopilot, and run the command: AUTOPILOT=AP_PX4 ./coav-sim.sh -a QC_STOP -d DI_POLAR_HIST -s ST_GAZEBO_REALSENSE.

However, the quadrotor just takeoff but do not move on. The view of the Gazebo as below: intel_px4_gazebo

There is an error in autopilot_err.log: 3D [dev] 1.6.0-pre12-daily-experimental daily. The coav_control.log said it can't receive mission: _Using Detect Algorithm: DI_POLAR_HIST Using Avoidance Algorithm: QC_STOP Using Sensor: ST_GAZEBO_REALSENSE [mav_vehicle] Our system id: 2 [mav_vehicle] Waiting for vehicle... [MavQuadCopter] mavlink_vehicle instantiated [GazeboRealSenseCamera] Waiting for Gazebo... [GazeboContext] Gazebo client has been set up [GazeboRealSenseCamera] Gazebo Initialized [GazeboRealSenseCamera] Real Sense Initialized [mav_vehicle] Connected to vehicle 127.0.0.1:33040 [mav_vehicle] Requested home position [mav_vehicle] Heartbeat received [mav_vehicle] Home position received [mav_vehicle] Mission list requested [mavvehicle] Mission count received: 0

And I open the QgroundControl, it said there is a UDP binding error. udp binding error

I am appreciate if you can help me to check what is going on. Thank you!

mbelluzzo commented 6 years ago

QC_STOP stopped the quad as soon it saw the obstacle (right after takeoff), probably if you want to see some forward movement I would suggest either move the obstacle a little further or change the threshold distance for this avoidance. The first is preferable over the second because on higher speeds it would be hard to stop the quad on time.

ChenYunan commented 6 years ago

@mbelluzzo Thank you to reply. However, I moved the obstacle further even remove it in Gazebo, the quadrotor didn't move forward to the target (as the following figure). The threshold distance is 4, but the quad is at least 10 meters away from the unit box. I also test the QC_SHIFT_AVOIDANCE, the quad didn't fly to the target except taking off. qc_stop_movedtheobstacle

But when I test the APM autopilot, it can avoid the obstacle successfully.

mbelluzzo commented 6 years ago

Which version of PX4 are you running?

On Tue, Nov 28, 2017 at 7:22 PM, Chen Yunan notifications@github.com wrote:

@mbelluzzo https://github.com/mbelluzzo Thank you to reply. However, I moved the obstacle further even remove it in Gazebo, the quadrotor didn't move forward to the target (as the following figure). I also test the QC_SHIFT_AVOIDANCE, the quad didn't fly to the target neither except taking off. [image: qc_stop_movedtheobstacle] https://user-images.githubusercontent.com/28554577/33356333-e1cdab0e-d4f6-11e7-8c4d-06c3153bc5e4.png

But when I test the APM autopilot, it can avoid the obstacle successfully.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/intel/collision-avoidance-library/issues/138#issuecomment-347741006, or mute the thread https://github.com/notifications/unsubscribe-auth/ABgsZSyEVjo4nPUfyRu6piWOi6JfBgitks5s7M3ngaJpZM4QjtuG .

ChenYunan commented 6 years ago

@mbelluzzo PX4 version is: v1.6.5-182-g49694ed

mbelluzzo commented 6 years ago

Could you give a try on the PX4 version stated here: https://github.com/intel/collision-avoidance-library/wiki/Quickstart ? If it works, is because something changed on the way PX4 handle msgs. Probably mavlink-vehicles would required changes to support this version.

On Thu, Nov 30, 2017 at 12:19 AM, Chen Yunan notifications@github.com wrote:

@mbelluzzo https://github.com/mbelluzzo PX4 version is: v1.6.5-182-g49694ed

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/intel/collision-avoidance-library/issues/138#issuecomment-348114999, or mute the thread https://github.com/notifications/unsubscribe-auth/ABgsZUZt8JRW9V14_K2akdD7ppt29EMkks5s7mUPgaJpZM4QjtuG .

ChenYunan commented 6 years ago

@mbelluzzo I tested with the recommended PX4 version-tag1.6.0rc1, it didn't work neither. Here are the logs:logs.zip. It seems that the sim quad cannot receive mission requests.

mbelluzzo commented 6 years ago

It may be related with https://github.com/intel/mavlink-vehicles/pull/48/files ... I would suggest to start debugging from there. Either gzsitl isn't being able to set the mission after the drone is airborne or coav isn't able to load the current mission. I would bet on the first since the drone doesn't move.

By my logs, last time I tested this patch was already in and necessary. But maybe it should be a continue instead of a break? (I dont remember the code that well anymore). Try to bisect mavlink-vehicles before this commit to HEAD.

Sadly I dont have the environment setup on my machine anymore, so I wasn't able to give a try.