utecrobotics / ur5

UR5 Robot with a Robotiq gripper
120 stars 35 forks source link

Failed to load controllers while launch gazebo #4

Closed hychiang-git closed 5 years ago

hychiang-git commented 5 years ago

I have no problem with roslaunch ur5_description display_with_gripper.launch image

However, while I was trying to launch gazebo by the command roslaunch ur5_gazebo ur5_cubes.launch, it shows that fail to load following three controllers.

Here are the error messages:

$ roslaunch ur5_gazebo ur5_cubes.launch

... logging to /home/hychiang/.ros/log/5b1b5c0e-325c-11e9-b81a-ac220b8958ba/roslaunch-hychiang-lab-27077.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://hychiang-lab:38623/

SUMMARY
========

PARAMETERS
 * /gripper_controller/action_monitor_rate: 20
 * /gripper_controller/goal_tolerance: 0.002
 * /gripper_controller/joint: robotiq_85_left_k...
 * /gripper_controller/max_effort: 100
 * /gripper_controller/stall_timeout: 1.0
 * /gripper_controller/stall_velocity_threshold: 0.001
 * /gripper_controller/type: position_controll...
 * /joint_state_controller/publish_rate: 125
 * /joint_state_controller/type: joint_state_contr...
 * /robot_description: <?xml version="1....
 * /rosdistro: kinetic
 * /rosversion: 1.12.14
 * /state_publisher/publish_frequency: 50.0
 * /trajectory_controller/action_monitor_rate: 10
 * /trajectory_controller/constraints/elbow_joint/goal: 0.1
 * /trajectory_controller/constraints/elbow_joint/trajectory: 0.1
 * /trajectory_controller/constraints/goal_time: 0.6
 * /trajectory_controller/constraints/shoulder_lift_joint/goal: 0.1
 * /trajectory_controller/constraints/shoulder_lift_joint/trajectory: 0.1
 * /trajectory_controller/constraints/shoulder_pan_joint/goal: 0.1
 * /trajectory_controller/constraints/shoulder_pan_joint/trajectory: 0.1
 * /trajectory_controller/constraints/stopped_velocity_tolerance: 0.05
 * /trajectory_controller/constraints/wrist_1_joint/goal: 0.1
 * /trajectory_controller/constraints/wrist_1_joint/trajectory: 0.1
 * /trajectory_controller/constraints/wrist_2_joint/goal: 0.1
 * /trajectory_controller/constraints/wrist_2_joint/trajectory: 0.1
 * /trajectory_controller/constraints/wrist_3_joint/goal: 0.1
 * /trajectory_controller/constraints/wrist_3_joint/trajectory: 0.1
 * /trajectory_controller/joints: ['shoulder_pan_jo...
 * /trajectory_controller/state_publish_rate: 25
 * /trajectory_controller/stop_trajectory_duration: 0.5
 * /trajectory_controller/type: position_controll...
 * /use_sim_time: True

NODES
  /
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    robot_controllers (controller_manager/spawner)
    spawn_gazebo_model (gazebo_ros/spawn_model)
    state_publisher (robot_state_publisher/state_publisher)

ROS_MASTER_URI=http://localhost:11311

process[gazebo-1]: started with pid [27097]
process[gazebo_gui-2]: started with pid [27102]
process[spawn_gazebo_model-3]: started with pid [27107]
process[robot_controllers-4]: started with pid [27108]
process[state_publisher-5]: started with pid [27109]
[ INFO] [1550377160.327240339]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1550377160.377302091]: Physics dynamic reconfigure ready.
[gazebo-1] process has died [pid 27097, exit code 255, cmd /opt/ros/kinetic/lib/gazebo_ros/gzserver -u -e ode /home/hychiang/ur5_grip/src/ur5/ur5_gazebo/worlds/ur5_cubes.world __name:=gazebo __log:=/home/hychiang/.ros/log/5b1b5c0e-325c-11e9-b81a-ac220b8958ba/gazebo-1.log].
log file: /home/hychiang/.ros/log/5b1b5c0e-325c-11e9-b81a-ac220b8958ba/gazebo-1*.log
SpawnModel script started
[INFO] [1550377160.697907, 0.000000]: Loading model XML from ros parameter
[INFO] [1550377160.701012, 0.000000]: Waiting for service /gazebo/spawn_urdf_model
[INFO] [1550377160.702202, 0.000000]: Calling service /gazebo/spawn_urdf_model
Service call failed: service [/gazebo/spawn_urdf_model] responded with an error: 
[INFO] [1550377160.723182, 6359.997000]: Waiting for service /gazebo/set_model_configuration
[INFO] [1550377160.724629, 6359.998000]: temporary hack to **fix** the -J joint position option (issue #93), sleeping for 1 second to avoid race condition.
[ERROR] [1550377161.321914, 6360.594000]: Failed to load joint_state_controller
[INFO] [1550377161.725531, 6360.998000]: Calling service /gazebo/set_model_configuration
[INFO] [1550377161.727674, 6361.001000]: Set model configuration status: SetModelConfiguration: success
[spawn_gazebo_model-3] process has finished cleanly
log file: /home/hychiang/.ros/log/5b1b5c0e-325c-11e9-b81a-ac220b8958ba/spawn_gazebo_model-3*.log
[ERROR] [1550377162.363078, 6361.636000]: Failed to load gripper_controller
[ERROR] [1550377162.365434, 6361.638000]: Failed to start controllers: trajectory_controller
[gazebo_gui-2] process has finished cleanly

I also parsed some related issues online. https://github.com/qboticslabs/mastering_ros/issues/10 https://answers.ros.org/question/254084/gazebo-could-not-load-controller-jointtrajectorycontroller-does-not-exist-mastering-ros-chapter-10/

I check all the dependencies and they were all installed.

$ sudo apt-get install ros-kinetic-joint*controller*
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'ros-kinetic-joint-state-controller' for glob 'ros-kinetic-joint*controller*'
Note, selecting 'ros-kinetic-joint-trajectory-controller' for glob 'ros-kinetic-joint*controller*'
Note, selecting 'ros-kinetic-joint-qualification-controllers' for glob 'ros-kinetic-joint*controller*'
ros-kinetic-joint-qualification-controllers is already the newest version (1.0.12-0xenial-20190131-132250-0800).
ros-kinetic-joint-state-controller is already the newest version (0.13.4-0xenial-20181107-012434-0800).
ros-kinetic-joint-trajectory-controller is already the newest version (0.13.4-0xenial-20190131-131202-0800).
0 upgraded, 0 newly installed, 0 to remove and 32 not upgraded.

$ sudo apt-get install ros-kinetic-joint-state-controller
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ros-kinetic-joint-state-controller is already the newest version (0.13.4-0xenial-20181107-012434-0800).
0 upgraded, 0 newly installed, 0 to remove and 32 not upgraded.

$ rospack find joint_state_controller
/opt/ros/kinetic/share/joint_state_controller
$ ls -al /opt/ros/kinetic/lib/libjoint_state_controller.so
-rw-r--r-- 1 root root 134672 十一  7 17:30 /opt/ros/kinetic/lib/libjoint_state_controller.so

Does anyone have clues about this?

Thanks

hychiang-git commented 5 years ago

hmmm....problem seems fixed as I restart my computer and add additional model to ~/.gazebo.

Download more Gazebo model

https://blog.csdn.net/qq_37427972/article/details/82853655

$ cd ~/.gazebo/
$ mkdir -p models
$ cd ~/.gazebo/models/
$ wget http://file.ncnynl.com/ros/gazebo_models.txt
$ wget -i gazebo_models.txt
$ ls model.tar.g* | xargs -n1 tar xzvf