spawned robot in Gazebo is moving by itself (Moveit!)
Hello everyone,
This is my first question, so please have some understanding if I haven't posted it like it was meant to be posted.
I am running Ubuntu 18.04.2 with ROS_Melodic and Gazebo 9, I have also installed Moveit! package like it was explained in the moveit tutorial, after that I have made catkin package and in the src folder I have git cloned the fanuc moveit! package(Kinetic distro)
and all dependent packages for a fanuc in this case. I have sourced and built the workspace (using catkin build). I have chosen the fanuc_m16ib20 robot (it was random choice) and I have made the moveit package like in instructions for the moveit_setup_assistant. At the end of the package generation in setup_assistant I was offered the URDF file for the made configuration, I have copied it and saved it under mypackage/urdf path. After this I have added the Gazebo plugin to the URDF file
<gazebo> <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so"> <robotNamespace>fanuc_m16ib20</robotNamespace> </plugin> </gazebo>
Also I wanted to fix(anchor) the robot to the world and I added this to the beginning of the URDF file:
<link name="world"></link>
<joint name="fixed" type="fixed">
<parent link="world"/>
<child link="base_link"/>
</joint>
Next thing I have done is, added the namespace fanuc_m16ib20
to the controllers, controller spawner and controller manager. I have modified the demo_gazebo.launch
file to do this and controller.yaml
files accordingly.
After this changes all it was left to do is to try and run the demo_gazebo.launch
file, but after running it Gazebo and Rviz are started but the robot in the Gazebo is moving by itself. Since it is connected to the RViz I can see the same behaviour in the RViz, with the exception, in RViz there robot joints stay connected.
When I run rostopic list
or rosservice list
I can see topics and controller manager under the same namespace.
topics:
> /fanuc_m16ib20/fanuc_arm_controller/command
/fanuc_m16ib20/fanuc_arm_controller/follow_joint_trajectory/cancel
/fanuc_m16ib20/fanuc_arm_controller/follow_joint_trajectory/feedback
/fanuc_m16ib20/fanuc_arm_controller/follow_joint_trajectory/goal
/fanuc_m16ib20/fanuc_arm_controller/follow_joint_trajectory/result
/fanuc_m16ib20/fanuc_arm_controller/follow_joint_trajectory/status
/fanuc_m16ib20/fanuc_arm_controller/state
/fanuc_m16ib20/joint_states
services:
/fanuc_m16ib20/controller_manager/list_controller_types
/fanuc_m16ib20/controller_manager/list_controllers
/fanuc_m16ib20/controller_manager/load_controller
/fanuc_m16ib20/controller_manager/reload_controller_libraries
/fanuc_m16ib20/controller_manager/switch_controller
/fanuc_m16ib20/controller_manager/unload_controller
I have these errors and a few warnings:
[ERROR] [1573735342.035351047]: name, joints, action_ns, and type must be specifed for each controller
[ERROR] [1573735343.777676683, 0.001000000]: No p gain specified for pid. Namespace: /fanuc_m16ib20/gazebo_ros_control/pid_gains/joint_1
[ERROR] [1573735343.779464187, 0.001000000]: No p gain specified for pid. Namespace: /fanuc_m16ib20/gazebo_ros_control/pid_gains/joint_2
[ERROR] [1573735343.781116227, 0.001000000]: No p gain specified for pid. Namespace: /fanuc_m16ib20/gazebo_ros_control/pid_gains/joint_3
[ERROR] [1573735343.783848394, 0.001000000]: No p gain specified for pid. Namespace: /fanuc_m16ib20/gazebo_ros_control/pid_gains/joint_4
[ERROR] [1573735343.785975603, 0.001000000]: No p gain specified for pid. Namespace: /fanuc_m16ib20/gazebo_ros_control/pid_gains/joint_5
[ERROR] [1573735343.797053511, 0.001000000]: No p gain specified for pid. Namespace: /fanuc_m16ib20/gazebo_ros_control/pid_gains/joint_6
After solving the ...