BCLab-UNM / SwarmathonIV-Cabrillo-Public

Swarmathon code repository for Cabrillo College
MIT License
6 stars 1 forks source link

Patch Swarmie.drive_to() when effective distance is negative. #202

Closed darrenchurchill closed 5 years ago

darrenchurchill commented 5 years ago

This addresses #194

If a service call to the driver includes a turn and a negative distance, the driver immediately enters the reverse state, skipping the turn completely.

Using the claw_offset argument, its possible, and now common in dropoff, for the effective distance's used in Swarmie.drive_to() to be negative. This happens when the rover has arrived at a home corner, while its on top of one side of the home plate. In this case, the intent of the drive_to() call is to make the rover turn ~90-120 degrees left, back up ~5-10 cm, and drop off the cube just inside of the home tags.