upkie 9.0.0
Open-source wheeled biped robots
Loading...
Searching...
No Matches
MockInterface Class Reference

Interface whose internal state perfectly tracks commands. More...

#include <MockInterface.h>

Public Member Functions

 MockInterface (const double dt)
 Create mock actuator interface. More...
 
 ~MockInterface ()=default
 Default destructor.
 
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
 Simulate a new communication cycle. More...
 
const ServoLayoutservo_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::Datadata ()
 Get joint command-reply data. More...
 
void reset_action (Dictionary &action)
 Reset action dictionary to the default action. 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...
 

Protected Attributes

moteus::Data data_
 Pointers to the memory shared with the CAN thread. More...
 
ImuData imu_data_
 IMU data.
 

Detailed Description

Interface whose internal state perfectly tracks commands.


The documentation for this class was generated from the following files: