-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
Enabled sending waypoints to ardupilot for copter and rover #26362
Conversation
Can most of this be moved to AP_Vehicle instead? |
Hello @amilcarlucas I am not really sure about that. I am just following the structure already being followed for ArduPlane. |
Which parts do you think should be moved? Collapse AP_ExternalControl in AP_Vehicle, or something else? |
Anything that is common and can be reuse is a good candidate. That way sub and blimp will also get (at least parts) of this feature. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, this is looking great. Sorry for the delay on the review. I forgot to hit submit.
I'll run testing on it shortly. Have you tried using the python script I wrote to send a goal, and try it against copter?
This is looking pretty good I think, it would be good to squash some of the commits together and add the regular subsystem prefixes to them. E.g. commits affecting rover should start with "Rover: ", commits affecting Copter should start with "Copter: ". Also we should have any merge commits. Thanks! |
Hi @haarshitgarg , Do you mind fixing up the commits? This is looking nice and I'd like to get this in. We had another asking for copter waypoints on the discord thread. |
Is there a way to takeoff throught the ros2 topics aswell? I have used the additions you suggested and the waypoint navigation works when it is in the air but not to takeoff. It would be nice if we can set the drone to mode guided, arm and takeoff all through the ros2 topics! :) |
I'm not really familiar with this area but maybe this PR is what you're looking for? #26911 |
Thank you! I’ll check it out :) |
Also, is there a way to use waypoints in the local coordinate frame? (x, y, z) Using the "/ap/pose/filtered" topic msgs you have your position in the local map coordinates. Could someone help me implement that? Sorry I have little knowledge on Ardupilot source code haha. |
No, that's not part of REP-147. ArduPilot's waypoints are in WGS-84 (global) coordinates. If you want to do planning on local coordinates that's fine, but transform to global before sending to the autopilot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…dupilot for copter and rover Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
…ot for copter and rover Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
…ot for copter and rover Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
@haarshitgarg Would you be interested in a doing a follow-up PR allowing users to set a yaw angle at the waypoint? This would be good for inspection use cases with a fixed camera where you point the drone at a cliff/wall at each waypoint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to be nitpicky about naming but could we change this to clarify that we're setting a target location? we normally use the word "position" to indicate an offset from the EKF origin and "location" for lat, lon, alt. Not specifying that this is a target (e.g. controller target) rather than an [ekf] estimate is important as well I think.
Do you want the functions renamed in Plane and Copter, or just External control? |
Hi @Ryanf55, I think set_global_position() should be renamed to set_target_location(). That will lead to identically named methods in the Copter and Rover vehicle class and in AP_ExternalControl but I think that's OK... maybe other devs will disagree but we can clear that up on the dev call if not before. |
Ok. It's currently named based on REP-147: https://ros.org/reps/rep-0147.html#goal-interface |
Way point support for Copter
This is to fix the issue #25381
Implemented
set_global_location
for Rover and Copter ( taking inspiration from ArduPlane)Demo
Taking everything from this pull request
In ArduPilot repo:
Running MicroROS agent:
Taking off the copter
Now publish a message for drone to go to greyhound track.
Way point support for copter Rover
Follow all the steps as for copter above
Demo Rover
Same as copter (plus altitude is ignored in ros message)
Result Screenshot (Rover going to the same location as copter)