@@ -437,7 +437,7 @@ hardware_interface::CallbackReturn DynamixelHardware::start()
437
437
RCLCPP_ERROR_STREAM (
438
438
logger_,
439
439
" Dynamixel Start Fail (Timeout: " << error_duration.seconds () * 1000 << " ms/" <<
440
- err_timeout_ms_ << " ms): " << Dynamixel::DxlErrorToString (dxl_comm_err_));
440
+ err_timeout_ms_ << " ms): " << Dynamixel::DxlErrorToString (dxl_comm_err_));
441
441
return hardware_interface::CallbackReturn::ERROR;
442
442
}
443
443
}
@@ -971,38 +971,38 @@ void DynamixelHardware::SetMatrix()
971
971
}
972
972
973
973
void DynamixelHardware::MapInterfaces (
974
- size_t outer_size,
975
- size_t inner_size,
976
- std::vector<HandlerVarType> &outer_handlers,
977
- const std::vector<HandlerVarType> &inner_handlers,
978
- double **matrix,
979
- const std::unordered_map<std::string, std::vector<std::string>> &iface_map,
980
- const std::string &conversion_iface,
981
- const std::string &conversion_name,
982
- std::function<double (double )> conversion)
974
+ size_t outer_size,
975
+ size_t inner_size,
976
+ std::vector<HandlerVarType> & outer_handlers,
977
+ const std::vector<HandlerVarType> & inner_handlers,
978
+ double **matrix,
979
+ const std::unordered_map<std::string, std::vector<std::string>> & iface_map,
980
+ const std::string & conversion_iface,
981
+ const std::string & conversion_name,
982
+ std::function<double (double )> conversion)
983
983
{
984
984
for (size_t i = 0 ; i < outer_size; ++i) {
985
985
for (size_t k = 0 ; k < outer_handlers.at (i).interface_name_vec .size (); ++k) {
986
986
double value = 0.0 ;
987
- const std::string &outer_iface = outer_handlers.at (i).interface_name_vec .at (k);
987
+ const std::string & outer_iface = outer_handlers.at (i).interface_name_vec .at (k);
988
988
auto map_it = iface_map.find (outer_iface);
989
989
if (map_it == iface_map.end ()) {
990
990
std::ostringstream oss;
991
991
oss << " No mapping found for '" << outer_handlers.at (i).name
992
992
<< " ', interface '" << outer_iface
993
993
<< " '. Skipping. Available mapping keys: [" ;
994
994
size_t key_count = 0 ;
995
- for (const auto &pair : iface_map) {
995
+ for (const auto & pair : iface_map) {
996
996
oss << pair.first ;
997
- if (++key_count < iface_map.size ()) oss << " , " ;
997
+ if (++key_count < iface_map.size ()) { oss << " , " ;}
998
998
}
999
999
oss << " ]" ;
1000
1000
RCLCPP_WARN_STREAM (logger_, oss.str ());
1001
1001
continue ;
1002
1002
}
1003
- const std::vector<std::string> &mapped_ifaces = map_it->second ;
1003
+ const std::vector<std::string> & mapped_ifaces = map_it->second ;
1004
1004
for (size_t j = 0 ; j < inner_size; ++j) {
1005
- for (const auto &mapped_iface : mapped_ifaces) {
1005
+ for (const auto & mapped_iface : mapped_ifaces) {
1006
1006
auto it = std::find (
1007
1007
inner_handlers.at (j).interface_name_vec .begin (),
1008
1008
inner_handlers.at (j).interface_name_vec .end (),
@@ -1015,9 +1015,10 @@ void DynamixelHardware::MapInterfaces(
1015
1015
}
1016
1016
}
1017
1017
if (!conversion_iface.empty () && !conversion_name.empty () &&
1018
- outer_iface == conversion_iface &&
1019
- outer_handlers.at (i).name == conversion_name &&
1020
- conversion) {
1018
+ outer_iface == conversion_iface &&
1019
+ outer_handlers.at (i).name == conversion_name &&
1020
+ conversion)
1021
+ {
1021
1022
value = conversion (value);
1022
1023
}
1023
1024
*outer_handlers.at (i).value_ptr_vec .at (k) = value;
@@ -1027,10 +1028,10 @@ void DynamixelHardware::MapInterfaces(
1027
1028
1028
1029
void DynamixelHardware::CalcTransmissionToJoint ()
1029
1030
{
1030
- std::function<double (double )> conv = use_revolute_to_prismatic_
1031
- ? std::function<double (double )>(
1032
- std::bind (&DynamixelHardware::revoluteToPrismatic, this , std::placeholders::_1))
1033
- : std::function<double (double )>();
1031
+ std::function<double (double )> conv = use_revolute_to_prismatic_ ?
1032
+ std::function<double (double )>(
1033
+ std::bind (&DynamixelHardware::revoluteToPrismatic, this , std::placeholders::_1)) :
1034
+ std::function<double (double )>();
1034
1035
this ->MapInterfaces (
1035
1036
num_of_joints_,
1036
1037
num_of_transmissions_,
@@ -1046,10 +1047,10 @@ void DynamixelHardware::CalcTransmissionToJoint()
1046
1047
1047
1048
void DynamixelHardware::CalcJointToTransmission ()
1048
1049
{
1049
- std::function<double (double )> conv = use_revolute_to_prismatic_
1050
- ? std::function<double (double )>(
1051
- std::bind (&DynamixelHardware::prismaticToRevolute, this , std::placeholders::_1))
1052
- : std::function<double (double )>();
1050
+ std::function<double (double )> conv = use_revolute_to_prismatic_ ?
1051
+ std::function<double (double )>(
1052
+ std::bind (&DynamixelHardware::prismaticToRevolute, this , std::placeholders::_1)) :
1053
+ std::function<double (double )>();
1053
1054
this ->MapInterfaces (
1054
1055
num_of_transmissions_,
1055
1056
num_of_joints_,
0 commit comments