|
| Pi3HatInterface (const int can_cpu, const ::mjbots::pi3hat::Pi3Hat::Configuration &pi3hat_config) |
| Configure interface and spawn CAN thread. More...
|
|
| ~Pi3HatInterface () |
| Stop CAN thread.
|
|
void | reset (const Dictionary &config) override |
| Reset interface. More...
|
|
void | observe (Dictionary &observation) const override |
| Write actuation-interface observations to dictionary. More...
|
|
void | process_action (const Dictionary &action) override |
| Process a new action dictionary. More...
|
|
void | cycle (std::function< void(const moteus::Output &)> callback) final |
| Spin a new communication cycle. More...
|
|
| Interface () |
| Initialize actuation interface for a given servo layout.
|
|
virtual | ~Interface ()=default |
| Virtual destructor so that derived destructors are called properly.
|
|
virtual void | cycle (std::function< void(const moteus::Output &)> callback)=0 |
| Spin a new communication cycle. More...
|
|
virtual void | reset (const Dictionary &config)=0 |
| Reset interface. More...
|
|
virtual void | observe (Dictionary &observation) const =0 |
| Write servo and IMU observations to dictionary. More...
|
|
const ServoLayout & | servo_layout () const noexcept |
| Get servo layout.
|
|
const std::map< int, int > & | servo_bus_map () const noexcept |
| Map from servo ID to the CAN bus the servo is connected to.
|
|
const std::map< int, std::string > & | servo_name_map () const noexcept |
| Map from servo ID to joint name.
|
|
std::vector< moteus::ServoCommand > & | commands () |
| Get servo commands.
|
|
const std::vector< moteus::ServoReply > & | replies () const |
| Get servo replies.
|
|
moteus::Data & | data () |
| Get joint command-reply data. More...
|
|
void | reset_action (Dictionary &action) |
| Reset action dictionary to the default action. More...
|
|
virtual void | process_action (const Dictionary &action)=0 |
| Process a new action dictionary. More...
|
|
void | write_position_commands (const Dictionary &action) |
| Write position commands from an action dictionary. More...
|
|
void | write_stop_commands () noexcept |
| Stop all servos. More...
|
|
void | observe_imu (Dictionary &observation) const |
| Observe IMU measurements. More...
|
|
Interface to moteus controllers.
Internally it uses a background thread to operate the pi3hat, enabling the main thread to perform work while servo communication is taking place.