Skip to content

Commit f7144c5

Browse files
committed
feat(franka_gazebo): add incompatibly physics engine warning
1 parent 78049ae commit f7144c5

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
@@ -40,7 +40,16 @@ bool FrankaHWSim::initSim(const std::string& robot_namespace,
4040
gazebo::physics::PhysicsEnginePtr physics = gazebo::physics::get_world()->GetPhysicsEngine();
4141
#endif
4242

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

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

0 commit comments

Comments
 (0)