|
libstp
Robotics library for Botball
|
#include <TransportWriter.hpp>
Public Member Functions | |
| void | setMotorMode (uint8_t port, int mode) |
| Publish motor mode command (0=OFF, 1=PASSIVE_BRAKE). | |
| void | setMotor (uint8_t port, int valueData) |
| Publish open-loop motor power for one port. | |
| void | setMotorVelocity (uint8_t port, int32_t velocity) |
| Publish a firmware-side velocity target in BEMF units. | |
| void | setMotorPosition (uint8_t port, int32_t velocity, int32_t goalPosition) |
| Publish an absolute position move command. | |
| void | setMotorRelative (uint8_t port, int32_t velocity, int32_t deltaPosition) |
| Publish a relative position move command. | |
| void | setServo (uint8_t port, float degrees) |
| Publish a servo position command in degrees (0-180). | |
| void | setServoMode (uint8_t port, uint8_t mode) |
| Publish a servo mode update. | |
| void | setSmoothServo (uint8_t port, float targetDeg, float speedDegPerSec, int easing) |
| Publish a smooth servo command; interpolation runs in the C++ reader at 200 Hz. | |
| void | setMotorPid (uint8_t port, float kp, float ki, float kd) |
| Publish per-port PID gains. | |
| void | resetMotorPosition (uint8_t port) |
| Reset firmware motor position for one port. | |
| void | setChassisVelocity (float vx, float vy, float wz) |
| void | setShutdown (bool enabled) |
| Toggle the STM32-wide shutdown flag for the safest available stop path. | |
| void | sendHeartbeat () |
| void | sendKinematicsConfig (const std::array< std::array< float, 4 >, 3 > &inv_matrix, const std::array< float, 4 > &ticks_to_rad, const std::array< std::array< float, 3 >, 4 > &fwd_matrix, const std::array< float, 4 > &bemf_offset) |
| Send kinematics config to STM32 for on-board odometry. | |
| void | resetOdometry () |
| Request STM32 to reset its integrated odometry pose. | |
| void | resetCalibOdometry () |
Static Public Member Functions | |
| static TransportWriter & | instance () |
Command publisher for the wombat bundle.
HAL motor and servo wrappers delegate writes here so transport details stay out of the public HAL classes.
Definition at line 25 of file TransportWriter.hpp.
|
inlinestatic |
Definition at line 28 of file TransportWriter.hpp.
| void platform::wombat::core::TransportWriter::resetCalibOdometry | ( | ) |
Request the external calibration board to zero its fused odometry pose. No-op on the wire if no bridge/board is listening.
| void platform::wombat::core::TransportWriter::resetMotorPosition | ( | uint8_t | port | ) |
Reset firmware motor position for one port.
| void platform::wombat::core::TransportWriter::resetOdometry | ( | ) |
Request STM32 to reset its integrated odometry pose.
| void platform::wombat::core::TransportWriter::sendHeartbeat | ( | ) |
Send a heartbeat to stm32-data-reader. Must be called every ~100 ms while missions are running or the hardware watchdog fires.
| void platform::wombat::core::TransportWriter::sendKinematicsConfig | ( | const std::array< std::array< float, 4 >, 3 > & | inv_matrix, |
| const std::array< float, 4 > & | ticks_to_rad, | ||
| const std::array< std::array< float, 3 >, 4 > & | fwd_matrix, | ||
| const std::array< float, 4 > & | bemf_offset ) |
Send kinematics config to STM32 for on-board odometry.
| void platform::wombat::core::TransportWriter::setChassisVelocity | ( | float | vx, |
| float | vy, | ||
| float | wz ) |
Command a body-frame chassis velocity [vx (m/s), vy (m/s), wz (rad/s)]. The reader puts all four motors into MOT_MODE_CHASSIS and the STM32 maps this to per-wheel setpoints via forward kinematics — the full chassis velocity loop closes on-MCU. High-rate, best-effort.
| void platform::wombat::core::TransportWriter::setMotor | ( | uint8_t | port, |
| int | valueData ) |
Publish open-loop motor power for one port.
| void platform::wombat::core::TransportWriter::setMotorMode | ( | uint8_t | port, |
| int | mode ) |
Publish motor mode command (0=OFF, 1=PASSIVE_BRAKE).
| void platform::wombat::core::TransportWriter::setMotorPid | ( | uint8_t | port, |
| float | kp, | ||
| float | ki, | ||
| float | kd ) |
Publish per-port PID gains.
| void platform::wombat::core::TransportWriter::setMotorPosition | ( | uint8_t | port, |
| int32_t | velocity, | ||
| int32_t | goalPosition ) |
Publish an absolute position move command.
| void platform::wombat::core::TransportWriter::setMotorRelative | ( | uint8_t | port, |
| int32_t | velocity, | ||
| int32_t | deltaPosition ) |
Publish a relative position move command.
| void platform::wombat::core::TransportWriter::setMotorVelocity | ( | uint8_t | port, |
| int32_t | velocity ) |
Publish a firmware-side velocity target in BEMF units.
| void platform::wombat::core::TransportWriter::setServo | ( | uint8_t | port, |
| float | degrees ) |
Publish a servo position command in degrees (0-180).
| void platform::wombat::core::TransportWriter::setServoMode | ( | uint8_t | port, |
| uint8_t | mode ) |
Publish a servo mode update.
| void platform::wombat::core::TransportWriter::setShutdown | ( | bool | enabled | ) |
Toggle the STM32-wide shutdown flag for the safest available stop path.
| void platform::wombat::core::TransportWriter::setSmoothServo | ( | uint8_t | port, |
| float | targetDeg, | ||
| float | speedDegPerSec, | ||
| int | easing ) |
Publish a smooth servo command; interpolation runs in the C++ reader at 200 Hz.