justagist / panda_simulator

A Gazebo simulator for the Franka Emika Panda robot with ROS interface, supporting sim-to-real code transfer (Python). Exposes customisable controllers and state feedback from robot in simulation.
Apache License 2.0
188 stars 58 forks source link

Robot is moving in Gazebo when no controller is started #26

Closed smihael closed 3 years ago

smihael commented 3 years ago

I want to use this package for testing my own ros_control plugins before running them on the real robot.

As the custom panda_gazebo_ros_control_plugin does not seem to provide a working EffortJointInterface (#25), I modified the panda_world.launch file so that

<param name="robot_description" command="$(find xacro)/xacro --inorder $(find franka_panda_description)/robots/panda_arm_hand.urdf.xacro load_gripper:=$(arg load_gripper) load_gazebo:=$(arg load_gazebo)"/>

becomes

<param name="robot_description" command="$(find xacro)/xacro --inorder $(find franka_panda_description)/robots/panda_arm_hand.urdf.xacro load_gripper:=$(arg load_gripper) load_gazebo:=$(arg load_gazebo) use_gazebo_control:=true"/>

Now instead of the custom panda_gazebo_ros_control_plugin the default gazebo control is loaded. The EffortJointInterface now works as expected, after Gazebo gets initialized and before the controller is loaded robot moves weirdly. Wouldn't it be expected that the robot stays still before any controller is initialized?

justagist commented 3 years ago

See https://github.com/justagist/panda_simulator/issues/25#issuecomment-781983730 first.

The EffortJointInterface now works as expected, after Gazebo gets initialized and before the controller is loaded robot moves weirdly. Wouldn't it be expected that the robot stays still before any controller is initialized?

This could be because the simulator still depends heavily on franka_ros_interface which requires gazebo to use the custom PandaRobotHWSim hardware interface. By adding the flag use_gazebo_control:=true, this is disabled and may provide weird behaviour. You could instead use gazebo_panda which does not depend on franka_ros_interface at all, and uses the default gazebo hw interface. Also, I have noticed that sometimes in gazebo, starting some controllers when launching any robot simulation seems to cause weird motion in the beginning, but this does not happen when switching to this controller after the simulator is fully loaded.