generated from ijnek/ros2_template_repo
-
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
add flexible messaging #43
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
ijnek
changed the title
add interface to test flexible messaging
add flexible messaging
Dec 19, 2023
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
ijnek
force-pushed
the
ijnek-flexible-msg
branch
from
December 27, 2023 04:03
d34951e
to
e914537
Compare
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
ijnek
force-pushed
the
ijnek-flexible-msg
branch
from
December 30, 2023 02:13
6db557b
to
815ddb3
Compare
Signed-off-by: Kenji Brameld <kenjibrameld@gmail.com>
superceded by #47 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The 2023 SPL rule states that
Great, now teams can use the whole packet size to pack in what they want their teammates to know about!
(Me): Crap, how do i even write a package that translates ROS messages to UDP packets if i don't know the message we're sending, and it's different for every team......... anyway, here's the solution I have.
This new package r2r_spl allows teams to publish / subscribe messages to each other, while adhering to SPL rules. When you publish a ROS message, this node will encode it, send it on a port specified by SPL rules for your team. Your teammate robot, who will also be running this node, will receive it, decode it into a ROS message, and publish it onto a topic!
One just has to specify the type of message they want to send to other robots on their team, by setting the
msg_type
parameter.The node in the package dynamically imports the specified message type and inspects it to create a python
construct.struct
. When messages arrive on ther2r/send
topic, it will use that information to fill out astruct.container
, into binary data to be sent off.Subscriptions:
r2r/send
: Topic you publish your message to, to send to other robotsgc/data
: Topic published by the gc_spl package, with information about number of remaining packets.Publisher:
r2r/recv
: Topic you subscribe to, to listen for messages from other robotsParameters:
team_num
: Team number of the robot. Used to calculate the team's port to communicate on.player_num
: Player number of the robot. Only used iffilter_own
parameter is set to true.msg_type
: This is used to determine what the type of message we're sending, provided in the form (eg.r2r_spl_8.msg.SPLSM
).filter_own
: Used to determine whether to filter out messages that we sent to ourselves, by prependingplayer_num
to the packets we're sending. The minor drawback to this, is that it takes up one extra byte in the packet we're sending.SPL Rule Enforcement:
128 Byte maximum packet size rule: A size check is made before sending the packet to ensure the 128B maximum packet size has not been exceeded. If it has, it will print an error.
Message budget:
This is enforced by listening to the number of remaining packets from the gc_spl package (using the
gc/data
topic), preventing packets from being sent when the message budget becomes less than 10. Packet sending resumes if we receive information from the game controller about additional packet allowance in the case of irregular extra time.Resolves: #42
Before merging: