Cannot spawn robot model correctly after adding gazebo_ros_control PID parameters in .yaml robot_control config file
Dear all,
I am facing the following situation:
I can spawn my 4-wheel robot correctly to Gazebo but while loading I get an error message:
No p gain specified for pid. Namespace: /gazebo_ros_control/pid_gains/BRJ
Searching for a solution I came up with various answers proposing to add:
# gazebo_ros_control_params.yaml
/gazebo_ros_control:
pid_gains:
FRJ:
p: 100.0
i: 1.0
d: 0.1
FLJ:
p: 100.0
i: 1.0
d: 0.1
BRJ:
p: 100.0
i: 1.0
d: 0.1
BLJ:
p: 100.0
i: 1.0
d: 0.1
in robot_control.yaml configuration file. When I do so, the error message disappears but then, my model is not spawned correctly in Gazebo. Specifically, the 4 wheels are missing and a small portion of my model is placed inside the ground.
Any ideas why this behavior?
robot_control.yaml:
robot:
# Publish all joint states -----------------------------------
joint_state_controller:
type: joint_state_controller/JointStateController
publish_rate: 50
# # Position Controllers ---------------------------------------
# FLJ_position_controller:
# type: effort_controllers/JointPositionController
# joint: FLJ
# pid: {p: 1.0, i: 1.0, d: 0.0}
# FRJ_position_controller:
# type: effort_controllers/JointPositionController
# joint: FRJ
# pid: {p: 1.0, i: 1.0, d: 0.0}
# BLJ_position_controller:
# type: effort_controllers/JointPositionController
# joint: BLJ
# pid: {p: 1.0, i: 1.0, d: 0.0}
# BRJ_position_controller:
# type: effort_controllers/JointPositionController
# joint: BRJ
# pid: {p: 1.0, i: 1.0, d: 0.0}
# Velocity Controllers ---------------------------------------
FRJ_velocity_controller:
type: velocity_controllers/JointVelocityController
joint: FRJ
#pid: {p: 100.0, i: 10.0, d: 0.0}
FLJ_velocity_controller:
type: velocity_controllers/JointVelocityController
joint: FLJ
#pid: {p: 100.0, i: 10.0, d: 0.0}
BRJ_velocity_controller:
type: velocity_controllers/JointVelocityController
joint: BRJ
#pid: {p: 100.0, i: 10.0, d: 0.0}
BLJ_velocity_controller:
type: velocity_controllers/JointVelocityController
joint: BLJ
#pid: {p: 100.0, i: 10.0, d: 0.0}
# gazebo_ros_control_params.yaml
gazebo_ros_control:
pid_gains:
FRJ:
p: 100.0
i: 1.0
d: 0.1
FLJ:
p: 100.0
i: 1.0
d: 0.1
BRJ:
p: 100.0
i: 1.0
d: 0.1
BLJ:
p: 100.0
i: 1.0
d: 0.1
URDF:
<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- | This document was autogenerated by xacro from robot.xacro | -->
<!-- | EDITING THIS FILE BY HAND IS NOT RECOMMENDED | -->
<!-- =================================================================================== -->
<robot name="robot" xmlns:xacro="http://www.ros.org/wiki/xacro">
<!--This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner@gmail.com)
Commit Version: 1.5.1-0-g916b5db Build Version: 1.5.7152.31018
For more information, please see http://wiki.ros.org/sw_urdf_exporter -->
<link name="dummy">
</link>
<link name="base_link">
<inertial>
<origin rpy="0 0 0" xyz="0.00390777224516517 -0.032446267219719 0.184169550820421"/>
<mass value="40.20121630268732"/>
<inertia ixx="0.0149000386129946" ixy="-4.66831001352174E-09" ixz="5.23920338795194E-08" iyy="0.0234359493013497" iyz="0.000771538751024883" izz="0.0286744535302635"/>
</inertial>
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://robot/meshes/base_link.STL"/>
</geometry>
<material name="">
<color rgba="0.529411764705882 0.549019607843137 0.549019607843137 1"/>
</material>
</visual>
<collision>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://robot/meshes/base_link.STL"/>
</geometry>
</collision>
</link>
<joint name="dummy_joint" type ...