class RobotInterface
Declaration
class RobotInterface { /* full declaration omitted */ };Declared at: robot_interface/include/robot_interface/RobotInterface.h:31
Member Variables
- private std::string name_
- private mc_rtc::Configuration comm_config_
- private int comm_
- private PluginLoader<robot_interface::RobotDriver> driver_loader_
- private std::shared_ptr<RobotDriver> driver_
- private int last_cmd_
- private std::chrono::steady_clock::time_point last_cmd_arrival_
- private std::chrono::milliseconds connection_timeout_
- private bool link_lost_ = false
- private std::mutex init_mutex_
- private std::condition_variable init_cv_
- private bool initialized_ = false
- private std::string init_error_
- private std::string control_mode_ = {}
- private bool latency_stats_ = false
- private uint64_t last_echo_stamp_ = 0
- private uint64_t last_echo_hold_ = 0
- private size_t rtt_count_ = 0
- private double rtt_sum_us_ = 0.
- private double rtt_min_us_ = 0.
- private double rtt_max_us_ = 0.
- private std::chrono::steady_clock::time_point last_latency_report_
Method Overview
- public RobotInterface(const std::string & name, const mc_rtc::Configuration & comm_config)
- private int handleInitQuery(const int & payload)
- private std::string linkLossReason()
- private void loadDriver(const std::string & driver_name, const mc_rtc::Configuration & driver_config, const mc_rtc::Configuration & grippers_config)
- private int makeHoldCommand()
- public const std::string & name() const
- private void recordLatency(const robot_comm::Command & cmd, std::chrono::steady_clock::time_point arrival)
- public void run(const std::atomic<bool> & interrupt)
- private void updateControl()
- private void updateSensors()
Methods
¶RobotInterface(
const std::string& name,
const mc_rtc::Configuration& comm_config)
RobotInterface(
const std::string& name,
const mc_rtc::Configuration& comm_config)Declared at: robot_interface/include/robot_interface/RobotInterface.h:36
Parameters
- const std::string& name
- Robot name, used as the prefix of its topics.
- const mc_rtc::Configuration& comm_config
- The `network_interface` configuration.
¶int handleInitQuery(const int& payload)
int handleInitQuery(const int& payload)Declared at: robot_interface/include/robot_interface/RobotInterface.h:50
Parameters
- const int& payload
¶std::string linkLossReason()
std::string linkLossReason()Declared at: robot_interface/include/robot_interface/RobotInterface.h:64
¶void loadDriver(
const std::string& driver_name,
const mc_rtc::Configuration& driver_config,
const mc_rtc::Configuration& grippers_config)
void loadDriver(
const std::string& driver_name,
const mc_rtc::Configuration& driver_config,
const mc_rtc::Configuration& grippers_config)Declared at: robot_interface/include/robot_interface/RobotInterface.h:52
Parameters
- const std::string& driver_name
- const mc_rtc::Configuration& driver_config
- const mc_rtc::Configuration& grippers_config
¶int makeHoldCommand()
int makeHoldCommand()Declared at: robot_interface/include/robot_interface/RobotInterface.h:61
¶const std::string& name() const
const std::string& name() constDescription
Robot name.
Declared at: robot_interface/include/robot_interface/RobotInterface.h:42
¶void recordLatency(
const robot_comm::Command& cmd,
std::chrono::steady_clock::time_point arrival)
void recordLatency(
const robot_comm::Command& cmd,
std::chrono::steady_clock::time_point arrival)Declared at: robot_interface/include/robot_interface/RobotInterface.h:94
Parameters
- const robot_comm::Command& cmd
- std::chrono::steady_clock::time_point arrival
¶void run(const std::atomic<bool>& interrupt)
void run(const std::atomic<bool>& interrupt)Description
Handle the init handshake, then run the control loop until interrupt is set.
Declared at: robot_interface/include/robot_interface/RobotInterface.h:39
Parameters
- const std::atomic<bool>& interrupt
¶void updateControl()
void updateControl()Declared at: robot_interface/include/robot_interface/RobotInterface.h:57
¶void updateSensors()
void updateSensors()Declared at: robot_interface/include/robot_interface/RobotInterface.h:56