Skip to content

Commit 0e8a5fb

Browse files
committed
feat(franka_gazebo): add incompatibly physics engine warning
This commit ensures a warning is thrown when the user specifies the 'bullet' and 'simbody' physics engines since these are not yet supported with `franka_gazebo`.
1 parent 52f4e48 commit 0e8a5fb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

franka_gazebo/src/franka_hw_sim.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,17 @@ bool FrankaHWSim::initSim(const std::string& robot_namespace,
8282

8383
ROS_INFO_STREAM_NAMED("franka_hw_sim", "Using physics type " << physics->GetType());
8484

85+
// Print information about the used physics engine
86+
std::vector<std::string> supported_engines{"ode", "dart"};
87+
std::string physics_engine = physics->GetType();
88+
ROS_INFO_STREAM_NAMED("franka_hw_sim", "Using physics type " << physics->GetType());
89+
if (std::find(supported_engines.begin(), supported_engines.end(), physics_engine) ==
90+
supported_engines.end()) {
91+
ROS_ERROR_STREAM_NAMED("franka_hw_sim",
92+
"The Panda Gazebo model does not yet officially support the '" +
93+
physics_engine + "' physics engine.");
94+
}
95+
8596
// Retrieve initial gravity vector from Gazebo
8697
// NOTE: Can be overwritten by the user via the 'gravity_vector' ROS parameter.
8798
auto gravity = physics->World()->Gravity();

0 commit comments

Comments
 (0)