Go to the documentation of this file.
45 handle_data.
name = transmission_info.
name_;
52 if (!act_state_data_ok) {
return false;}
57 if (!act_cmd_data_ok) {
return false;}
67 if (!jnt_data_ok) {
return false;}
73 if (!jnt_state_data_ok) {
return false;}
78 if (!jnt_cmd_data_ok) {
return false;}
91 : robot_hw_ptr_(robot_hw),
92 robot_transmissions_ptr_(robot_transmissions)
96 "transmission_interface::TransmissionLoader"));
100 "transmission_interface::RequisiteProvider"));
103 if (!robot_hw) {
throw std::invalid_argument(
"Invalid robot hardware pointer.");}
104 if (!robot_transmissions) {
throw std::invalid_argument(
"Invalid robot transmissions pointer.");}
113 std::vector<TransmissionInfo> infos;
114 if (!parser.
parse(urdf, infos)) {
return false;}
127 for (
const auto& info : transmission_info_vec)
129 if (!
load(info)) {
return false;}
141 transmission = transmission_loader->load(transmission_info);
142 if (!transmission) {
return false;}
147 "'. Unsupported type '" << transmission_info.
type_ <<
"'.\n" << ex.what());
152 assert(!transmission_info.
joints_.empty() && !transmission_info.
joints_.front().hardware_interfaces_.empty());
153 const std::vector<std::string>& hw_ifaces_ref = transmission_info.
joints_.front().hardware_interfaces_;
154 for (
const auto& jnt_info : transmission_info.
joints_)
157 if (hw_ifaces_ref.size() != jnt_info.hardware_interfaces_.size() ||
158 !std::is_permutation(hw_ifaces_ref.begin(), hw_ifaces_ref.end(),
159 jnt_info.hardware_interfaces_.begin()))
162 "Failed to load transmission '" << transmission_info.
name_ <<
163 "'. It has joints with different hardware interfaces. This is currently unsupported.");
169 bool has_at_least_one_hw_iface =
false;
170 for (
const auto& hw_iface : hw_ifaces_ref)
176 if (!req_provider) {
continue;}
181 "' hardware interface for transmission '" << transmission_info.
name_ <<
182 "'.\n" << ex.what());
186 const bool load_ok = req_provider->loadTransmissionMaps(transmission_info,
loader_data_, transmission);
187 if (load_ok) {has_at_least_one_hw_iface =
true;}
191 if (!has_at_least_one_hw_iface)
194 "'. It contains no valid hardware interfaces.");
static bool parse(const std::string &urdf_string, std::vector< TransmissionInfo > &transmissions)
Parses the transmission elements of a URDF.
virtual bool updateJointInterfaces(const TransmissionInfo &transmission_info, hardware_interface::RobotHW *robot_hw, JointInterfaces &joint_interfaces, RawJointDataMap &raw_joint_data_map)=0
Update a robot's joint interfaces with joint information contained in a transmission.
std::shared_ptr< Transmission > TransmissionSharedPtr
virtual bool getActuatorStateData(const TransmissionInfo &transmission_info, hardware_interface::RobotHW *robot_hw, ActuatorData &act_state_data)=0
RequisiteProviderClassLoaderPtr req_provider_loader_
TransmissionLoaderData loader_data_
Parse all transmissions specified in a URDF.
RobotTransmissions * robot_transmissions
Lifecycle is externally controlled (ie. hardware abstraction)
std::vector< JointInfo > joints_
pluginlib::ClassLoader< RequisiteProvider > RequisiteProviderClassLoader
hardware_interface::RobotHW * robot_hw_ptr_
virtual bool getJointStateData(const TransmissionInfo &transmission_info, const RawJointDataMap &raw_joint_data_map, JointData &jnt_state_data)=0
pluginlib::ClassLoader< TransmissionLoader > TransmissionClassLoader
RobotTransmissions * robot_transmissions_ptr_
#define ROS_ERROR_STREAM_NAMED(name, args)
Robot transmissions interface.
bool loadTransmissionMaps(const TransmissionInfo &transmission_info, TransmissionLoaderData &loader_data, TransmissionSharedPtr transmission)
bool load(const std::string &urdf)
Load all transmissions in a URDF.
RawJointDataMap raw_joint_data_map
TransmissionClassLoaderPtr transmission_class_loader_
JointInterfaces joint_interfaces
#define ROS_WARN_STREAM_NAMED(name, args)
virtual bool getJointCommandData(const TransmissionInfo &transmission_info, const RawJointDataMap &raw_joint_data_map, JointData &jnt_cmd_data)=0
ActuatorData act_state_data
TransmissionSharedPtr transmission
ActuatorData act_cmd_data
std::shared_ptr< RequisiteProvider > RequisiteProviderPtr
hardware_interface::RobotHW * robot_hw
Lifecycle is externally controlled (ie. hardware abstraction)
std::vector< TransmissionSharedPtr > transmission_data
Contains semantic info about a given transmission loaded from XML (URDF)
std::shared_ptr< TransmissionLoader > TransmissionLoaderSharedPtr
TransmissionInterfaceLoader(hardware_interface::RobotHW *robot_hw, RobotTransmissions *robot_transmissions)
virtual bool registerTransmission(TransmissionLoaderData &loader_data, TransmissionHandleData &handle_data)=0
virtual bool getActuatorCommandData(const TransmissionInfo &transmission_info, hardware_interface::RobotHW *robot_hw, ActuatorData &act_cmd_data)=0