Skip to content

Commit 24321ee

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 86f2254 commit 24321ee

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Requires `libfranka` >= 0.8.0
1414
* `franka_description`: `<xacro:franka_robot/>` macro now supports to customize the `parent` frame and its `xyz` + `rpy` offset
1515
* `franka_hw`: Fix the bug where the previous controller is still running after switching the controller. ([#326](https://github.com/frankaemika/franka_ros/issues/326))
1616
* `franka_gazebo`: Add `set_franka_model_configuration` service.
17+
* `franka_gazebo`: remove FrankaHWSim robot namespace warning
1718

1819
## 0.10.1 - 2022-09-15
1920

franka_gazebo/src/franka_hw_sim.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ 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+
// Try to get the arm_id from the robot_namespace otherwise use the model name.
39+
if (!model_nh.hasParam("arm_id")) {
40+
ROS_WARN_STREAM_NAMED("franka_hw_sim", "No 'arm_id' found on '" << model_nh.getNamespace()
41+
<< "' parameter namespace."
42+
<< " Using model name instead ("
43+
<< parent->GetName() << ").");
4544
}
45+
model_nh.param<std::string>("arm_id", this->arm_id_, parent->GetName());
4646

4747
this->robot_ = parent;
4848
this->robot_initialized_ = false;

0 commit comments

Comments
 (0)