Skip to content
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

[Garden] Port scan, dock, deliver - Part 1 #537

Merged
merged 7 commits into from
Nov 18, 2022
Merged

Conversation

caguero
Copy link
Contributor

@caguero caguero commented Nov 9, 2022

This pull request partially ports the ScanDockScoringPlugin from Gazebo classic. In particular, it ports the functionality related with the color sequence checker.

How to test it?

  • Launch the scan_dock_deliver_task world:
ros2 launch vrx_gz competition.launch.py world:=scan_dock_deliver_task
  • On a new terminal check the /vrx/task/info topic:
ros2 topic  echo /vrx/task/info
  • Wait until we enter into running state (around 20 secs), and then, submit a correct color sequence. On a new terminal launch:
ros2 topic pub /vrx/scan_dock_deliver/color_sequence --once ros_gz_interfaces/msg/StringVec "header:
  stamp:
    sec: 0
    nanosec: 0
  frame_id: ''
data: ["red", "green", "blue"]"

Verify in your previous terminal that you get 10 points.

  • Additionally, you can rerun the simulation and submit an incorrect sequence. You shouldn't get any points. Additional submissions should be ignored, as there's only one attempt.

Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
Copy link
Collaborator

@M1chaelM M1chaelM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two very small suggestions. Otherwise this is working as expected.

// Sanity check: Only one submission is allowed.
if (this->colorSequenceReceived)
{
gzerr << "The color sequence has already been submitted" << std::endl;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem to be displaying, despite the fact that the variable gets set to true in line 137, below. Maybe the problem is that the color checker gets disabled and stops listening for messages.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit redundant because as you said, it's disabled when the first submission is processed.

}

// Sanity check: We should receive three colors.
if (_sequence.data_size() < 3u)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, if we submit a sequence with more than 3 colors, it will just score the first three. I'm wondering if we should change < 3u to != 3u to also discard sequences that are too long.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me. Changed in 558ef4d.

Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
@caguero caguero merged commit 413681f into gazebosim Nov 18, 2022
@caguero caguero deleted the caguero/scan_dock branch November 18, 2022 21:23
@caguero caguero mentioned this pull request Nov 29, 2022
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants