How do I spawn an ArUcO marker on top of jackal

asked 2021-03-23 07:38:36 -0500

Saphira7544 gravatar image

I need to put an ArUcO marker on top of my jackal in gazebo so that my drone can track it. I already have an environment where both the jackal and the drone spawn on a world, but I don't know how to add the marker so that it is fixed on top of the jackal every time I run the simulator. I already have the marker on my models aswell.

My xacro for the jackal has the following


    <?xml version="1.0"?>
<!-- This URDF should be loaded into a ROS parameter using xacro, then loaded 
     into Gazebo using robot state publisher.
     Requires the arguments: $namespace, $id -->
<robot name="jackal" xmlns:xacro="http://www.ros.org/wiki/xacro">
  <xacro:property name="PI"                        value="3.1415926535897931" />
  <xacro:property name="wheelbase"                 value="0.262" />
  <xacro:property name="track"                     value="0.37559" />
  <xacro:property name="wheel_vertical_offset"     value="0.0345" />
  <xacro:property name="footprint_vertical_offset" value="-0.0655" />
  <xacro:property name="wheel_radius"              value="0.098" />
  <xacro:property name="wheel_width"               value="0.040" />
  <xacro:property name="chassis_length"            value="0.420" />
  <xacro:property name="chassis_width"             value="0.310" />
  <xacro:property name="chassis_height"            value="0.184" />
  <xacro:property name="dummy_inertia"             value="1e-09"/>
  <xacro:property name="mount_spacing"             value="0.120" />

  <material name="dark_grey"><color rgba=" 0.2 0.2 0.2 1.0" /></material>
  <material name="light_grey"><color rgba="0.4 0.4 0.4 1.0" /></material>
  <material name="yellow"><color rgba="0.8 0.8 0.0 1.0" /></material>
  <material name="black"><color rgba="0.15 0.15 0.15 1.0" /></material>

  <!-- The wheel template. -->
  <xacro:macro name="wheel" params="prefix *joint_pose">
    <link name="${prefix}_wheel_link">
      <visual>
        <origin xyz="0 0 0" rpy="${PI/2} 0 0"/>
        <geometry>
          <mesh filename="package://multi_jackal_description/meshes/jackal-wheel.stl"/>
        </geometry>
        <material name="black" />
      </visual>
      <collision>
        <origin xyz="0 0 0" rpy="${PI/2} 0 0"/>
        <geometry>
          <cylinder radius="${wheel_radius}" length="${wheel_width}"/>
        </geometry>
      </collision>
      <inertial>
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <mass value="0.477"/>
        <inertia
          ixx="0.0013" ixy="0" ixz="0"
          iyy="0.0024" iyz="0"
          izz="0.0013"/>
      </inertial>
    </link>
    <gazebo reference="${prefix}_wheel_link">
      <material>Gazebo/DarkGrey</material>
    </gazebo>
    <joint name="${prefix}_wheel" type="continuous">
      <parent link="chassis_link"/>
      <child link="${prefix}_wheel_link" />
      <xacro:insert_block name="joint_pose" />
      <axis xyz="0 1 0" />
    </joint>
    <!-- In reality, Jackal has only two motors, one per side. However, it's more
         straightforward for Gazebo to simulate as if there's an actuator per wheel. -->
    <transmission name="${prefix}_wheel_trans">
      <type>transmission_interface/SimpleTransmission</type>
      <joint name="${prefix}_wheel">
        <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
      </joint>
      <actuator name="${prefix}_actuator">
        <mechanicalReduction>1</mechanicalReduction>
      </actuator>
    </transmission>
  </xacro:macro>

  <!-- The joints and links. -->
  <xacro:wheel prefix="front_left">
    <origin xyz="${wheelbase ...
(more)
edit retag flag offensive close merge delete