-
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
DDS - REP-147 Goal Interface Support for Plane (position only) #25722
Conversation
Nice to see this @Ryanf55. I've been testing the terrain planner using an extension to the I'll get the planner to emit both message types, then we can switch between them.
We do need a technical document clarifying the datum assumptions used by each library. I think AP is using MSL as the datum (which I believe is the same as the geoid). The datum for the |
022f778
to
4908f60
Compare
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.
Looks good. I have yet to run examples but have made a few suggestions in the interim.
Update
Tested on macOS using quadplane and davosdorf as home location. Verified that the altitude scaling needs fixing, but with that the vehicle flys to the commanded location and altitude (relative above home) then loiters.
Command used:
ros2 topic pub /ap/cmd_gps_pose ardupilot_msgs/msg/GlobalPosition "{header: {frame_id: map}, latitude: 46.81762458, longitude: 9.85064438, altitude: 60}" --once
Before this gets merged, I think it would be a good idea to add a colcon test, or at least a python node that replicates the README behavior. |
You can now run a full waypoint mission with a python node. It does the arming, switch to takeoff mode, switch to guided, and sending the goal. It also has timeouts for each of the behaviors, and reports progress to the goal.
I tried folding that into a |
Signed-off-by: Ryan Friedman <[email protected]>
5a07bdb
to
2a48d54
Compare
Signed-off-by: Ryan Friedman <[email protected]>
Signed-off-by: Ryan Friedman <[email protected]>
Signed-off-by: Ryan Friedman <[email protected]>
Signed-off-by: Ryan Friedman <[email protected]>
* Used to depend on scripting but now it's used in AP_ExternalControl Signed-off-by: Ryan Friedman <[email protected]>
* Set position target used to just be used in scripting, now it's used by DDS in external control Signed-off-by: Ryan Friedman <[email protected]>
2a48d54
to
19a1ff3
Compare
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.
Only really looked at the changes outside of DDS, but it all looks good.
I've asked @snktshrma to document on the wiki. I think the script provides an excellent example for people wanting to understand how to use DDS for something useful but not too complicated. |
Purpose
This adds DDS support for controlling global position control in LLH of Plane in alignment with REP-147's proposed High Level Goal Interface. It relies on GUIDED mode in plane. When supplying position, it's intended to be used for in features like "Click to go here" from the GCS. This is NOT a good interface for low-level carrot-on-stick kind of control due to the loitering behavior around the target point.
Assumptions
map
frame in ROS would be used for this type of controlLimitations
Demo
In ArduPilot repo:
Run MicroROS Agent
Now, get the plane flying. Once EKF3 is initialized
Wait a bit for it to start loitering, then switch to guided.
Now, command the drone to head north from CMAC to the grayhound track at -35.345996, 149.159017 with an altitude of 40m above home. You only need to send it once with
--once
because this goal is latching on plane.You'll see a pink and green line appear pointing to the middle of the greyhound track as soon as the first message is published.
After a while, it will do a clockwise loiter at the target location.
If you kill the terminal for publishing, the plane will continue to loiter about the same spot and stay in guided mode.
What about through a ROS node?
Good thing you asked, you can run an example waypoint follower here, which arms the plane, does the takeoff, switches to guided, commands a location, and closes when the goal is reached.
Future work
Considerations
This message is honestly poorly designed; I think this needs to have
experimental
topic prefix untill we can work with the ROS TSC and Aerial Working Group on a new one.coordinate_frame
has a default value of 0 not represented in the frames of 5,6,11type_make
is pointless, when you could just set fields to NaN.velocity.angular
oracceleration_or_force.angular
withtype_mask