Loading [MathJax]/extensions/tex2jax.js
ros2_control - humble
All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Classes | Typedefs | Enumerations | Functions | Variables
hardware_interface Namespace Reference

Classes

class  Actuator
 
struct  ActuatorInfo
 Contains semantic info about a given actuator loaded from URDF for a transmission. More...
 
class  ActuatorInterface
 Virtual Class to implement when integrating a 1 DoF actuator into ros2_control. More...
 
class  CommandInterface
 
struct  ComponentInfo
 
struct  ControllerInfo
 Controller Information. More...
 
struct  HardwareComponentInfo
 Hardware Component Information. More...
 
struct  HardwareInfo
 This structure stores information about hardware defined in a robot's URDF. More...
 
struct  HardwareReadWriteStatus
 
struct  InterfaceInfo
 
struct  JointInfo
 Contains semantic info about a given joint loaded from URDF for a transmission. More...
 
class  LoanedCommandInterface
 
class  LoanedStateInterface
 
class  ReadOnlyHandle
 A handle used to get and set a value on a given interface. More...
 
class  ReadWriteHandle
 
class  ResourceManager
 
class  ResourceStorage
 
class  Sensor
 
class  SensorInterface
 Virtual Class to implement when integrating a stand-alone sensor into ros2_control. More...
 
class  StateInterface
 
class  System
 
class  SystemInterface
 Virtual Class to implement when integrating a complex system into ros2_control. More...
 
struct  TransmissionInfo
 Contains semantic info about a given transmission loaded from URDF. More...
 

Typedefs

using CallbackReturn = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn
 

Enumerations

enum class  return_type : std::uint8_t { OK = 0 , ERROR = 1 }
 

Functions

HARDWARE_INTERFACE_PUBLIC std::vector< HardwareInfoparse_control_resources_from_urdf (const std::string &urdf)
 Search XML snippet from URDF for information about a control component.
 
double stod (const std::string &s)
 Helper function to convert a std::string to double in a locale-independent way.
 
bool parse_bool (const std::string &bool_string)
 

Variables

constexpr char HW_IF_POSITION [] = "position"
 Constant defining position interface.
 
constexpr char HW_IF_VELOCITY [] = "velocity"
 Constant defining velocity interface.
 
constexpr char HW_IF_ACCELERATION [] = "acceleration"
 Constant defining acceleration interface.
 
constexpr char HW_IF_EFFORT [] = "effort"
 Constant defining effort interface.
 
auto trigger_and_print_hardware_state_transition
 

Detailed Description

Author
: Denis Stogl

Function Documentation

◆ parse_control_resources_from_urdf()

std::vector< HardwareInfo > hardware_interface::parse_control_resources_from_urdf ( const std::string &  urdf)

Search XML snippet from URDF for information about a control component.

Parameters
[in]urdfstring with robot's URDF
Returns
vector filled with information about robot's control resources
Exceptions
std::runtime_errorif a robot attribute or tag is not found

◆ stod()

double hardware_interface::stod ( const std::string &  s)

Helper function to convert a std::string to double in a locale-independent way.

Exceptions
std::invalid_argumentif not a valid number from https://github.com/ros-planning/srdfdom/blob/ad17b8d25812f752c397a6011cec64aeff090c46/src/model.cpp#L53

Variable Documentation

◆ trigger_and_print_hardware_state_transition

auto hardware_interface::trigger_and_print_hardware_state_transition
Initial value:
=
[](
auto transition, const std::string transition_name, const std::string & hardware_name,
const lifecycle_msgs::msg::State::_id_type & target_state)
{
RCUTILS_LOG_INFO_NAMED(
"resource_manager", "'%s' hardware '%s' ", transition_name.c_str(), hardware_name.c_str());
const rclcpp_lifecycle::State new_state = transition();
bool result = new_state.id() == target_state;
if (result)
{
RCUTILS_LOG_INFO_NAMED(
"resource_manager", "Successful '%s' of hardware '%s'", transition_name.c_str(),
hardware_name.c_str());
}
else
{
RCUTILS_LOG_INFO_NAMED(
"resource_manager", "Failed to '%s' hardware '%s'", transition_name.c_str(),
hardware_name.c_str());
}
return result;
}