ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Why is my robotic arm laying down in Gazebo after configure it with MoveIt Setup Assistant?

asked 2022-01-24 21:33:10 -0500

HynRidge gravatar image

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.

image description

Here are some of the messages capture in the terminal (shown in the picture below):

image description

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> ...
(more)
edit retag flag offensive close merge delete

Comments

Have you followed the tutorial? There are a few steps required to make the arm work in Gazebo.

osilva gravatar image osilva  ( 2022-01-25 07:55:32 -0500 )edit

@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?

HynRidge gravatar image HynRidge  ( 2022-01-25 19:23:49 -0500 )edit

@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:

[gazebo-2] process has died [pid 35304, exit code 255, cmd /opt/ros/noetic/lib/gazebo_ros/gzserver -u -e ode worlds/empty.world __name:=gazebo __log:=/home/heinrich/.ros/log/1e14ad80-7e51-11ec-84af-99a9762c0757/gazebo-2.log].
log file: /home/heinrich/.ros/log/1e14ad80-7e51-11ec-84af-99a9762c0757/gazebo-2*.log

EDIT: I've checked the logfile, but found nothing crucial/ fixable

HynRidge gravatar image HynRidge  ( 2022-01-25 20:40:59 -0500 )edit

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

osilva gravatar image osilva  ( 2022-01-26 04:46:11 -0500 )edit

Understand

HynRidge gravatar image HynRidge  ( 2022-01-26 23:41:32 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-01-26 23:42:49 -0500

HynRidge gravatar image

I managed to solve this issue by following the tutorial from the attached websites: https://ros-planning.github.io/moveit_tutorials/doc/gazebo_simulation/gazebo_simulation.html

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-01-24 21:33:10 -0500

Seen: 286 times

Last updated: Jan 26 '22