-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
AP_DDS: Design the ROS2 control interface #23363
Comments
Starting to refine this. I'll enclose a proposal below. Here's the rough plan of action:
|
Some (hopefully useful) feedback. I've reviewed REP147 with control algorithms in mind, not only for the project I'll build but also from a general point of view.
The following would instead add information that is not strictly crucial, but really useful to add more functionalities
Finally, some more stuff for additional debug purposes or even more functionalities:
I realize this last list is a bit long, but as I said in my opinion these would have lower priority compared to the ones above. A couple more things.
|
Controls interfacePosition
Velocity Controller
Acceration Controller
Trajectory and Waypoint ControlLet's skip these for now (at least in scope of GSoC) Interfacing with ArduPilot librariesIf we want to do AP_ExternalControl, it would likely involve making lots of changes to the vehicle code, which could take longer. Instead, Randy initially proposes we use the utilities the scripting interface, by changing the define to be something like this: #if AP_SCRIPTING_ENABLED OR AP_DDS_ENABLED Note, the scripting interface does not currently expose an acceleration control yet, but we could add it for DDS (later). This provides an advantage also because we don't have to worry about Mavlink at all yet, and all development would be constrained to the AP_DDS library which reduces the risk of breaking unrelated things. Later the down the line, we can get help integrating Handing over controlsIn general, a companion computer shouldn't change the flight mode, unless the developer is very sure they know what they are doing. This is dangerous, and should likely be protected.
If the companion computer wants to request control (switch to guided), should it be allowed? Yes, it will need to be added, and obey the protections. IN mavlink, this is the message, which allows arming, takeoff, but not a command to go into guided. In the auto mode mission list, one item would be this guided enabled command. See this for a nice video. OR this for obstacle avoidance. |
Pretty much all the main control interfaces are implemented that our users have requested. The interface seems pretty stable, and we haven't found any design issues, so I'd say this interface is now complete. The use of the AP_ExternalControl library is crucial to keep this interface simple, clean, and documented. |
For a ROS2 offboard computer looking control the autopilot, there are a variety of methods.
From a high level, it could be waypoint-based, feeding waypoints and letting the autopilot figure out how to get to them.
Other control methods (acceleration, rate) control are lower level, and require more real time behavior offboard. Pending some performance metrics that need to be completed, design the generic API for ROS2 to control ardupilot.
ROS REP-147 exposes a good set of messages, but they don't have any feedback on success of commands, or progress indications.
Since the DDS interface doesn't support services or actions (yet), this ticket can be scoped on the open loop control.
Leonard's talk on guided mode is an excellent primer: https://www.youtube.com/live/4G1sxQ_CVng?feature=share&t=11204
He proposes the ideal method is to control position, velocity, and acceleration at the same time. Since ardupilot has some sense of the vehicle limits with respect to WP_NAV params, and these limits are fixed at runtime on copter usually, they can be sent to the companion computer once (on boot). Later, when dynamics are more variable, such as accounting for drag with respect to velocity, or throttling the climb rate based on battery sag, the dynamics can be shared dynamically. For some more info on how to apply the acceleration limits, see this: ros-navigation/navigation2#2633
Once the companion computer has the vehicle limits, it will need to take its global plan, and smooth it. For a 2D smoother, see here:
https://navigation.ros.org/configuration/packages/configuring-constrained-smoother.html
The companion computer should publish PVA commands as fast as reasonably possible, even 10Hz, with the current requested command (timestamped). There is not currently any look ahead support. Since ArduCopter supports S-Curves, there is currently no need to send an entire trajectory. S-curves attempt to minimize cross track error in 3D.
The text was updated successfully, but these errors were encountered: