Gazebo arm spazzing out fix - OxRAMSociety/RobotArm GitHub Wiki

Arm spazzing out in Gazebo - fix

Cause of the error

Bug happens because of the collision between the ground and the arm. The model is created in place (0,0,0) so it collides with the ground.

Fix

To fix it we need to spawn the model a bit higher. Go to the directory /ws_moveit/src/rbx1_moveit_config/launch and find gazebo.launch file. Then, in the line 21:

<arg name="world_pose" value="-x 0 -y 0 -z 0" />

Change z to some positive value (0.2 should work)

<arg name="world_pose" value="-x 0 -y 0 -z 0.2" />

The model should stop spazzing out after that.

Additional: No p gain specified for pid in PositionJointInterface error fix:

https://answers.gazebosim.org//question/5468/gazebo_ros_pkgs-no-p-gain-specified-for-pid-in-positionjointinterface/

If we want to add predefined pid's we can add these lines in gazebo_controllers.yaml in directory ws_moveit/src/rbx1_moveit_config

  gazebo_ros_control/pid_gains: 
  joint_1_base_shoulder: {p: 100.0, i: 1.0, d: 1.0}
  joint_2_shoulder_arm: {p: 100.0, i: 1.0, d: 1.0}
  joint_3_arm_upper_forearm: {p: 100.0, i: 1.0, d: 1.0}
  joint_4_upper_forearm_forearm: {p: 100.0, i: 1.0, d: 1.0}
  joint_5_forearm_wrist: {p: 100.0, i: 1.0, d: 1.0}
  joint_6_wrist_hand: {p: 100.0, i: 1.0, d: 1.0}
  gripper_servo_gear_joint: {p: 100.0, i: 1.0, d: 1.0}
  gripper_idol_gear_joint: {p: 100.0, i: 1.0, d: 1.0}

But it seems to not be the issue right now. Might be helpful in the future.