Skip to content

Commit

Permalink
refactor(franka_gazebo): remove FrankaHWSim robot namespace warning
Browse files Browse the repository at this point in the history
This commit removes the robot namespace warning found in the FrankaHWSim
since it is no longer needed now that frankaemika#196 has been merged. It also
replaced the 'arm_id' default with the model name.
  • Loading branch information
rickstaa committed Sep 3, 2023
1 parent d439fc7 commit ef6b24f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions franka_gazebo/src/franka_hw_sim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ bool FrankaHWSim::initSim(const std::string& robot_namespace,
gazebo::physics::ModelPtr parent,
const urdf::Model* const urdf,
std::vector<transmission_interface::TransmissionInfo> transmissions) {
model_nh.param<std::string>("arm_id", this->arm_id_, robot_namespace);
if (this->arm_id_ != robot_namespace) {
ROS_WARN_STREAM_NAMED(
"franka_hw_sim",
"Caution: Robot names differ! Read 'arm_id: "
<< this->arm_id_ << "' from parameter server but URDF defines '<robotNamespace>"
<< robot_namespace << "</robotNamespace>'. Will use '" << this->arm_id_ << "'!");
// Try to get the arm_id from the robot_namespace otherwise use the model name.
if (!model_nh.hasParam("arm_id")) {
ROS_WARN_STREAM_NAMED("franka_hw_sim", "No 'arm_id' found on '" << model_nh.getNamespace()
<< "' parameter namespace."
<< " Using model name instead ("
<< parent->GetName() << ").");
}
model_nh.param<std::string>("arm_id", this->arm_id_, parent->GetName());

this->robot_ = parent;
this->robot_initialized_ = false;
Expand Down

0 comments on commit ef6b24f

Please sign in to comment.