Expand description
The C ABI for the motion helpers: chassis kinematics, an arm, odometry, waypoint guidance, the safety gate, and the conversions to servo, ESC, and encoder units.
These wrap the robotics half of pamoja_kit. The kinematic models, the arm, the
waypoint follower, and the servo, ESC, and encoder scales hold only their parameters and
never change, so each crosses by value as a small struct the caller fills in and passes
to every call; the helper applies the same fallbacks the Rust constructor does, such as
taking a length’s magnitude. The helpers that remember something between calls, the
odometry, the e-stop, the watchdog, the limits, the safety gate, and the quadrature
decoder, are opaque handles, each with its own _free. A constructor never returns
null, and each method documents what it returns for a null handle.
Structs§
- Pamoja
Ackermann - Car-like steering: one steered axle and a driven axle
wheelbaseapart. - Pamoja
Body Motion - A planar body motion: a forward speed and a yaw rate.
- Pamoja
DhParameters - One joint of a serial arm in the Denavit-Hartenberg convention.
- Pamoja
Diff Drive - A differential drive: two wheels
trackapart. - PamojaE
Stop - An opaque handle to a latching emergency stop.
- Pamoja
Esc - An electronic speed controller’s reverse, neutral, and forward pulse widths.
- Pamoja
Guidance - The command toward a waypoint, with the geometry behind it.
- Pamoja
Joints - A two-link arm’s joint angles, in radians.
- Pamoja
Limits - An opaque handle to speed and acceleration limits, with the motion they last allowed.
- Pamoja
Mecanum - A mecanum base: four wheels
wheelbasefront to rear andtrackside to side. - Pamoja
Odometry - An opaque handle to a dead-reckoned pose.
- Pamoja
Point - A point in a plane.
- Pamoja
Pose - Where a robot is and which way it faces.
- Pamoja
Quadrature - An opaque handle to a quadrature encoder decoder.
- Pamoja
Quadrature Scale - An encoder’s resolution and the radius of the wheel it turns with.
- Pamoja
Reach - The closest and farthest a two-link arm’s hand reaches from its shoulder.
- Pamoja
Safety Gate - An opaque handle to the gate every motion command passes through: an e-stop, a watchdog, and limits.
- Pamoja
Servo Map - A hobby servo’s pulse range and travel.
- Pamoja
Side Speeds - The speeds of a two-sided drive’s left and right wheels or tracks.
- Pamoja
Skid Steer - A skid-steer drive: tracks or wheels
trackapart that slip sideways to turn. - Pamoja
Transform - A 4x4 homogeneous transform, a rotation and a translation, stored row-major.
- Pamoja
Twist - How fast a robot is asked to move.
- Pamoja
TwoLink Arm - A planar two-link arm: a shoulder link
l1long and an elbow linkl2long. - Pamoja
Watchdog - An opaque handle to a deadman timer.
- Pamoja
Waypoint Follower - Steers toward a waypoint: the speeds and gains of a carrot-following guide.
- Pamoja
Wheel Speeds - The four wheel speeds of a mecanum base.
Enums§
- Pamoja
Elbow - Which way a two-link arm’s elbow bends.
Functions§
- pamoja_
ackermann_ curvature - Returns the path curvature of a steering angle, the reciprocal of the turn radius.
- pamoja_
ackermann_ steering_ angle - Returns the steering angle for a forward speed and a yaw rate.
- pamoja_
ackermann_ turn_ radius - Returns the turn radius of a steering angle.
- pamoja_
ackermann_ yaw_ rate - Returns the yaw rate a forward speed and a steering angle produce.
- pamoja_
dh_ transform - Returns the transform one Denavit-Hartenberg joint makes.
- pamoja_
diff_ drive_ body_ motion - Returns the body motion a differential drive makes from measured wheel speeds.
- pamoja_
diff_ drive_ wheel_ speeds - Returns the wheel speeds a differential drive needs for a body motion.
- pamoja_
esc_ bidirectional - Returns the common reversible ESC: 1000, 1500, and 2000 microseconds.
- pamoja_
esc_ pulse - Returns the pulse width for a throttle.
- pamoja_
estop_ ⚠engage - Engages an e-stop; it holds until reset.
- pamoja_
estop_ ⚠free - Releases an e-stop handle.
- pamoja_
estop_ ⚠gate - Passes a command through an e-stop.
- pamoja_
estop_ ⚠is_ engaged - Reports whether an e-stop is engaged.
- pamoja_
estop_ ⚠new - Creates an e-stop that is not engaged.
- pamoja_
estop_ ⚠reset - Clears an e-stop.
- pamoja_
forward_ ⚠kinematics - Returns the transform from a serial arm’s base to its tool.
- pamoja_
limits_ ⚠apply - Bounds a command in speed and acceleration.
- pamoja_
limits_ ⚠free - Releases a limits handle.
- pamoja_
limits_ ⚠new - Creates limits on speed and acceleration, starting from rest.
- pamoja_
limits_ ⚠reset - Forgets the motion limits last allowed, so the next command eases up from rest.
- pamoja_
mecanum_ body_ motion - Returns the body twist a mecanum base makes from measured wheel speeds.
- pamoja_
mecanum_ wheel_ speeds - Returns the four wheel speeds a mecanum base needs for a body twist.
- pamoja_
obstacle_ stop - Cuts forward and sideways motion when an obstacle is within the stopping distance.
- pamoja_
odometry_ ⚠free - Releases an odometry handle.
- pamoja_
odometry_ ⚠fuse_ heading - Nudges an odometry estimate’s heading toward an absolute measurement.
- pamoja_
odometry_ ⚠integrate - Integrates a body motion over a time step onto an odometry estimate.
- pamoja_
odometry_ ⚠integrate_ wheels - Integrates the distances two wheels rolled onto an odometry estimate.
- pamoja_
odometry_ ⚠new - Creates an odometry estimate starting from a known pose.
- pamoja_
odometry_ ⚠pose - Reads an odometry estimate’s pose.
- pamoja_
odometry_ ⚠reset - Sets an odometry estimate to a known pose.
- pamoja_
quadrature_ ⚠count - Reads a quadrature decoder’s signed count of steps.
- pamoja_
quadrature_ ⚠free - Releases a quadrature decoder handle.
- pamoja_
quadrature_ ⚠new - Creates a quadrature decoder seeded with the encoder’s current channel levels.
- pamoja_
quadrature_ ⚠reset - Sets a quadrature decoder’s count back to 0, keeping the channel state it last read.
- pamoja_
quadrature_ scale_ distance - Returns the distance a wheel rolled for a step count.
- pamoja_
quadrature_ scale_ velocity - Returns a wheel’s speed from the steps counted over a time step.
- pamoja_
quadrature_ ⚠update - Feeds a quadrature decoder the channel levels it reads now.
- pamoja_
safety_ ⚠gate_ command - Returns the command that is safe to drive for a desired one over a time step.
- pamoja_
safety_ ⚠gate_ engage_ estop - Engages a safety gate’s latching e-stop.
- pamoja_
safety_ ⚠gate_ feed - Feeds a safety gate’s watchdog; call it whenever a fresh command arrives.
- pamoja_
safety_ ⚠gate_ free - Releases a safety gate handle.
- pamoja_
safety_ ⚠gate_ is_ stopped - Reports whether a safety gate is forcing a stop.
- pamoja_
safety_ ⚠gate_ new - Creates a safety gate from limits and a watchdog timeout.
- pamoja_
safety_ ⚠gate_ reset_ estop - Clears a safety gate’s e-stop.
- pamoja_
servo_ map_ angle - Returns the angle a servo pulse width sets.
- pamoja_
servo_ map_ pulse - Returns the pulse width that sets a servo to an angle.
- pamoja_
servo_ map_ standard - Returns the standard hobby servo: 1000 to 2000 microseconds over 180 degrees.
- pamoja_
skid_ steer_ body_ motion - Returns the body motion a skid-steer drive makes from measured side speeds.
- pamoja_
skid_ steer_ wheel_ speeds - Returns the side speeds a skid-steer drive needs for a body motion.
- pamoja_
transform_ identity - Returns the identity transform: no rotation and no translation.
- pamoja_
transform_ multiply - Returns the transform that applies
secondand thenfirst, their product. - pamoja_
two_ ⚠link_ arm_ joints_ for - Finds the joint angles that put a two-link arm’s hand at a point.
- pamoja_
two_ link_ arm_ reach - Returns how close and how far a two-link arm reaches.
- pamoja_
two_ link_ arm_ tip - Returns where a two-link arm’s hand is for its joint angles.
- pamoja_
watchdog_ ⚠feed - Feeds a watchdog, restarting its silence timer.
- pamoja_
watchdog_ ⚠free - Releases a watchdog handle.
- pamoja_
watchdog_ ⚠is_ expired - Reports whether a watchdog has expired.
- pamoja_
watchdog_ ⚠new - Creates a watchdog that expires after
timeoutwithout being fed. - pamoja_
watchdog_ ⚠update - Advances a watchdog’s timer and reports whether it has expired.
- pamoja_
waypoint_ follower_ guide - Produces the command from a robot’s position and heading toward a target.