Problem with ros_control and gazebo
I'm new to ros, I exported urdf from solidworks. when I add transmission to urdf and launch it gazebo is not opening it's giving me error as
[ INFO] [1597656176.792430594, 0.245000000]: Loading gazebo_ros_control plugin
[ INFO] [1597656176.793072386, 0.245000000]: Starting gazebo_ros_control plugin in namespace: /
[ INFO] [1597656176.794135347, 0.245000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [robot_description] on the ROS param server.
Segmentation fault (core dumped)
[gazebo-1] process has died [pid 16223, exit code 139, cmd /home/xxxxx/catkin_ws/src/gazebo_ros_pkgs/gazebo_ros/scripts/gzserver -e ode worlds/empty.world __name:=gazebo __log:=/home/xxxx/.ros/log/5c2a3c2a-e069-11ea-a169-28d2447fbe91/gazebo-1.log].
log file: /home/xxxxx/.ros/log/5c2a3c2a-e069-11ea-a169-28d2447fbe91/gazebo-1*.log
but if I launch removing transmission tags it's launch perfectly.
I also tried with rrbot it gives me same error
edit: I've noticed it's because of this
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<robotNamespace>/</robotNamespace>
</plugin>
</gazebo>
edit 2:
urdf:
<?xml version="1.0" encoding="utf-8"?>
<!-- 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 -->
<robot
name="myrobot">
<link
name="base_link">
<inertial>
<origin
xyz="-9.8696E-13 1.9623E-12 0.0045914"
rpy="0 0 0" />
<mass
value="0.42609" />
<inertia
ixx="0.00066906"
ixy="9.8933E-19"
ixz="-1.1435E-20"
iyy="0.00066906"
iyz="-4.86E-20"
izz="0.0013313" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://myrobot/meshes/base_link.STL" />
</geometry>
<material
name="">
<color
rgba="0.0549 0.8352941 0.05 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://myrobot/meshes/base_link.STL" />
</geometry>
</collision>
</link>
<link
name="axis_1">
<inertial>
<origin
xyz="-1.9188529907279E-05 0.0408070112537518 -5.16123564547961E-05"
rpy="0 0 0" />
<mass
value="1.0766304222928" />
<inertia
ixx="0.00448300046656785"
ixy="-3.42116795702848E-07"
ixz="-4.62222489752297E-07"
iyy="0.00764833990366456"
iyz="-9.51387517754669E-07"
izz="0.00478779956731877" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://myrobot/meshes/axis_1.STL" />
</geometry>
<material
name="">
<color
rgba="0.96078 0.9490196 0.196078 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://myrobot/meshes/axis_1.STL" />
</geometry>
</collision>
</link>
<joint
name="CS1_JY"
type="revolute">
<origin
xyz="0 0 -0.007418"
rpy="1.5708 0 0" />
<parent
link="base_link" />
<child
link="axis_1" />
<axis
xyz="0 1 0" />
<limit
lower="-3.1416"
upper="3.1416"
effort="16.65"
velocity="1.0472" />
</joint>
<link
name="axis_2">
<inertial>
<origin
xyz="0.000584059554378004 0.0287533737382525 0.00295671723448659"
rpy="0 0 0" /> ...
@msaws You say you have tried this and this tutorial which expain you how to deal with
URDF
,ROS_control
and Gazebo? It is strange that this does not work... Are you able to post your description and configuration files? With the information you gave it seems that the Controllers are not properly loaded inROS_control
, maybe you gave a wrong joint name or your configuration file is not properly written. Besides I recommend you to work on a propernamespace
and not over the global/
.@Weasfas I checked the joint names, I don't think the problem is with controllers not loading because I even tried to with
roslaunch rrbot_gazebo rrbot_world.launch
it gives me same error. I think the problem is withgazebo_ros_control
plugin I'm not sure I couldn't figure out the problemI do not think it is a problem of
gazebo_ros_control
, you are getting a segmentation fault expection. If the problem was in ROS control it should warn yourself of the controllers not loading, and it does not even reach that part. Ensure you have all dependencies installed and your URDF and world are correct. In the past I have experienced the same issue when I load a wrong URDF or the .world file was bad formatted.Furthermore the plugin needs several parameters like:
I changed my plugin to
it gave me
I hope this correct but when I launch my controller
And what all dependencies should I install?
You need to load your
robot_description
in the proper namespace and I was refering to the dependencies fromgazebo_ros_control
,gazebo_ros_plugins
, and each dependency package regarding the controllers you are using: joint_position, joint_effort etc. It will be easier if you post the launch files or something to debug what is happening.@Weasfas I've updated the question and added my urdf and controller, I don't know why but I couldn't add more so I'm adding my launch files here in comments
controller launch file: