Skip to content

Module drivers core

Stefan deBruyn edited this page Oct 20, 2018 · 12 revisions

Module drivers/core

Maintainers

Slack Github
Stefan @stefandebruyn @stefandebruyn

Related Issues

Usage

robotcore module

core.robotcore contains abstract representations of robot subsystems intended to provide a common interface for both simulated and actual robots.

  • Subsystem - Parent of all subsystems. Holds a unique name by which to identify the system
  • Motor - Parent of all motor types. Holds a robotmotion.MotionState and the timestamp of the last update
  • StepperMotor - Type of Motor that can be updated with a position x and a timestamp t. Velocity, acceleration, and jerk are then calculated by approximating the slopes of dx/dt, d2x/dt2, and d3x/dt3.
  • BinaryActuator - An actuator with a binary state, such as a servo claw
  • AnalogActuator - An actuator with a bounded state, such as a linear slide
  • RobotFrame - Represents a collection of subsystem states and a sequence of instructions associated with them. Frames are run as their own threads; implementations should override run()

robotmotion module

core.robotmotion contains things relating to motion planning and profiling. Like robotcore, this module is built to be common ground for the simulator and the robot.

  • MotionProfile - Represents a motion profile fitted to some MotionConstraints and a pair of MotionStates. Target states at specific points in time within the profile can be fetched with state_at(float)
  • MotionConstraints - The maximum velocity, acceleration, and jerk magnitudes allowed for a particular profile
  • MotionState - An instantaneous kinematic state in 1D space; <pos, vel, accel, jerk, time>
  • make_tri - Generates both a velocity-biased and acceleration-biased and returns whichever is more time-optimal (see the docstrings)
  • make_trap - Generates a trapezoidal profile
  • make_scurve - Generates an S-curve profile

The profiling algorithms have some drawbacks. See the notes at the top of drivers/core/robotmotion.py.

Clone this wiki locally