-
Notifications
You must be signed in to change notification settings - Fork 0
Module drivers core
Stefan deBruyn edited this page Dec 30, 2018
·
12 revisions
Slack | Github | |
---|---|---|
Stefan | @stefandebruyn | @stefandebruyn |
Tianshu | @thetianshuhuang | @thetianshuhuang |
Contains the lowest-level robot class.
-
RobotFrame
- A threaded encapsulation of subsystem states and an instruction sequence associated with them. Implementations should overrideloop
drivers.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 arobotmotion.MotionState
and the timestamp of the last update -
StepperMotor
- Type ofMotor
that can be updated with a positionx
and a timestampt
. Velocity, acceleration, and jerk are then calculated by approximating the slopes ofdx/dt
,d2x/dt2
, andd3x/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
drivers.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 endpoints and constraints. Target states at specific points in time within the profile can be fetched withstate_at
-
MotionState
- An instantaneous kinematic state in 1D space;<pos, vel, accel, jerk, time>
. Clients shouldn't have to use this -
MotionSegment
- AMotionState
held for some period of time. Clients shouldn't have to use this
Contains the actual motion profile generation algorithms.
-
make_sym_trap
- Generates a symmetrical trapezoidal (three-segment, acceleration-limited) profile -
make_sym_scurve
- Generates a symmetrical S-curve(seven-segment, acceleration- and jerk-limited) profile
The algorithms in this module generate only profiles with zero endpoint velocities, as this allows for complete tolerance of constraints that would have otherwise produced malformed profiles.
An overly verbose example of using a motion profile:
from drivers.core.profiling import make_sym_trap
initial_position = 0
final_position = 100
max_velocity = 10
max_acceleration = 5
profile = make_sym_trap(initial_position, final_position, max_velocity, max_acceleration)
middle_state = profile.state_at(profile.duration / 2)
middle_position = middle_state.x
middle_velocity = middle_state.v
middle_accel = middle_state.a
middle_jerk = middle_state.j