Class CoreHardwareInterface

Inheritance Relationships

Base Type

Class Documentation

class bitbots_ros_control::CoreHardwareInterface : public bitbots_ros_control::HardwareInterface

Public Functions

explicit CoreHardwareInterface(rclcpp::Node::SharedPtr nh, std::shared_ptr<DynamixelDriver> &driver, int id, int read_rate)
bool get_power_status()
virtual bool init()
virtual void read(const rclcpp::Time &t, const rclcpp::Duration &dt)
virtual void write(const rclcpp::Time &t, const rclcpp::Duration &dt)
virtual void restoreAfterPowerCycle()

Private Functions

bool switch_power(std::shared_ptr<std_srvs::srv::SetBool::Request> req, std::shared_ptr<std_srvs::srv::SetBool::Response> resp)

Private Members

rclcpp::Node::SharedPtr nh_
std::shared_ptr<DynamixelDriver> driver_
int id_
int read_rate_
int read_counter_
std::array<uint8_t, 27> data_
bool requested_power_status_
bool last_read_successful_
std_msgs::msg::Bool power_switch_status_
std_msgs::msg::Bool power_control_status_
std_msgs::msg::Float64 VCC_
std_msgs::msg::Float64 VBAT_
std_msgs::msg::Float64MultiArray VBAT_individual_
std_msgs::msg::Float64 VEXT_
std_msgs::msg::Float64 VDXL_
std_msgs::msg::Float64 current_
rclcpp::Publisher<diagnostic_msgs::msg::DiagnosticArray>::SharedPtr diagnostic_pub_
rclcpp::Publisher<std_msgs::msg::Bool>::SharedPtr power_pub_
rclcpp::Publisher<std_msgs::msg::Float64>::SharedPtr vcc_pub_
rclcpp::Publisher<std_msgs::msg::Float64>::SharedPtr vbat_pub_
rclcpp::Publisher<std_msgs::msg::Float64MultiArray>::SharedPtr vbat_individual_pub_
rclcpp::Publisher<std_msgs::msg::Float64>::SharedPtr vext_pub_
rclcpp::Publisher<std_msgs::msg::Float64>::SharedPtr vdxl_pub_
rclcpp::Publisher<std_msgs::msg::Float64>::SharedPtr current_pub_
rclcpp::Service<std_srvs::srv::SetBool>::SharedPtr power_switch_service_