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

Refactor enable auton message to 'AutonCommand' #616

Closed
wants to merge 6 commits into from

Conversation

Emerson-Ramey
Copy link
Contributor

@Emerson-Ramey Emerson-Ramey commented Nov 26, 2023

Summary

Closes #543

  • I created a new file AutonCommand.msg and added the new types to WaypointType.msg (MALLET and WATER_BOTTLE).
  • I changed context.py by adding a subscriber to the "auton/command" topic in Context and changed the functions that used the EnableAuton message to use the AutonCommand message.
  • I changed course_publish_helpers.py to use a publisher instead of a service so I could test the change with debug_course_publisher.py and debug_enable_auton.py.

Did you add documentation to the wiki?

No

How was this code tested?

  • I used auton_sim.launch and ran the debug_course_publisher.py to verify it worked the same way as it did on the master branch (the old code). This meant that it receives the message full of waypoints and uses it to set the course and start driving to the first waypoint
  • I used auton_sim.launch and ran debug_course_publisher.py to first set the waypoints in the course. Then I ran debug_enable_auton.py to change the waypoints to see if the message was marked as different in the auton_command_callback (which then causes the course to be updated). Then I ran debug_disable_auton.py to change the is_enabled bool to once again see if the message was marked as different in the auton_command_callback. I printed whenever a change was detected (otherwise it meant the message was ignored if it was the same, which is the behavior we want).

Did you test this in sim?

Yes

Did you test this on the rover?

No

Did you add unit tests?

I changed course_publish_helpers.py so that debug_course_publisher.py works with the new message. But I don’t know if it would be worth it to change debug_service.py or just delete it. After we fix that, we could also delete the EnableAuton.msg since AutonCommand.msg replaces it.

@qhdwight
Copy link
Collaborator

After more thought it makes more sense to activate auton through a service (RPC) as we did last year. That way it is relaible and does not spam the network. Sorry for the confusion. We will figure out a way using RPC's to let ESW know the proper LED.

@qhdwight qhdwight closed this Jan 23, 2024
@Emerson-Ramey Emerson-Ramey deleted the ebr/auton-command branch February 20, 2024 04:03
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.

Refactor enable auton message to 'AutonCommand'
2 participants