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
203 stars 61 forks source link

Gazebo not launched following Docker Build instructions #55

Closed ascane closed 2 years ago

ascane commented 2 years ago

Hi,

I followed the docker instructions (noetic-devel) and everything seems to be successfully built. But when I ran roslaunch panda_gazebo panda_world.launch, I encountered an issue with gazebo:

[ INFO] [1633600245.792627116]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1633600245.793902469]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...
X Error of failed request:  BadAlloc (insufficient resources for operation)
  Major opcode of failed request:  149 ()
  Minor opcode of failed request:  2
  Serial number of failed request:  35
  Current serial number in output stream:  36
the rosdep view is empty: call 'sudo rosdep init' and 'rosdep update'

Gazebo was not launched.

Any help would be very much appreciated.

Full output below:

~/panda_sim_ws$ roslaunch panda_gazebo panda_world.launch
WARNING: cannot create log directory [/home/chiaman/.ros/log/09f6fabe-2754-11ec-a7d9-fc34974b282e]. Please set ROS_LOG_DIR to a writable location.
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
/usr/bin/du: cannot access '/home/chiaman/.ros/log': No such file or directory

xacro: in-order processing became default in ROS Melodic. You can drop the option.
started roslaunch server http://localhost:42551/

SUMMARY
========

PARAMETERS
 * /SIMULATOR_: True
 * /arm/gravity_tip_name: panda_hand
 * /arm/root_name: panda_link0
 * /arm/tip_name: panda_hand
 * /controllers_config/default_controller: panda_simulator/p...
 * /controllers_config/position_controller: panda_simulator/p...
 * /controllers_config/torque_controller: panda_simulator/e...
 * /controllers_config/velocity_controller: panda_simulator/v...
 * /franka_gripper/robot_ip: sim
 * /gazebo/enable_ros_network: True
 * /gripper_config/default_grasp_epsilon/inner: 0.005
 * /gripper_config/default_grasp_epsilon/outer: 0.005
 * /gripper_config/default_speed: 0.1
 * /gripper_config/joint_names: ['panda_finger_jo...
 * /panda_simulator/effort_joint_gravity_controller/joints/panda_joint1_controller/joint: panda_joint1
 * /panda_simulator/effort_joint_gravity_controller/joints/panda_joint2_controller/joint: panda_joint2
 * /panda_simulator/effort_joint_gravity_controller/joints/panda_joint3_controller/joint: panda_joint3
 * /panda_simulator/effort_joint_gravity_controller/joints/panda_joint4_controller/joint: panda_joint4
 * /panda_simulator/effort_joint_gravity_controller/joints/panda_joint5_controller/joint: panda_joint5
 * /panda_simulator/effort_joint_gravity_controller/joints/panda_joint6_controller/joint: panda_joint6
 * /panda_simulator/effort_joint_gravity_controller/joints/panda_joint7_controller/joint: panda_joint7
 * /panda_simulator/effort_joint_gravity_controller/type: panda_sim_control...
 * /panda_simulator/effort_joint_torque_controller/joints/panda_joint1_controller/joint: panda_joint1
 * /panda_simulator/effort_joint_torque_controller/joints/panda_joint2_controller/joint: panda_joint2
 * /panda_simulator/effort_joint_torque_controller/joints/panda_joint3_controller/joint: panda_joint3
 * /panda_simulator/effort_joint_torque_controller/joints/panda_joint4_controller/joint: panda_joint4
 * /panda_simulator/effort_joint_torque_controller/joints/panda_joint5_controller/joint: panda_joint5
 * /panda_simulator/effort_joint_torque_controller/joints/panda_joint6_controller/joint: panda_joint6
 * /panda_simulator/effort_joint_torque_controller/joints/panda_joint7_controller/joint: panda_joint7
 * /panda_simulator/effort_joint_torque_controller/topic: /panda_simulator/...
 * /panda_simulator/effort_joint_torque_controller/type: panda_sim_control...
 * /panda_simulator/joint_state_controller/publish_rate: 100
 * /panda_simulator/joint_state_controller/type: joint_state_contr...
 * /panda_simulator/panda_gripper_controller/joints/panda_finger_joint1_controller/joint: panda_finger_joint1
 * /panda_simulator/panda_gripper_controller/joints/panda_finger_joint1_controller/pid/d: 0.5
 * /panda_simulator/panda_gripper_controller/joints/panda_finger_joint1_controller/pid/i: 50
 * /panda_simulator/panda_gripper_controller/joints/panda_finger_joint1_controller/pid/p: 5000
 * /panda_simulator/panda_gripper_controller/joints/panda_finger_joint2_controller/joint: panda_finger_joint2
 * /panda_simulator/panda_gripper_controller/joints/panda_finger_joint2_controller/pid/d: 0.5
 * /panda_simulator/panda_gripper_controller/joints/panda_finger_joint2_controller/pid/i: 50
 * /panda_simulator/panda_gripper_controller/joints/panda_finger_joint2_controller/pid/p: 5000
 * /panda_simulator/panda_gripper_controller/pub_topic: /franka_gripper/j...
 * /panda_simulator/panda_gripper_controller/type: panda_sim_control...
 * /panda_simulator/position_joint_position_controller/joints/panda_joint1_controller/joint: panda_joint1
 * /panda_simulator/position_joint_position_controller/joints/panda_joint1_controller/pid/d: 25.0
 * /panda_simulator/position_joint_position_controller/joints/panda_joint1_controller/pid/i: 10.0
 * /panda_simulator/position_joint_position_controller/joints/panda_joint1_controller/pid/p: 3000
 * /panda_simulator/position_joint_position_controller/joints/panda_joint2_controller/joint: panda_joint2
 * /panda_simulator/position_joint_position_controller/joints/panda_joint2_controller/pid/d: 30.0
 * /panda_simulator/position_joint_position_controller/joints/panda_joint2_controller/pid/i: 10.0
 * /panda_simulator/position_joint_position_controller/joints/panda_joint2_controller/pid/p: 3000
 * /panda_simulator/position_joint_position_controller/joints/panda_joint3_controller/joint: panda_joint3
 * /panda_simulator/position_joint_position_controller/joints/panda_joint3_controller/pid/d: 30.0
 * /panda_simulator/position_joint_position_controller/joints/panda_joint3_controller/pid/i: 10.0
 * /panda_simulator/position_joint_position_controller/joints/panda_joint3_controller/pid/p: 3000
 * /panda_simulator/position_joint_position_controller/joints/panda_joint4_controller/joint: panda_joint4
 * /panda_simulator/position_joint_position_controller/joints/panda_joint4_controller/pid/d: 50.0
 * /panda_simulator/position_joint_position_controller/joints/panda_joint4_controller/pid/i: 10.0
 * /panda_simulator/position_joint_position_controller/joints/panda_joint4_controller/pid/p: 3000
 * /panda_simulator/position_joint_position_controller/joints/panda_joint5_controller/joint: panda_joint5
 * /panda_simulator/position_joint_position_controller/joints/panda_joint5_controller/pid/d: 8.0
 * /panda_simulator/position_joint_position_controller/joints/panda_joint5_controller/pid/i: 10.0
 * /panda_simulator/position_joint_position_controller/joints/panda_joint5_controller/pid/p: 3000
 * /panda_simulator/position_joint_position_controller/joints/panda_joint6_controller/joint: panda_joint6
 * /panda_simulator/position_joint_position_controller/joints/panda_joint6_controller/pid/d: 5.0
 * /panda_simulator/position_joint_position_controller/joints/panda_joint6_controller/pid/i: 1.0
 * /panda_simulator/position_joint_position_controller/joints/panda_joint6_controller/pid/p: 3000
 * /panda_simulator/position_joint_position_controller/joints/panda_joint7_controller/joint: panda_joint7
 * /panda_simulator/position_joint_position_controller/joints/panda_joint7_controller/pid/d: 4.0
 * /panda_simulator/position_joint_position_controller/joints/panda_joint7_controller/pid/i: 10.0
 * /panda_simulator/position_joint_position_controller/joints/panda_joint7_controller/pid/p: 3000
 * /panda_simulator/position_joint_position_controller/topic_joint_command: /panda_simulator/...
 * /panda_simulator/position_joint_position_controller/topic_set_speed_ratio: /panda_simulator/...
 * /panda_simulator/position_joint_position_controller/type: panda_sim_control...
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint1_controller/joint: panda_joint1
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint1_controller/pid/d: 0.1
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint1_controller/pid/i: 0.0
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint1_controller/pid/p: 10
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint2_controller/joint: panda_joint2
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint2_controller/pid/d: 0.1
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint2_controller/pid/i: 1.0
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint2_controller/pid/p: 100
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint3_controller/joint: panda_joint3
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint3_controller/pid/d: 0.01
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint3_controller/pid/i: 0.0
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint3_controller/pid/p: 0.05
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint4_controller/joint: panda_joint4
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint4_controller/pid/d: 0.1
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint4_controller/pid/i: 0.01
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint4_controller/pid/p: 0.5
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint5_controller/joint: panda_joint5
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint5_controller/pid/d: 0.01
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint5_controller/pid/i: 0.0
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint5_controller/pid/p: 1.0
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint6_controller/joint: panda_joint6
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint6_controller/pid/d: 0.01
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint6_controller/pid/i: 0.0
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint6_controller/pid/p: 0.05
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint7_controller/joint: panda_joint7
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint7_controller/pid/d: 0.01
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint7_controller/pid/i: 0.0
 * /panda_simulator/velocity_joint_velocity_controller/joints/panda_joint7_controller/pid/p: 0.05
 * /panda_simulator/velocity_joint_velocity_controller/topic: /panda_simulator/...
 * /panda_simulator/velocity_joint_velocity_controller/type: panda_sim_control...
 * /robot_config/arm_id: panda
 * /robot_config/joint_config/joint_acceleration_limit/panda_joint1: 15.0
 * /robot_config/joint_config/joint_acceleration_limit/panda_joint2: 7.5
 * /robot_config/joint_config/joint_acceleration_limit/panda_joint3: 10.0
 * /robot_config/joint_config/joint_acceleration_limit/panda_joint4: 12.5
 * /robot_config/joint_config/joint_acceleration_limit/panda_joint5: 15.0
 * /robot_config/joint_config/joint_acceleration_limit/panda_joint6: 20.0
 * /robot_config/joint_config/joint_acceleration_limit/panda_joint7: 20.0
 * /robot_config/joint_config/joint_effort_limit/panda_joint1: 87
 * /robot_config/joint_config/joint_effort_limit/panda_joint2: 87
 * /robot_config/joint_config/joint_effort_limit/panda_joint3: 87
 * /robot_config/joint_config/joint_effort_limit/panda_joint4: 87
 * /robot_config/joint_config/joint_effort_limit/panda_joint5: 12
 * /robot_config/joint_config/joint_effort_limit/panda_joint6: 12
 * /robot_config/joint_config/joint_effort_limit/panda_joint7: 12
 * /robot_config/joint_config/joint_position_limit/lower/panda_joint1: -2.8973
 * /robot_config/joint_config/joint_position_limit/lower/panda_joint2: -1.7628
 * /robot_config/joint_config/joint_position_limit/lower/panda_joint3: -2.8973
 * /robot_config/joint_config/joint_position_limit/lower/panda_joint4: -3.0718
 * /robot_config/joint_config/joint_position_limit/lower/panda_joint5: -2.8973
 * /robot_config/joint_config/joint_position_limit/lower/panda_joint6: -0.0175
 * /robot_config/joint_config/joint_position_limit/lower/panda_joint7: -2.8973
 * /robot_config/joint_config/joint_position_limit/upper/panda_joint1: 2.8973
 * /robot_config/joint_config/joint_position_limit/upper/panda_joint2: 1.7628
 * /robot_config/joint_config/joint_position_limit/upper/panda_joint3: 2.8973
 * /robot_config/joint_config/joint_position_limit/upper/panda_joint4: -0.0698
 * /robot_config/joint_config/joint_position_limit/upper/panda_joint5: 2.8973
 * /robot_config/joint_config/joint_position_limit/upper/panda_joint6: 3.7525
 * /robot_config/joint_config/joint_position_limit/upper/panda_joint7: 2.8973
 * /robot_config/joint_config/joint_velocity_limit/panda_joint1: 2.175
 * /robot_config/joint_config/joint_velocity_limit/panda_joint2: 2.175
 * /robot_config/joint_config/joint_velocity_limit/panda_joint3: 2.175
 * /robot_config/joint_config/joint_velocity_limit/panda_joint4: 2.175
 * /robot_config/joint_config/joint_velocity_limit/panda_joint5: 2.61
 * /robot_config/joint_config/joint_velocity_limit/panda_joint6: 2.61
 * /robot_config/joint_config/joint_velocity_limit/panda_joint7: 2.61
 * /robot_config/joint_names: ['panda_joint1', ...
 * /robot_config/neutral_pose/panda_joint1: -0.01779206022777...
 * /robot_config/neutral_pose/panda_joint2: -0.7601235411041661
 * /robot_config/neutral_pose/panda_joint3: 0.019782607023391807
 * /robot_config/neutral_pose/panda_joint4: -2.342050140544315
 * /robot_config/neutral_pose/panda_joint5: 0.029840531355804868
 * /robot_config/neutral_pose/panda_joint6: 1.5411935298621688
 * /robot_config/neutral_pose/panda_joint7: 0.7534486589746342
 * /robot_description: <?xml version="1....
 * /rosdistro: noetic
 * /rosversion: 1.15.13
 * /use_sim_time: True

NODES
  /
    base_to_link0 (tf/static_transform_publisher)
    controller_spawner (controller_manager/controller_manager)
    controller_spawner_stopped (controller_manager/controller_manager)
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    gripper_action_server_emulator (panda_sim_custom_action_server/start_gripper_action_server.py)
    joint_trajectory_server_emulator (panda_sim_custom_action_server/start_joint_trajectory_server.py)
    panda_gripper_controller_spawner_stopped (controller_manager/controller_manager)
    robot_description (gazebo_ros/spawn_model)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    startup_script (panda_gazebo/force_neutral_pose.py)
    topic_remap (topic_tools/relay)
    world_to_base (tf/static_transform_publisher)

auto-starting new master
process[master]: started with pid [14215]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 09f6fabe-2754-11ec-a7d9-fc34974b282e
process[rosout-1]: started with pid [14240]
started core service [/rosout]
process[gazebo-2]: started with pid [14247]
process[gazebo_gui-3]: started with pid [14251]
process[robot_description-4]: started with pid [14256]
process[base_to_link0-5]: started with pid [14258]
process[world_to_base-6]: started with pid [14259]
process[controller_spawner-7]: started with pid [14260]
process[controller_spawner_stopped-8]: started with pid [14262]
process[panda_gripper_controller_spawner_stopped-9]: started with pid [14267]
process[robot_state_publisher-10]: started with pid [14271]
process[topic_remap-11]: started with pid [14274]
process[joint_trajectory_server_emulator-12]: started with pid [14275]
process[gripper_action_server_emulator-13]: started with pid [14277]
process[startup_script-14]: started with pid [14285]
INFO: cannot create a symlink to latest log directory: [Errno 2] No such file or directory: '/home/chiaman/.ros/log/latest'
/usr/local/lib/python3.8/dist-packages/quaternion/numba_wrapper.py:21: UserWarning: 

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Could not import from numba, which means that some
parts of this code may run MUCH more slowly.  You
may wish to install numba.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  warnings.warn(warning_text)
/usr/local/lib/python3.8/dist-packages/quaternion/calculus.py:475: UserWarning: 

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Could not import from scipy, which means that derivatives
and integrals will use less accurate finite-differencing
techniques.  You may want to install scipy.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  warnings.warn(warning_text)
the rosdep view is empty: call 'sudo rosdep init' and 'rosdep update'
/usr/local/lib/python3.8/dist-packages/quaternion/numba_wrapper.py:21: UserWarning: 

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Could not import from numba, which means that some
parts of this code may run MUCH more slowly.  You
may wish to install numba.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  warnings.warn(warning_text)
/usr/local/lib/python3.8/dist-packages/quaternion/calculus.py:475: UserWarning: 

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Could not import from scipy, which means that derivatives
and integrals will use less accurate finite-differencing
techniques.  You may want to install scipy.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  warnings.warn(warning_text)
[ INFO] [1633600245.711973378]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1633600245.713547151]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
X Error of failed request:  BadAlloc (insufficient resources for operation)
  Major opcode of failed request:  149 ()
  Minor opcode of failed request:  2
  Serial number of failed request:  35
  Current serial number in output stream:  36
[ INFO] [1633600245.792627116]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1633600245.793902469]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting...
X Error of failed request:  BadAlloc (insufficient resources for operation)
  Major opcode of failed request:  149 ()
  Minor opcode of failed request:  2
  Serial number of failed request:  35
  Current serial number in output stream:  36
the rosdep view is empty: call 'sudo rosdep init' and 'rosdep update'
justagist commented 2 years ago

Hi, this looks like an issue with the x server within the docker. You can confirm this by trying to load any gazebo simulation in the docker container (e.g. roslaunch gazebo_ros empty_world.launch). If this fails as well, then I can't provide support for this issue unfortunately because it is very hardware-specific and would depend on the display drivers etc. that you have. This is a known issue when you have display drivers that are incompatible in the docker or if you don't have nvidia gpu. Sorry for not being very helpful.

ascane commented 2 years ago

Thanks for your quick support! After rounds of trial and error, removing the --privileged flag solved my problem.

justagist commented 2 years ago

That's good to know! Thanks for letting me know the solution; I will look into it.