Skip to content

Commit 1d62e7a

Browse files
committed
refactor(franka_gazebo): remove FrankaHWSim robot namespace warning
This commit removes the robot namespace warning found in the FrankaHWSim since it is no longer needed now that #196 has been merged. It also replaced the 'arm_id' default with the model name.
1 parent d439fc7 commit 1d62e7a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

franka_gazebo/src/franka_hw_sim.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,12 @@ bool FrankaHWSim::initSim(const std::string& robot_namespace,
3535
gazebo::physics::ModelPtr parent,
3636
const urdf::Model* const urdf,
3737
std::vector<transmission_interface::TransmissionInfo> transmissions) {
38-
model_nh.param<std::string>("arm_id", this->arm_id_, robot_namespace);
39-
if (this->arm_id_ != robot_namespace) {
40-
ROS_WARN_STREAM_NAMED(
41-
"franka_hw_sim",
42-
"Caution: Robot names differ! Read 'arm_id: "
43-
<< this->arm_id_ << "' from parameter server but URDF defines '<robotNamespace>"
44-
<< robot_namespace << "</robotNamespace>'. Will use '" << this->arm_id_ << "'!");
38+
39+
// Try to get the arm_id from the robot_namespace otherwise use the model name.
40+
if (!model_nh.hasParam("arm_id")){
41+
ROS_WARN_STREAM_NAMED("franka_hw_sim", "No 'arm_id' found on '" << model_nh.getNamespace() << "' parameter namespace." << " Using model name instead (" << parent->GetName() << ").");
4542
}
43+
model_nh.param<std::string>("arm_id", this->arm_id_, parent->GetName());
4644

4745
this->robot_ = parent;
4846
this->robot_initialized_ = false;

0 commit comments

Comments
 (0)