From 0e8a5fb9c24cd2bc5ac35fbeb0de5d36a3eb9917 Mon Sep 17 00:00:00 2001 From: rickstaa Date: Fri, 1 Sep 2023 14:14:46 +0200 Subject: [PATCH] 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`. --- franka_gazebo/src/franka_hw_sim.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/franka_gazebo/src/franka_hw_sim.cpp b/franka_gazebo/src/franka_hw_sim.cpp index fb80907b..62a53934 100644 --- a/franka_gazebo/src/franka_hw_sim.cpp +++ b/franka_gazebo/src/franka_hw_sim.cpp @@ -82,6 +82,17 @@ bool FrankaHWSim::initSim(const std::string& robot_namespace, ROS_INFO_STREAM_NAMED("franka_hw_sim", "Using physics type " << physics->GetType()); + // Print information about the used physics engine + std::vector supported_engines{"ode", "dart"}; + std::string physics_engine = physics->GetType(); + ROS_INFO_STREAM_NAMED("franka_hw_sim", "Using physics type " << physics->GetType()); + if (std::find(supported_engines.begin(), supported_engines.end(), physics_engine) == + supported_engines.end()) { + ROS_ERROR_STREAM_NAMED("franka_hw_sim", + "The Panda Gazebo model does not yet officially support the '" + + physics_engine + "' physics engine."); + } + // Retrieve initial gravity vector from Gazebo // NOTE: Can be overwritten by the user via the 'gravity_vector' ROS parameter. auto gravity = physics->World()->Gravity();