Skip to content

API Documentation & Variable Drive parameters #5

@vmandke

Description

@vmandke

Need help understanding the APIs of drive and variable drive. From the examples it seems that both drive and variable drive move forward the robot a certain distance. This distance moved is then provided via the callback travelDataDidUpdate. However, I would like to have better control and accuracy with the robot movement ( +/- 2 inches )

Currently

doubleDriveShouldUpdate {
      if (distanceToCover > some_random_threshold_inches) {
              do variable drive of drive=self.drive, turn=0
      } else {
             stop drive
      }
}
doubleTravelDataDidUpdate {
      distanceToCover -= dr_double_instance.xDeltaInches
}

Above is a minimal pseudo code of what I am doing. However as the callbacks are a bit delayed the robot overshoots by almost 1.6 inches per 10 inches of travel, on an average. (on smaller distances the travel is unpredictable) This is almost overshoots when travelling longer distances of 300 inches or so.

Exactly what does the drive param of variableDrive / drive specify?
How delayed can these callbacks for distance travelled be ?
What should the some_random_threshold_inches be set to ?

I was unable to find detailed documentation for the API. Can you please point me to it ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions