Skip to content

Commit d58e014

Browse files
committed
feat(franka_gazebo): add incompatibly physics engine warning
1 parent d09d0e4 commit d58e014

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

franka_gazebo/src/franka_hw_sim.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,16 @@ bool FrankaHWSim::initSim(const std::string& robot_namespace,
3939
gazebo::physics::PhysicsEnginePtr physics = gazebo::physics::get_world()->GetPhysicsEngine();
4040
#endif
4141

42+
// Print information about the used physics engine
43+
std::vector<std::string> supported_engines{"ode", "dart"};
44+
std::string physics_engine = physics->GetType();
4245
ROS_INFO_STREAM_NAMED("franka_hw_sim", "Using physics type " << physics->GetType());
46+
if (std::find(supported_engines.begin(), supported_engines.end(), physics_engine) ==
47+
supported_engines.end()) {
48+
ROS_ERROR_STREAM_NAMED("franka_hw_sim",
49+
"The Panda Gazebo model does not yet officially support the '" +
50+
physics_engine + "' physics engine.");
51+
}
4352

4453
// Retrieve initial gravity vector from Gazebo
4554
// NOTE: Can be overwritten by the user via the 'gravity_vector' ROS parameter.

0 commit comments

Comments
 (0)