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

Scoring plugin port - part1 #501

Merged
merged 21 commits into from
Sep 9, 2022
Merged

Scoring plugin port - part1 #501

merged 21 commits into from
Sep 9, 2022

Conversation

caguero
Copy link
Contributor

@caguero caguero commented Aug 24, 2022

This pull request ports the main functionality of the ScoringPlugin class. It replaces #486 and #498.

It should be fully functional except for:

  • The ability to lock/release the vehicle
  • The ability to terminate the simulation when the state is finished
  • The ability to detect vehicle's collisions.

I'll implement these features in a following pull request.

How to test it?

Launch the simulation:

ros2 launch vrx_ros competition_local.launch.py ign_args:="-v 4 -r sydney_regatta.sdf"

On a separate terminal:

ign topic -e -t /vrx/task/info

You should observe the task message. Verify that elapsed_time increases accordingly, remaining_time decrements, the states transition from initial->ready->running->finished.

Other aspects of this plugin will be tested in the derived scoring plugins.

Bonus

I'm loading a few buoys in the world. We'll rearrange it better in the future but I'd like to see objects running the buoyancy plugins to detect potential issues.

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>
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>
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>
@M1chaelM
Copy link
Collaborator

M1chaelM commented Aug 24, 2022

This keeps crashing for me with errors relating to not being able to find sydney_regatta.sdf:

[ign gazebo-1] Error [parser.cc:729] Error finding file [/home/username/.ignition/fuel/fuel.gazebosim.org/openrobotics/models/sydney_regatta/tip].
[ign gazebo-1] [Err] [Server.cc:139] Error Code 1: [/sdf/world[@name="sydney_regatta"]/include[0]/uri:/home/username/vrx_ign/install/share/vrx_ign/worlds/sydney_regatta.sdf:L343]: Msg: Unable to read file[/home/username/.ignition/fuel/fuel.gazebosim.org/openrobotics/models/sydney_regatta/tip]
[ign gazebo-1] [Err] [Server.cc:139] Error Code 9: [/sdf/world[@name="sydney_regatta"]:/home/username/vrx_ign/install/share/vrx_ign/worlds/sydney_regatta.sdf:L4]: Msg: Error reading element <world>
[ign gazebo-1] [Err] [Server.cc:139] Error Code 9: Msg: Error reading element <sdf>
[ign gazebo-1] [Err] [Server.cc:139] Error Code 1: Msg: Unable to read file:/home/username/vrx_ign/install/share/vrx_ign/worlds/sydney_regatta.sdf

I've tried cleaning out the workspace and rebuilding, but it's very consistent. In contrast, the current code on jessica/minimal_scoring_plugin (PR #498) seems to load correctly, so I'm looking into the differences to try to understand this.

Update:

The problem seems to be related to the change in model uri from fuel.ignitionrobotics.org to fuel.gazebosim.org. I couldn't figure out whether this url needs to be updated in a configuration somewhere, but changing them all back fixes the problem.

@j-herman
Copy link
Collaborator

This runs fine on my machine - took a very long time to download the models, but after that all seems to work ok. The simulation does not exit when it hits the "finished" state - is this intended?
For reference, I am not running in docker.

@M1chaelM
Copy link
Collaborator

This runs fine on my machine - took a very long time to download the models, but after that all seems to work ok. The simulation does not exit when it hits the "finished" state - is this intended? For reference, I am not running in docker.

Great. It's working for me now too. I'm not 100% sure, but I think the issue was an upstream change to libignition-fuel-tools7. After updating to the latest packages, then sourcing setup again and rebuilding the environment, it now seems to be checking both fuel.ignitionrobotics.org and fuel.gazebosim.org by default, which resolves the problem.

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.

All looks good! The world is loading with the ScoringPlugin and the /vrx/task/info is working as described. The simulation doesn't exit when the task times out, but I think that is expected for this PR.

Copy link
Collaborator

@j-herman j-herman left a comment

Choose a reason for hiding this comment

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

See comment on CMakeLists - I can make the updates when I submit the Stationkeeping PR, or if you've got a cleaner way to enable the linking and want to set it up here, that works too.

@@ -64,6 +64,7 @@ install(

# Plugins
list(APPEND VRX_IGN_PLUGINS
Copy link
Collaborator

Choose a reason for hiding this comment

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

There may be a better way to do this, but when I built the Stationkeeping plugin I had to pull the base ScoringPlugin out into a separate library to get everything to link correctly. I treated it just like the Waves library (but with the right dependencies) and was then able to add Stationkeeping to the for loop with no issues.

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 makes sense that we have to do that. I updated the code in ef2115b.

@caguero
Copy link
Contributor Author

caguero commented Aug 25, 2022

This runs fine on my machine - took a very long time to download the models, but after that all seems to work ok. The simulation does not exit when it hits the "finished" state - is this intended? For reference, I am not running in docker.

It's expected not to finish. That's on the ToDo list for the next part of this plugin.

@caguero
Copy link
Contributor Author

caguero commented Aug 25, 2022

This runs fine on my machine - took a very long time to download the models, but after that all seems to work ok. The simulation does not exit when it hits the "finished" state - is this intended? For reference, I am not running in docker.

Great. It's working for me now too. I'm not 100% sure, but I think the issue was an upstream change to libignition-fuel-tools7. After updating to the latest packages, then sourcing setup again and rebuilding the environment, it now seems to be checking both fuel.ignitionrobotics.org and fuel.gazebosim.org by default, which resolves the problem.

That's also expected and it also happened to me. Sorry, I forgot to mention it in the description. The problem should be fixed if you update your libignition-fuel-tools7.

Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
@caguero caguero changed the base branch from caguero/wave_refactor to gazebosim September 8, 2022 23:40
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
@caguero caguero merged commit 5e43274 into gazebosim Sep 9, 2022
@M1chaelM M1chaelM mentioned this pull request Sep 13, 2022
14 tasks
@caguero caguero deleted the caguero/scoring_plugin branch January 5, 2023 21:21
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.

3 participants