|
libstp
Robotics library for Botball
|
#include <SimWorld.hpp>
Public Attributes | |
| DrivetrainKind | kind {DrivetrainKind::Differential} |
| uint8_t | leftPort {0} |
| uint8_t | rightPort {1} |
| bool | leftInverted {false} |
| bool | rightInverted {false} |
| uint8_t | flPort {0} |
| uint8_t | frPort {1} |
| uint8_t | blPort {2} |
| uint8_t | brPort {3} |
| bool | flInverted {false} |
| bool | frInverted {false} |
| bool | blInverted {false} |
| bool | brInverted {false} |
| float | maxWheelVelocityRadS {30.0f} |
| float | motorTimeConstantSec {0.1f} |
| float | ticksToRad {0.00436332313f} |
| float | bemfSampleRateHz {200.0f} |
| float | viscousDragCoeff {0.0f} |
| float | coulombFrictionRadSS {0.0f} |
| float | bemfNoiseStddev {0.0f} |
Motor mapping + kinematic parameters the sim needs beyond the pure geometry in RobotConfig. Kept here (not in RobotConfig) because this is sim-specific tuning, not robot ground truth.
Definition at line 29 of file SimWorld.hpp.
| float libstp::sim::SimMotorMap::bemfNoiseStddev {0.0f} |
Standard deviation of Gaussian noise added to BEMF integer readings (in raw BEMF units). Models real encoder quantization and electrical noise. Default 0 = clean readings.
Definition at line 85 of file SimWorld.hpp.
| float libstp::sim::SimMotorMap::bemfSampleRateHz {200.0f} |
BEMF sample rate in Hz used by MotorAdapter when encoding wheel ω as a BEMF integer. The wombat firmware samples motor BEMF at 200 Hz, so setVelocity(N) means "N encoder ticks per 5 ms". The sim must use the same scale to recover wheel ω from the commanded integer.
Definition at line 68 of file SimWorld.hpp.
| bool libstp::sim::SimMotorMap::blInverted {false} |
Definition at line 46 of file SimWorld.hpp.
| uint8_t libstp::sim::SimMotorMap::blPort {2} |
Definition at line 42 of file SimWorld.hpp.
| bool libstp::sim::SimMotorMap::brInverted {false} |
Definition at line 47 of file SimWorld.hpp.
| uint8_t libstp::sim::SimMotorMap::brPort {3} |
Definition at line 43 of file SimWorld.hpp.
| float libstp::sim::SimMotorMap::coulombFrictionRadSS {0.0f} |
Coulomb (dry/constant) friction in rad/s². A constant angular deceleration opposing motion, independent of speed. Models gearbox friction and wheel-surface interaction. Clamped so it cannot reverse direction. Default 0 = no Coulomb friction.
Definition at line 80 of file SimWorld.hpp.
| bool libstp::sim::SimMotorMap::flInverted {false} |
Definition at line 44 of file SimWorld.hpp.
| uint8_t libstp::sim::SimMotorMap::flPort {0} |
Definition at line 40 of file SimWorld.hpp.
| bool libstp::sim::SimMotorMap::frInverted {false} |
Definition at line 45 of file SimWorld.hpp.
| uint8_t libstp::sim::SimMotorMap::frPort {1} |
Definition at line 41 of file SimWorld.hpp.
| DrivetrainKind libstp::sim::SimMotorMap::kind {DrivetrainKind::Differential} |
Definition at line 31 of file SimWorld.hpp.
| bool libstp::sim::SimMotorMap::leftInverted {false} |
Definition at line 36 of file SimWorld.hpp.
| uint8_t libstp::sim::SimMotorMap::leftPort {0} |
Definition at line 34 of file SimWorld.hpp.
| float libstp::sim::SimMotorMap::maxWheelVelocityRadS {30.0f} |
Wheel angular velocity (rad/s) produced by a 100% command. Used as the linear scale from commanded signed percent to wheel ω.
Definition at line 51 of file SimWorld.hpp.
| float libstp::sim::SimMotorMap::motorTimeConstantSec {0.1f} |
First-order motor lag in seconds. wheel_ω approaches target_ω with time constant τ (≈ rise time from 0 to 63% of a step).
Definition at line 55 of file SimWorld.hpp.
| bool libstp::sim::SimMotorMap::rightInverted {false} |
Definition at line 37 of file SimWorld.hpp.
| uint8_t libstp::sim::SimMotorMap::rightPort {1} |
Definition at line 35 of file SimWorld.hpp.
| float libstp::sim::SimMotorMap::ticksToRad {0.00436332313f} |
Motor encoder calibration: radians per encoder tick. Matches the default in foundation::MotorCalibration (≈ 2π/1440). Used to convert between BEMF integer commands (Motor::setVelocity) and wheel angular velocity inside the sim.
Definition at line 61 of file SimWorld.hpp.
| float libstp::sim::SimMotorMap::viscousDragCoeff {0.0f} |
Viscous (velocity-proportional) drag coefficient in 1/s. At each tick the wheel ω is reduced by viscousDragCoeff * ω * dt. Models bearing friction and back-EMF drag that scale with speed. Default 0 = no viscous drag (legacy behavior).
Definition at line 74 of file SimWorld.hpp.