Why is my robotic arm laying down in Gazebo after configure it with MoveIt Setup Assistant?
I am very new to ROS and all the tools surrounding ROS. Currently, I am trying to setup a franka emika (panda) robot arm using moveit setup assistant. After that, I just wanna launch the robot in the Gazebo simulation using the command
roslaunch package_name gazebo.launch
However, as you can see below, the robot collapse when spawned.
Here are some of the messages capture in the terminal (shown in the picture below):
I have gone through past questions on similar problems online, but it seems like the files generated from the setup assistant is a little different, hence I wasn't able to locate what are the mistakes.
Below also I will attach the code for the robot urdf:
panda_arm.urdf.xacro:
<?xml version='1.0' encoding='utf-8'?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="panda">
<xacro:arg name="arm_id" default="panda" /> <!-- Name of this panda -->
<xacro:arg name="hand" default="true" /> <!-- Should a franka_gripper be mounted at the flange?" -->
<xacro:arg name="gazebo" default="true" /> <!-- Is the robot being simulated in gazebo?" -->
<xacro:property name="arm_id" value="$(arg arm_id)" />
<xacro:unless value="$(arg gazebo)">
<!-- Create a URDF for a real hardware -->
<xacro:include filename="$(find franka_description)/robots/panda_arm.xacro" />
<xacro:panda_arm arm_id="${arm_id}" safety_distance="0.03"/>
<xacro:if value="$(arg hand)">
<xacro:include filename="$(find franka_description)/robots/hand.xacro"/>
<xacro:hand ns="${arm_id}" rpy="0 0 ${-pi/4}" connected_to="${arm_id}_link8" safety_distance="0.03"/>
</xacro:if>
</xacro:unless>
<xacro:if value="$(arg gazebo)">
<xacro:arg name="xyz" default="0 0 0" />
<xacro:arg name="rpy" default="0 0 0" />
<!-- Create a simulatable URDF -->
<xacro:include filename="$(find franka_description)/robots/utils.xacro" />
<xacro:include filename="$(find franka_description)/robots/panda_gazebo.xacro" />
<xacro:panda_arm arm_id="${arm_id}" />
<xacro:if value="$(arg hand)">
<xacro:hand ns="${arm_id}" rpy="0 0 ${-pi/4}" connected_to="${arm_id}_link8" />
<xacro:gazebo-joint joint="${arm_id}_finger_joint1" transmission="hardware_interface/EffortJointInterface" />
<xacro:gazebo-joint joint="${arm_id}_finger_joint2" transmission="hardware_interface/EffortJointInterface" />
</xacro:if>
<!-- Gazebo requires a joint to a link called "world" for statically mounted robots -->
<link name="world" />
<joint name="world_joint" type="fixed">
<origin xyz="$(arg xyz)" rpy="$(arg rpy)" />
<parent link="world" />
<child link="${arm_id}_link0" />
</joint>
<xacro:gazebo-joint joint="${arm_id}_joint1" transmission="hardware_interface/EffortJointInterface" />
<xacro:gazebo-joint joint="${arm_id}_joint2" transmission="hardware_interface/EffortJointInterface" />
<xacro:gazebo-joint joint="${arm_id}_joint3" transmission="hardware_interface/EffortJointInterface" />
<xacro:gazebo-joint joint="${arm_id}_joint4" transmission="hardware_interface/EffortJointInterface" />
<xacro:gazebo-joint joint="${arm_id}_joint5" transmission="hardware_interface/EffortJointInterface" />
<xacro:gazebo-joint joint="${arm_id}_joint6" transmission="hardware_interface/EffortJointInterface" />
<xacro:gazebo-joint joint="${arm_id}_joint7" transmission="hardware_interface/EffortJointInterface" />
<xacro:transmission-franka-state arm_id="${arm_id}" />
<xacro:transmission-franka-model arm_id="${arm_id}"
root="${arm_id}_joint1"
tip="${arm_id}_joint8"
/>
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<robotNamespace>${arm_id}</robotNamespace>
<controlPeriod>0.001</controlPeriod>
<robotSimType>franka_gazebo/FrankaHWSim</robotSimType> ...
Have you followed the tutorial? There are a few steps required to make the arm work in Gazebo.
@osilva Regarding this matter, I found out that the files that are currently used in the tutorial are different from the updated franka package, hence wasn't able to follow the tutorial properly. Perhaps do you know any solution about this?
@osilva EDIT: I have followed the tutorial and manage to launch the gazebo and spawned a non-collapsed robot arm now. However, after terminating and relaunch the gazebo a few time, the robot is not spawned anymore.
There's are the error messages provided in the terminal:
EDIT: I've checked the logfile, but found nothing crucial/ fixable
Since the original issue is resolved on being able to use Gazebo. I suggest you start a new question for the new issue. That way more people can help you
Understand