-
Notifications
You must be signed in to change notification settings - Fork 219
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
Freedrive Controller #1114
base: main
Are you sure you want to change the base?
Freedrive Controller #1114
Conversation
Would an action be nicer, semantically? Start of action -> enable freedrive. Cancel action -> stop freedrive. The goal client handle would become something similar to a 'token' or 'mutex' (not exactly, as it wouldn't be as safe or strict, but conceptually). Concurrent goal -> reject (something/someone else already has 'control' of the freedrive mode). Event on robot or robot-controller causes freedrive to be disengaged -> abort action (notifies client something happened). A subscriber can't do that. it would also make it (slightly) harder for something to take over control of the robot by just spamming And it would make it semantically clearer it controls some specific functionality (ie: because a custom action goal needs to be submitted, instead of a generic |
I have to say, that makes sense! Thank you for the input :-) |
One aspect that would need some thought though: time-out (ie: when should freedrive be stopped due to the client no longer 'responding'). There might be some way to exploit liveliness QoS or something, but I'm not sure how that would work with actions. |
Currently reached a first version working state, still missing:
Tested on URSim, requires #34. |
High-level comment (nice work already though): the (proposed?) action is called To me (non-native speaker though) this implies the action of enabling freedrive mode -- so changing the state of the robot from not in freedrive mode to having freedrive mode active -- is what this is about. That's a bit strange, as it seems like that would almost be an instantaneous transition, not something which would require feedback and a ROS action. I realise something like "put-and-keep-robot-in-freedrive-mode" is a bit silly as a name, but that seems to be more what this controller does, correct? (note: I'm not asking for the name to be changed necessarily. Just thought I'd point it out) |
I wrapped my head around this and I currently don't see a way of doing this. One option would be to use a separate topic for a keepalive signal that could be used opt-in or opt-out, but that feels like a cumbersome workaround.
I was also stumbling upon that. Maybe "use freedrive mode" could be a proper label? That could imply that, as long as this action is running, the robot's freedrive mode is used. I don't quite like the word "use". Matching synonyms could be "utilize", "operate", "run". |
I see the point on the action name and I agree that "enable" is not the best choice to describe what the action does. If we exclude using two words (like StartandKeepFreedriveMode), I would also choose something similar to "use", and tha regard maybe I like "run" more. |
I haven't looked into it, but would there be a way to retrieve the liveness QoS data/settings for the feedback or perhaps status publisher and see whether it's still connected to a client? It might need some unorthodox reaching around/into the action-machinery, but DDS certainly supports these kinds of things. Edit: a quick search seems to imply it's possible to configure custom QoS for specific Action servers. See rclcpp_actions::Server<..>::create_server<..>(..) fi. It now just calls Not a full solution yet, but perhaps an interesting 'in'. |
I've been testing around with that already on fmauch@f3a2e3d (Another feature branch, another action, but I just had that at hand). Setting a lifespan (which seemed the most obvious thing for me) of 100ms seemed not to have any effect. My test was running a trajectory through our example_move script and then exiting that script during motion. One question is, whether the underlying action server implementation would care at all, if this would happen. If the message would expire on a DDS level - would that even be visible to the publisher / the action server? Then, API access is a whole other story. But thank you for supporting me that I have been poking in the right direction. |
Setting QoS is just one thing that would be needed. I would probably go for Liveliness instead actually. You'd then have to register a callback to be called whenever the Liveliness requirements are no longer met. I can't really look for it right now, but I'm pretty sure I've seen discussion/PRs around callbacks for these kinds of events in the ROS 2 stack (perhaps even at RMW level). |
I just tested things locally and had discussions with others. I would like to stick with the heartbeat topic instead of the action as we had it initially for now because of the following reasons:
I'm not saying that this is the right interface to use, but for the sake of getting this PR forward to a mergable state, I would say that another, maybe semantically more meaningful interface can be added at a later stage. |
The PR aims at introducing the possibility of enabling the freedrive mode through the ROS2 driver. It relies on the implementation of a specific controller to handle it, in order to correctly deactivate other controllers and avoid unsafe jumps of the robot once the freedrive mode is switched off.