-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Switch from Twist to TwistStamped for cmd_vel #1594
Comments
Copy-paste from discourse, probably better to have the discussion here: How does twist_stamped help? It can be stamped upon generation, but maybe the navigation algorithm took very (unexpectedly) long and is thus based on old sensor information. Which problem does the stamped message tackle which cannot be caught with a timeout detection? |
Yes, so you know exactly when that command is supposed to be executed.
That's an unrelated issue.
Sure, but when the new message comes and using timing relative to that. If you get an old message instead, you definitely don't want to arbitrarily execute it. Timeout detection should already be in your system, frankly. But just because you receive a message in a given time window, does not guarantee that it was generated in that time window, or that they're in order, or that they're still valid. You need some knowledge of timing for that. |
The inorder part is a good point. And indeed an inorder can messup another timeout system which is unaware of that. 👍 |
Nice, I would like this switch to On our robots we always publish a |
We will discuss this more after the Foxy release, we don't want to break anything before an LTS or make things harder for other parts of the ecosystem. In the meantime, it would be helpful to compile a list of places that need to be updated to support this off hand I can think of:
Please add more to this list if you know of anything! |
|
This should be started after the Foxy release in a few weeks |
CC @tfoote @Karsten1987 - maybe worth a conversation to divide and conquer for this in Galactic? |
CC @bmagyar fyi. |
@SteveMacenski the big thing that I wanted to bring up is that the Header on a Twist is not enough information to allow us to transform it directly there. If I remember correctly there's actually 3 reference frames that need to be captured. I'm going to need to dig through my notes. you can do things like require messages published assume that one or more of those frames are coincident. But that's not always intuitive. I'm going to have to dig deeper to find notes on this. But before we do a mass migration to a TwistStamped we should make sure that it's adaquately complete. |
Thinking about this again - I would seriously consider us coming together and doing this leading up to the Galactic release. It would be better to have issues with some packages out of sync of this change outside of an LTS distribution. Galactic seems like a good target to change this for so we have a year to work out all the packages needing update before the next LTS |
Copying from the other ticket: Feature requestAdd optional support of TwistStamped to replace Twist publishers of velocity control data. Feature descriptionI'm working with @pedro-fuoco on integrating NAV2 and ArduPilot for his Google Summer of Code project. More info here: Over the past 6 months, I've added MicroROS support to ArduPilot that removes the need to use MavROS, which added a layer of abstraction, complexity, and confusion for many ROS users. Now, ArduPilot directly supports standard ROS messages like I've been following REP-147 for the velocity control, which we now have a draft working in ArduPilot here. REP-147 says to use Proposal
Implementation considerations
Note: I can do the work, I'd just like feedback on the proposal. |
I have full support for moving to stamping the outputs - the major issue is just having the time to update all of the downstream things that consume it (which the other ticket goes over an initial top-of-mind list). I don't think this should be an option but the hard change over to this. But, I suppose we could make a velocity publisher wrapper in nav2_util that deals with that parameterization outside of the application code (and in a way we can remove the non-stamped support more gradually). I would prefer to move the ecosystem over in a concerted effort which would mean updating the Twist to TwistStamped on Nav2 consumers like the gazebo control plugins and such listed in the other ticket. This does really seem like a great GSOC project, but I assume your student is more focused on the ardupilot side? wink
Certainly if you want it backported to humble, it would need to be an option. |
We actually have two students that were accepted. One is working on the embedded MicroROS/Service/Action support + UDP transport (Arsh), the other (Pedro) is working on SLAM on what that ecosystem call the companion computer (Linux+ROS 2). I've taken the responsibility of supporting the ROS 2 interfaces for the SLAM by adding ROS 2 topics in the autopilot to replace MavLink. Yes, Humble would be the target. Based on the past releases for ArduPilot, I don't expect the release timelines to line up between ROS 2 Iron ArduPilot 4.5. Iron will be EOL'd while ArduPilot 4.5 is still supported... There are some other options for the ArduPilot's 4.5 release, none of which seem super attractive:
Did I miss any alternatives? |
Humble might be the target, but the PRs and work should be done in Converting the pub/sub to objects which handle the stamp / no stamp seems like the best option. However, to close this work out, we'd need to update ignition control plugins + stuff described above to use stamped as well so that moving forward we can use stamp everywhere. I doubt it would be very difficult nor time consuming, its just about doing the work of opening the PRs and harassing the maintainers (with my help) to merge the change as the new status quo. And/or potentially use the same stamped/no stamped pub/sub
Also the wrong stamp
Can't speak to any of that, we only have one frame we think about in mobile robots |
Of course, not an issue.
If it's not difficult nor time consuming, then I can do it, and you can vouch for me to merge the PR's all together.
Yep
Fair enough, but that might change with aerial. There's a bunch of different ways in ArduPilot, NAV2 could at least say which one it's using in the |
It might take some time before we get folks to merge them all in, but if they're all open, that can allow me to instantiate the process to get it done and shouldn't require any further work from you Are you referring to
If so, if there's a TF tree that translates between them, then it shouldn't matter which is being published, they should be always transferable |
Yes, plus
The trick will be how to translate these into the select few frame ID's supported in REP-105, or to allow more. |
Are these a part of a TF tree so that 1 published can be transformed into any of the rest? |
Right now, we have a few of the REP-105 frames ( |
if the transform exists on the main computer, then it can handle that transform and the embedded machine can publish at whatever frame is comfortable and doesn’t need to worry about it, right? |
The TF tree doesn't support automatically intercepting messages on |
For this PR, I'd be happy if we could just get in (optional) support for TwistStamped, with the current frames, and merge that. |
Yeah agreed, but just mentioning that we can handle more to fully solve the problem.
We could have a shim node that takes in a message and converts to a particular frame of interest before republishing (that the drone embedded computer uses). Once such instance of that could be a twist stamped, but I'd probably template it or try to make it generic to any message with a header field just to future proof |
I opened ros2/common_interfaces#228 which I see as a blocker before we start promoting TwistStamped more generally. |
This is a very good point, thanks for forwarding that on. One of the major objectives I'm looking for in a migration is less to do with the frame and more to do with having a stamp to know when it was sent for lower-level safety promises to know that you're not executing something too old or of anomalous frequency. DDS gives you Lifespan or Deadline (depending on what metric you're interested in) for that, but it doesn't hurt to check this in case those features aren't in use in a particular subscription application. I know this is a different case for @Ryanf55 who wants frames considered and that's a timely comment. I'm sure he cares about timestamping for safety as much as I do as well. For starting out, I don't think the fact that the transforms are missing is a huge problem for us. Obviously as the message changes for TwistStamped, we'll have to adapt, but I imagine that will coincide with a Twist update as well so we'd be in the same boat regardless. So unless you don't think |
@azeey just a quick follow up as I'm working on the Jazzy release today. Is TwistStamped supported in Harmonic for Rolling? I can make that switch for Nav2 later this year if so! |
Yes, TwistsStamped is available on Jazzy and Rolling. The bridge is |
I'm going to let things from the jazzy release settle for a bit, but then I'll make that switch over before end of this year (unless someone pings me first about it)! |
Hi @SteveMacenski is this planned to be backported to Humble or Iron at some point? |
Sorry, we had to break ABI of the public headers in NAV2 to get it implemented. It can't be backported to iron or humble without significant changes. Check the linked PR for specifics on why. If you have time and want to investigate it, go for it. My plan from the beginning was to make it available on humble, but that's not how the implementation went. With some more thought, it may be possible. |
ok thank you for the feedback, I'll try to dedicate some time to investigate it. |
This will be done for Kilted and newer. We can't backport forcing folks to use a different message type for output or else it would break literally every system in the world instantly. |
Right now we use Twist which contains no time based information. This may be important for detecting old or out of order messages in async applications.
A survey should be conducted for supporting this across the navigation ecosystem to support:
In the mean-time, may be worth having a deprecation warning in navigation controllers for the meantime to let users know its coming. It would be ideal to have most mainstream drivers support this before too many people are ported over and stuck into it.
Maybe rename to
cmd_vel_stamped
?The text was updated successfully, but these errors were encountered: