Skip to content

Commit

Permalink
Rename it to stod (like in std namespace)
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Jan 3, 2024
1 parent f64dd7b commit ef44677
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace hardware_interface
* from
https://github.com/ros-planning/srdfdom/blob/ad17b8d25812f752c397a6011cec64aeff090c46/src/model.cpp#L53
*/
double toDouble(const std::string & s)
double stod(const std::string & s)
{
// convert from string using no locale
std::istringstream stream(s);
Expand Down
6 changes: 3 additions & 3 deletions hardware_interface/src/mock_components/generic_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ CallbackReturn GenericSystem::on_init(const hardware_interface::HardwareInfo & i
it = info_.hardware_parameters.find("position_state_following_offset");
if (it != info_.hardware_parameters.end())
{
position_state_following_offset_ = hardware_interface::toDouble(it->second);
position_state_following_offset_ = hardware_interface::stod(it->second);
it = info_.hardware_parameters.find("custom_interface_with_following_offset");
if (it != info_.hardware_parameters.end())
{
Expand Down Expand Up @@ -159,7 +159,7 @@ CallbackReturn GenericSystem::on_init(const hardware_interface::HardwareInfo & i
auto param_it = joint.parameters.find("multiplier");
if (param_it != joint.parameters.end())
{
mimic_joint.multiplier = hardware_interface::toDouble(joint.parameters.at("multiplier"));
mimic_joint.multiplier = hardware_interface::stod(joint.parameters.at("multiplier"));
}
mimic_joints_.push_back(mimic_joint);
}
Expand Down Expand Up @@ -686,7 +686,7 @@ void GenericSystem::initialize_storage_vectors(
// Check the initial_value param is used
if (!interface.initial_value.empty())
{
states[index][i] = hardware_interface::toDouble(interface.initial_value);
states[index][i] = hardware_interface::stod(interface.initial_value);
}
}
}
Expand Down

0 comments on commit ef44677

Please sign in to comment.