-
Notifications
You must be signed in to change notification settings - Fork 1
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
Side selection #54
Side selection #54
Conversation
Localisation node update: The idea is the following: - By default, localisation broadcast a blue side static tf to "initial_tf_to_drive" (localisation node does not wait until the service is availible at startup) - Localsation tries to send the tf to drive while launching a 1 second timer to check whether the message has been successfully sent or not - If the service doesn't respond, the service is cancelled and the timer is deleted before retrying to redo the same thing (service call + timer check) until the service succefully respond - if the service respond a success, the timer is deleted - When receiving the final side via "initial_side_selection" service, localisation tries to do the exact same thing (with a little check to know whether the service call is already pending or not)
Drive node update: -During initialization, _map_to_odom_tf remains a default tf (x=0, y=0, z=0), (x=0, y=0, z=0, w=0) -Then it's updated by the service "intial_tf_to_drive" from localisation node -It can be updated whenever it's necessary
@mAxYoLo01 will strategix and cetautomatix need the side selection too ? If you want, I can do the exact same thing that assurancetourix is doing for localisation but for:
We just have to discuss about services names. |
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.
Generalized service communication through assurancetourix incoming.
Actually yes, both nodes need to know the side selected! |
Alright @mAxYoLo01 here's the services you'll have to create in cetautomatix from asterix and obelix and strategix:
Here's the python piece of code in order to create and answer this service: (extracted and adapted from here) from transformix_msgs.srv import InitialStaticTFsrv
"""in constructor"""
self.side = "blue"
self.side_selection_service = self.create_service(
InitialStaticTFsrv,
"<node>_side_selection",
self.initialSideSelectionCallback,
) #node in[cetautomatix, strategix]
"""in class"""
def initialSideSelectionCallback(self, request, response):
"""Assurancetourix send the side of the team"""
if request.final_set.data:
self.side = "blue"
else:
self.side = "yellow"
response.acquittal.data = True
return response The fact that the node is already in a namespace prevents us to impose As in the past, the default side is blue ! You can implement it in your future branches or merge master in your current branch and implement it directly. From now, as soon as side transfer can be done, it'll be done ! |
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.
LGTM, merging!
And thanks for all the additional information 🍻
Purpose of this PR
A way better and cleaner way to provide the side across the software. Also "fixes" (not really, just found another way) #34.
What has been done ?
Clean localisation node
Removing VLX and it's dependencies as we're not going to use them with the new incoming lighthouse package.
Update transformix_msgs package
The only service remaining in transformix_msgs is
InitialStaticTFsrv
containing:New side selection software architecture
Alright now let's talk about this new way of transmitting the side across the software.
First of all, keep in mind that despite the fact each component of the system (assurancetourix, asterix, obelix) needs the side, they're 3 independent systems, so they can be started in whatever order. Same thing into asterix and obelix with the transmission of the static transformation between localisation and drive according to the side, localisation node can either start before or after drive node.
Here's the trick:
Drive node:
<namespace>/intial_tf_to_drive
(transformix_msgs/InitialStaticTFsrv type),_map_to_odom_tf
and sending backacquittal=true
Localisation node:
<namespace>/initial_side_selection
(transformix_msgs/InitialStaticTFsrv type),<namespace>/intial_tf_to_drive
(transformix_msgs/InitialStaticTFsrv type),<namespace>/intial_tf_to_drive
:acquittal=true
, retries<namespace>/initial_side_selection
service (transformix_msgs/InitialStaticTFsrv type) -> msg from assurancetourix containing the final side of the match:<namespace>/intial_tf_to_drive
, delete this one and the timer,acquittal=true
to assurancetourix.Assurancetourix node:
asterix/initial_side_selection
(transformix_msgs/InitialStaticTFsrv type),obelix/initial_side_selection
(transformix_msgs/InitialStaticTFsrv type),Reminder on the timer:
A timer is asynchronous, to popularize, it acts like a timer interrupt on µC. If it's started, it doesn't block the rest of the program. It will just execute its callback each given time gap.