Hi everyone. I have a problem and I hope you can help me. :)
I have a robot: Two Schunk lwa4d arms mounted on a box.
I can load this robot in gazebo.
I can load this robot in moveit + rviz and plan path for it.
But the problem is making connection between these two. So far, I am unable of doing so. I know that in both sides, gazebo and moveit, i need to have some modifications. But my major suspicion is a warning message that I receive when launching my robot in gazebo, where it warns:
> [WARN] [WallTime: 1438070984.731293] [4.961000] Controller Spawner couldn't find the expected controller_manager ROS interface.>> [WARN] [WallTime: 1438070984.740924] [4.954000] Controller Spawner couldn't find the expected controller_manager ROS interface.
I know it has something to do with controller_manager.
In my launch file, I have:
What I know for now is that each warning is related to one control spawning.
My file, joint_state_controller.yaml is very small:
joint_state_controller:
type: joint_state_controller/JointStateController
publish_rate: 50
ROS is able to locate it. So the problem shouldn't be finding the file. But in spawning it using controller spawner, something is going wrong.
I tried to copy-paste the other file, TwoArm_arm_controller_v2.yaml, here too. But I couldn't format it in a good way to be easily readable. But the basic structure is something like:
## joint_names
joint_names: [arm1_1_joint, arm1_2_joint, arm1_3_joint, arm1_4_joint, arm1_5_joint, arm1_6_joint, arm1_7_joint, arm2_1_joint, arm2_2_joint, arm2_3_joint, arm2_4_joint, arm2_5_joint, arm2_6_joint, arm2_7_joint]
## joint trajectory controller
arm_controller:
type: position_controllers/JointTrajectoryController
joints:
- arm1_1_joint
...
- arm1_7_joint
- arm2_1_joint
...
- arm2_7_joint
constraints:
goal_time: 0.6
stopped_velocity_tolerance: 0.05
arm1_1_joint: {trajectory: 0.1, goal: 0.1}
...
arm2_7_joint: {trajectory: 0.1, goal: 0.1}
stop_trajectory_duration: 0.5
state_publish_rate: 25
action_monitor_rate: 10
What I could find by now is that there may be two reasons for this warning:
- controller manager not running.
- not launching the spawned script in the same namespace as the controller manager.
But honestly, I don't know how to move forward from this point. I know that controller_manager has been installed:
> ros@ros:~/Documents/Damon_CPP/ROS_Workspace/devel$ rospack find controller_manager> /opt/ros/indigo/share/controller_manager
Unfortunately I don't know how to remove the warnings. I have the feeling that if Moveit can't communicate with gazebo, this warning can be a reason.
Any help is highly appreciated. :)
UPDATE:
After launching my robot in gazebo, I tried this command:
> ros@ros:~$ rosrun controller_manager controller_manager list
Nothing appears. The terminal goes frozen. I asked the same thing from my friend whose robot (2 U10 arms on a box) is loaded and controlled properly by moveit. Here is his result:
> merosy@MeRoSy-1:~$ rosrun controller_manager controller_manager list> joint_state_controller - hardware_interface::JointStateInterface ( running )> arm_controller - hardware_interface::PositionJointInterface ( running )
Seemingly my controller_manager is not working properly. Any suggestion?
Edit:
The first thing here to check if we include gazebo plugin in our urdf or not. I had forgotten it. So to my main robot.xacro file, I added:
Now the warning disappeared. But this error replaced it:
[ERROR] [1438148855.306557869, 1.195000000]: Could not load controller 'joint_trajectory_controller' because controller type 'position_controllers/JointTrajectoryController' does not exist.
[ERROR] [1438148855.306675796, 1.195000000]: Use 'rosservice call controller_manager/list_controller_types' to get the available types
I do:
ros@ros:~$ rosservice call controller_manager/list_controller_types
And the message was right: I didn't have joint trajectory controller in the list. I installed the stack ros_controllers. The error still exists but it has changed a bit into:
[ERROR] [1438241832.828501125, 1.325000000]: Could not load class joint_state_controller/JointStateController: Could not find library corresponding to plugin joint_state_controller/JointStateController. Make sure the plugin description XML file has the correct name of the library and that the library actually exists.
[ERROR] [1438241832.828590337, 1.325000000]: Could not load controller 'joint_state_controller' because controller type 'joint_state_controller/JointStateController' does not exist.
[ERROR] [1438241832.828620348, 1.325000000]: Use 'rosservice call controller_manager/list_controller_types' to get the available types
[ERROR] [WallTime: 1438241833.829661] [2.315000] Failed to load joint_state_controller
This time, while the program running, in another terminal, I try again:
ros@ros:~$ rosservice call controller_manager/list_controller_types
And 'joint_state_controller/JointStateController' is between the results.
I again thank you for your attention and apologize if my ROS knowledge is not good enough.
Edit:
Maybe a clue:
I know that the package joint_state_controller has been installed:
ros@ros:~/Documents/Damon_CPP/ROS_Workspace/devel$ rospack find joint_state_controller
/opt/ros/indigo/stacks/ros_controllers/joint_state_controller
And I know that when loading the robot in gazebo, the controller is there [well, I don't know how to write this: the controller is ... recognized???]:
ros@ros:~$ rosrun controller_manager controller_manager list-types
cob_omni_drive_controller/OdometryController
cob_omni_drive_controller/WheelController
controller_manager_tests/EffortTestController
controller_manager_tests/MyDummyController
...
joint_state_controller/JointStateController
velocity_controllers/JointTrajectoryController
...
But as I search the file: libjoint_state_controller.so
In opt/ros/indigo/lib
I don't find the file! Now it also gives some ideas to me why I always had problem with initial controllers of schunk (and finally I decided to remove them from sim.launch file and follow the instructions by gazebo):
ERROR: cannot launch node of type [cob_control_mode_adapter/cob_control_mode_adapter_node]: can't locate node [cob_control_mode_adapter_node] in package [cob_control_mode_adapter]
But anyway! Maybe this is not related! Back to the discussion, I couldn't find the .so file.
P.S.
My ros_controllers is not in opt/ros/indigo/share. I downloaded it in opt/ros/indigo/stacks. Although I don't think it makes any difference. Just said because you (Adolfo) emphasized the folder ros/indigo/**share**. :)
↧