New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copter: add support for VISION_POSITION_ESTIMATE message #5890
Comments
hmm. good job. we wait for developers for help about and mention tips for start this work
};` |
We've been talking about this a bit in the ardupilot vision-projects gitter channel recently. https://gitter.im/ArduPilot/ardupilot/VisionProjects. On the ArduPilot side we need to add some support in the EKF to accept those messages and that's not terribly hard. Do you have a system to produce those messages? Can you tell me a bit about it? |
For vision, the mavlink message used to send the pose data is VISION_POSITION_ESTIMATE and the message for all motion capture systems is ATT_POS_MOCAP messages. I check this msg's for do work and replay soon. but how to use this msg's with arducopter please send me some Ref .. |
@rmackay9 Any updates on this? Expected time when this will be available? |
Hi, I was wondering what benefit will VISION_POSITION_ESTIMATE bring since Arducopter already can process VISION_POSITION_DELTA ? |
@HumamHelfawi, the vision-position-delta provides the change in position while the vision-position-estimate provides the absolute position. Having the absolute position is better in cases where there is a position reset provided by the external system. |
@rmackay9 Thank you very much for clarification! I am sorry but it is still a bit fuzzy for me.
Do you mean something like resetting the position when a loop closure optimization happens or did I misunderstood your sentence? |
@HumamHelfawi, I'm not exactly sure what "loop closure optimization" means but to give a practical example, say a vehicle was driving around in a maze and after 30min the vehicle arrived back at the entrance. At that moment, the external position estimate system might recognise the entrance and suddenly shift the position estimate to the position estimate it had when it entered the maze. Passing this shift into ardupilot would only be possible using the vision-position-estimate message. The vision-delta message wouldn't work well because arduilot's EKF would likely reject the massive shift passed in from the external position estimate system because it doesn't match the accelerometers. |
@rmackay9 I thank you very much! Your example illustrates exactly what I meant by "loop closure optimization" (when a loop is detected at the entrance of the maze). |
@rmackay9 I really want to know how to make the vision_position_delta work?? I am willing to do the extra work of working out rotations and transformation to send the dp and dR msgs but I want to make this work. I am using mavros and made some modifications in the mavros/mavros_extras/src/plugins/vision_pose_estimate.cpp . I changed mavlink::common::msg::VISION_POSITION_ESTIMATE vp to mavlink::ardupilotmega::msg::VISION_POSITION_DELTA vp{} in the aforementioned code and tried sending some random variables to vp just to test the input output rostopics. I want to know in which rostopic can the output be seen. For example if one uses LPE in PX4 firmware, we send data via a topic named /mavros/vision_pose/pose and get an output at /mavros/local_position/pose. Here I am sending the vision pose via /mavros/vision_pose/pose but I don't know where I will get the output. Sure, I should not expect an output at /mavros/local_position/pose because APM has got no LPE. Any help will be gratefully acknowledged! |
The various vision-position mavlink messages are now supported in master. |
@rmackay9 So we dont have to convert to deltas? |
@SubMishMar, that's right. No need to convert to deltas anymore. By the way, the EKF still needs to be told where it's origin is if no GPS is connected. That can be done using the mission planner as described here on the wiki or if you have some other way of sending in mavlink messages, it's the SET_GPS_GLOBAL_ORIGIN message that should be sent. There are more people doing this kind of thing with ROS on ArduPilot Rovers and boat here. |
@rmackay9 Thank you very much! and for this great community! |
@rmackay9 will this work for skyviper? I tried writing the latest ardupilot firmare(available on ardupilot's github, not skyviper's ) on skyviper, it doesn't respond after that. It doesnt respond when I burn the new firmware by configuring the board to px4-v3 and when I configure the board as skyviper-v2450, the firmware is uploaded successfully but the controller doesn't pair up with the drone and lights on both the drone and the controller keep beeping forever. @rmackay9 Here is some more information Please copy and paste that link in your browser, it may not work if you just click on it. EDIT2: I disabled prearm checks and it is able to fly but the strange beeps from the controller still persist. |
I guess you're using the pre-built firmware from ardupilot.org? That would be the best firmware to use to be sure it's not a compile issue. Instructions are here on the wiki. I think it should be possible to use the vision-position-estimate messages with the skyviper firmware. I guess you've got some external vision system setup which knows where the vehicle is? |
@rmackay9 I think you have given the wrong link here. No, I am not using a prebuilt firmware. I pulled the master branch of ardupilot and build the code by configuring it for skyviper-2450. I did not get any compilation issue. I have aruco markers that provide the vehicle pose in the topic /mavros/vision_pose/pose |
@SubMishMar, sorry, updated the link above to this one. |
Thanks, let me check it out. I was looking into this http://firmware.ardupilot.org/Copter/2018-05/2018-05-07-22:05/skyviper-v2450/ I think they are the same. |
@rmackay9 there is no change in behavior on uploading the firmware you pointed me to, the controller is still beeping in a strange way. I still have to check the stuff with vision_position_estimate. Is there any documentation on how to do it? Note: The skyviper I own is a old one, bought in October 2017 does that have anything to do with the type of firmware completely compatible with the board on skyviper? |
@SubMishMar, if you have a dataflash log we can look for the VISP message to see if the external vision position estimate messages are getting through or not. If they don't appear then there is likely a communication issue between the external vision system being used (and I don't know what you're using of course). If the messages do appear then the issue will likely be the times being off between the system sending the external position estimates and the flight controller. |
Okay, I will get you the data flash log. I am using aruco markers to estimate the drone's pose and this is published in /mavros/vision_pose/pose. I have vision and local white listed in my apm_pluginlist. I have also added the following lines in vision_position_estimate.cpp |
No logs are being recorded even if I have an SD card onboard my skyviper. It's an 8 GB SD card. |
@SubMishMar, the issue is probably the LOG_DISARMED parameter needs to be set to "1" to enable logging even while the vehicle is disarmed. |
@rmackay9 here I upload a dataflash log file and it does show relevant values in the field VISP. I think the frames are different(may be a NED ENU stuff) as what is +Z has been logged as -Z in VISP and X and Y are swapped. Here is the .bin file https://drive.google.com/open?id=1-xSTD3CtJSHw2KvgdzxUirFSXsKaUSrD |
@SubMishMar, so as expected the issue is that the times are mismatched between the flight controller and the source of the vision position messages. We really need the PR from @peterbarker linked above to go into properly resolve this. |
@rmackay9 thanks for the help! Any idea when this will be available in master? |
I read diydrones And #4498 (& #103,#102) for Indoor navigation with ArduCopter and see this:
three possible solutions:
implement a angular controller in Guided mode to allow the companion computer to more directly control the vehicle's lean angles. The companion computer would be responsible for estimating the vehicle's velocity and position and converting the (velocity and position) errors into angle requests.
feed an estimated position into the EKF as a substitute for a GPS position. The EKF could then work as i does not calculating position, velocity, acceleration by combining this data with the other sensors. There's a GLOBAL_VISION_POSITION_ESTIMATE message but we haven't implemented the Copter side of it (which could be complex).
attach an optical flow sensor to the vehicle. The EKF already knows how to use this sensor to estimate position and velocity. The companion computer could then control the vehicle with either the velocity or position controllers.
We how to start work on it for support VISION_POSITION_ESTIMATE just like px4 pro flight stack ?
The text was updated successfully, but these errors were encountered: