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

Adding number of collisions to the task message #356

Merged
merged 4 commits into from
Sep 10, 2021

Conversation

caguero
Copy link
Contributor

@caguero caguero commented Sep 10, 2021

I moved the logic to account for the collisions to the base scoring plugin and include it in the task message.

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.

Tested by running:

roslaunch vrx_gazebo gymkhana.launch extra_gazebo_args:=--verbose

and

rostopic echo /vrx/task/info

Then navigating the course and hitting some obstacles. The num_collisions counter is working as expected. I notice that there is a discrepancy between the number of collision messages produced and the number of collisions counted, but I think this is good. It looks like I get a collision message for every single bump, even if several of them happen as part of what an onlooker would probably think of as a single incident, and multiple collision messages can have the same collision number. The counter only increments for each separate incident. This probably also explains why I didn't lose as many points as I thought I would in previous testing.

After five collisions, I waited for the task to end and got the following final messages from /vrx/task/info:

name: "gymkhana"
state: "running"
ready_time: 
  secs: 10
  nsecs:         0
running_time: 
  secs: 20
  nsecs:         0
elapsed_time: 
  secs: 299
  nsecs:         0
remaining_time: 
  secs: 1
  nsecs:         0
timed_out: False
num_collisions: 5
score: 35.41200638594324
---
name: "gymkhana"
state: "finished"
ready_time: 
  secs: 10
  nsecs:         0
running_time: 
  secs: 20
  nsecs:         0
elapsed_time: 
  secs: 300
  nsecs:         0
remaining_time: 
  secs: 0
  nsecs:         0
timed_out: True
num_collisions: 5
score: 40.294599302037504

These are exactly as I would expect, so I think this is ready to go.

multiple contacts with a single obstacle that are all part of what I would describe as a single collision.

@caguero
Copy link
Contributor Author

caguero commented Sep 10, 2021

There's a parameter <collision_buffer> that sets the minimum time between collisions.

@caguero caguero merged commit 0eb99c9 into caguero/fix_gymkhana_issues Sep 10, 2021
@caguero caguero deleted the caguero/add_collisions branch September 10, 2021 19:50
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