Results 1 to 3 of 3

Thread: Basic / Starter URDF for hexapod

  1. #1
    Join Date
    Mar 2015
    Location
    Texas
    Posts
    342
    Images
    15
    Rep Power
    32

    Basic / Starter URDF for hexapod

    I am in the process of creating a urdf for the phantomx hexapod and I've seen a couple examples from KevinO and Upgrayd of working quad/hex models. If anyone is willing could you please provide your urdf to give me a jump start on the process?

    TIA!
    01001001001000000100110001101111011101100110010100 10000001010010011011110110001001101111011101000111 0011

    My Instagram
    My YouTube

  2. #2
    Join Date
    Dec 2012
    Location
    Los Angeles, CA
    Posts
    847
    Images
    25
    Rep Power
    85

    Re: Basic / Starter URDF for hexapod

    My URDF is auto generated from a xacro macro file on launch. Anyway here is an example.

    Code:
    <?xml version="1.0"?>
    <robot xmlns:xacro="http://ros.org/wiki/xacro" name="Golem">
    
        <!-- parameters -->
        <xacro:property name="pi" value="3.1415926535897931" />
        <xacro:property name="body_length_x" value="0.3556" />
        <xacro:property name="body_length_y" value="0.165" />
        <xacro:property name="coxa_length" value="0.05893" />
        <xacro:property name="femur_length" value="0.10798" />
        <xacro:property name="tibia_length" value="0.08774" />
        <xacro:property name="tarsus_length" value="0.12065" />
    
        <!-- Build the body frame -->
        <link name="base_link" />
    
        <joint name="base_joint" type="fixed">
            <parent link="base_link" />
            <child link="body" />
            <origin xyz="0 0 0" rpy="0 0 0" />
        </joint>        
        <link name="body">
                <visual>
                      <origin    xyz="0 0 0" rpy="0 0 0" />
                      <geometry>
                        <mesh filename="package://hexapod_description/meshes/body.stl" scale="0.001 0.001 0.001"/>
                      </geometry>
                    <material name="">
                        <color rgba="0.7 0.7 0.7 1" />
                    </material>
                </visual>
        </link>
    
        <!-- Joint properties -->
        <xacro:property name="joint_lower_limit" value="-${3.14}" />
        <xacro:property name="joint_upper_limit" value="${3.14}" />
        <xacro:property name="joint_effort" value="10000" />
        <xacro:property name="joint_velocity" value="100" />
    
        <!-- Leg macro -->
        <xacro:macro name="leg" params="side position x y angle axis">
        
            <!-- leg position -->
            <joint name="leg_center_joint_${side}${position}" type="fixed">
                <origin xyz="${x} ${y} 0" rpy="0 0 0" /> 
                <parent link="body" />
                <child link="leg_center_${side}${position}" />
            </joint>
    
            <link name="leg_center_${side}${position}" />
            
            <!-- coxa -->
            <joint name="coxa_joint_${side}${position}" type="revolute">
                <origin xyz="0 0 0" rpy="0 0 ${angle}" />
                <parent link="leg_center_${side}${position}" />
                <child link="coxa_${side}${position}" />
                <axis xyz="0 0 ${axis}" />
                <limit lower="${joint_lower_limit}" upper="${joint_upper_limit}" effort="${joint_effort}" velocity="${joint_velocity}" />
            </joint>
            <link name="coxa_${side}${position}">
                <visual>
                    <origin xyz="0 0 0" rpy="0 0 0" />
                      <geometry>
                        <mesh filename="package://hexapod_description/meshes/coxa.stl" scale="0.001 0.001 0.001"/>
                      </geometry>
                    <material name="">
                        <color rgba="0.7 0.7 0.7 1" />
                    </material>
                </visual>
            </link>
    
            <!-- femur -->
            <joint name="femur_joint_${side}${position}" type="revolute">
                <origin xyz="${coxa_length} 0 0" rpy="-${pi/2} 0 0" />
                <parent link="coxa_${side}${position}" />
                <child link="femur_${side}${position}" />
                <axis xyz="0 0 ${axis}" />
                <limit lower="${joint_lower_limit}" upper="${joint_upper_limit}" effort="${joint_effort}" velocity="${joint_velocity}" />
            </joint>
            <link name="femur_${side}${position}">
                <visual>
                    <origin xyz="0 0 0" rpy="0 0 0" />
                      <geometry>
                        <mesh filename="package://hexapod_description/meshes/femur.stl" scale="0.001 0.001 0.001"/>
                      </geometry>
                    <material name="">
                        <color rgba="0.7 0.7 0.7 1" />
                    </material>
                </visual>
            </link>
    
            <!-- tibia -->
            <joint name="tibia_joint_${side}${position}" type="revolute">
                <origin xyz="0 -${femur_length} 0" rpy="${pi} 0 0" />
                <parent link="femur_${side}${position}" />
                <child link="tibia_${side}${position}" />
                <axis xyz="0 0 ${axis}" />
                <limit lower="${joint_lower_limit}" upper="${joint_upper_limit}" effort="${joint_effort}" velocity="${joint_velocity}" />
            </joint>
            <link name="tibia_${side}${position}">
                <visual>
                    <origin xyz="0 0 0" rpy="0 0 0" />
                      <geometry>
                        <mesh filename="package://hexapod_description/meshes/tibia.stl" scale="0.001 0.001 0.001"/>
                      </geometry>
                    <material name="">
                        <color rgba="0.7 0.7 0.7 1" />
                    </material>
                </visual>
            </link>
    
            <!-- tarsus -->
            <joint name="tarsus_joint_${side}${position}" type="revolute">
                <origin xyz="${tibia_length} 0 0" rpy="0 0 -${pi/2}" />
                <parent link="tibia_${side}${position}" />
                <child link="tarsus_${side}${position}" />
                <axis xyz="0 0 ${axis}" />
                <limit lower="${joint_lower_limit}" upper="${joint_upper_limit}" effort="${joint_effort}" velocity="${joint_velocity}" />
            </joint>
            <link name="tarsus_${side}${position}">
                <visual>
                    <origin xyz="0 0 0" rpy="0 0 0" />
                      <geometry>
                        <mesh filename="package://hexapod_description/meshes/tarsus.stl" scale="0.001 0.001 0.001"/>
                      </geometry>
                    <material name="">
                        <color rgba="0.7 0.7 0.7 1" />
                    </material>
                </visual>
            </link>        
        </xacro:macro>
    
    <!-- Build robot model -->
        <xacro:leg side="R" position="R" x="0.1778" y="-0.0825" angle="-${pi/4}" axis="1" />
        <xacro:leg side="R" position="M" x="0.0" y="-0.13335" angle="-${pi/2}" axis="1" />
        <xacro:leg side="R" position="F" x="-0.1778" y="-0.0825" angle="-${pi*3/4}" axis="1" />    
        <xacro:leg side="L" position="R" x="0.1778" y="0.0825" angle="${pi/4}" axis="-1" />
        <xacro:leg side="L" position="M" x="0.0" y="0.13335" angle="${pi/2}" axis="-1" />
        <xacro:leg side="L" position="F" x="-0.1778" y="0.0825" angle="${pi*3/4}" axis="-1" />
      
    </robot>

  3. #3
    Join Date
    Mar 2015
    Location
    Texas
    Posts
    342
    Images
    15
    Rep Power
    32

    Re: Basic / Starter URDF for hexapod

    Ah hah!

    That is what I needed to know! Now to abort the text editor and do it the right way =P

    Edit: Well it at least gets me on a new track. I was going about it the long hard way and probably would have spent too much time with little result.

    Thank you!
    Last edited by r3n33; 03-31-2015 at 06:15 PM.
    01001001001000000100110001101111011101100110010100 10000001010010011011110110001001101111011101000111 0011

    My Instagram
    My YouTube

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. URDF, Robot State Publisher, and the ArbotiX
    By Peter_heim in forum ROS - Robot Operating System
    Replies: 9
    Last Post: 04-26-2014, 08:48 PM
  2. For sale: RB-110 starter kit plus WiFi and OS Image
    By CogswellCogs in forum Garage Sale
    Replies: 0
    Last Post: 01-23-2012, 12:46 PM
  3. Replies: 2
    Last Post: 01-01-2012, 02:40 AM
  4. Understanding URDF files and rviz in ROS
    By Pi Robot in forum ROS - Robot Operating System
    Replies: 9
    Last Post: 10-24-2010, 09:28 AM
  5. Questions about Tomy i-SOBOT, whats a good starter?
    By Electricity in forum Mech Warfare
    Replies: 9
    Last Post: 07-03-2008, 06:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •