Permalink
Browse files

Added package to generate urdf file for the union of hardware pieces.

  • Loading branch information...
1 parent 718f0c3 commit 3bfbad47a439423c0a7bdc1e7f74f2d53028eb59 @oscillare oscillare committed Aug 11, 2012
@@ -0,0 +1,178 @@
+<?xml version="1.0"?>
+<robot name="xtion" xmlns:xacro="http://ros.org/wiki/xacro">
+ <property name="M_PI" value="3.14159" />
+
+ <xacro:macro name="xtion" params="parent x_loc y_loc z_loc rr rp ry">
+ <joint name="base_xtion_joint" type="fixed">
+ <origin xyz="0.0074381 0 0.01875" rpy="0 0 0" />
+ <parent link="xtion_platform" />
+ <child link="xtion_link" />
+ </joint>
+
+ <link name="xtion_link">
+ <inertial>
+ <mass value="0.01" />
+ <origin xyz="0 0 0" />
+ <inertia ixx="0.001" ixy="0.0" ixz="0.0"
+ iyy="0.001" iyz="0.0" izz="0.001" />
+ </inertial>
+
+ <visual>
+ <origin xyz="0 0 0" rpy="${M_PI/2.0} 0 ${M_PI/2.0}" />
+ <geometry>
+ <mesh filename="package://turtlebot_xtion_top_description/meshes/xtion/asus_xtion_pro_live.dae" scale="0.001 0.001 0.001"/>
+ </geometry>
+ </visual>
+
+ <collision>
+ <origin xyz="-0.01 0.0 0.0" rpy="0 0 0" />
+ <geometry>
+ <box size="0.04 0.18 0.03"/>
+ </geometry>
+ </collision>
+ </link>
+
+ <!-- platform for xtion -->
+
+ <joint name="base_xtion_platform_joint" type="fixed">
+ <origin xyz="${x_loc} ${y_loc} ${z_loc}"
+ rpy="${rr} ${rp} ${ry}" />
+ <parent link="${parent}" />
+ <child link="xtion_platform" />
+ </joint>
+
+ <link name="xtion_platform">
+ <inertial>
+ <mass value="0.01" />
+ <origin xyz="0 0 0" />
+ <inertia ixx="0.001" ixy="0.0" ixz="0.0"
+ iyy="0.001" iyz="0.0" izz="0.001" />
+ </inertial>
+
+ <visual>
+ <origin xyz="0 0 0 " rpy="${M_PI/2.0} 0 ${M_PI/2.0}" />
+ <geometry>
+ <mesh filename="package://turtlebot_xtion_top_description/meshes/xtion/xtion_base.dae" scale="0.001 0.001 0.001"/>
+ </geometry>
+ </visual>
+
+ <collision>
+ <origin xyz="0.0 0.0 0.0" rpy="0 0 0" />
+ <geometry>
+ <box size="0.05 0.24 0.02"/>
+ </geometry>
+ </collision>
+ </link>
+
+ <!-- left clip for xtion -->
+
+ <joint name="base_xtion_left_clip_joint" type="fixed">
+ <origin xyz="0.017 -0.0745 0.00635"
+ rpy="0.0 0.0 0.0" />
+ <parent link="xtion_platform" />
+ <child link="xtion_left_clip" />
+ </joint>
+
+ <link name="xtion_left_clip">
+ <inertial>
+ <mass value="0.01" />
+ <origin xyz="0 0 0" />
+ <inertia ixx="0.001" ixy="0.0" ixz="0.0"
+ iyy="0.001" iyz="0.0" izz="0.001" />
+ </inertial>
+
+ <visual>
+ <origin xyz="0 0 0 " rpy="${M_PI/2.0} 0 ${M_PI/2.0}" />
+ <geometry>
+ <mesh filename="package://turtlebot_xtion_top_description/meshes/xtion/xtion_bracket_left.dae" scale="0.001 0.001 0.001"/>
+ </geometry>
+ </visual>
+ </link>
+
+ <!-- right clip for xtion -->
+
+ <joint name="base_xtion_right_clip_joint" type="fixed">
+ <origin xyz="0.017 0.0809 0.00635"
+ rpy="0.0 0.0 0.0" />
+ <parent link="xtion_platform" />
+ <child link="xtion_right_clip" />
+ </joint>
+
+ <link name="xtion_right_clip">
+ <inertial>
+ <mass value="0.01" />
+ <origin xyz="0 0 0" />
+ <inertia ixx="0.001" ixy="0.0" ixz="0.0"
+ iyy="0.001" iyz="0.0" izz="0.001" />
+ </inertial>
+
+ <visual>
+ <origin xyz="0 0 0 " rpy="${M_PI/2.0} 0 ${M_PI/-2.0}" />
+ <geometry>
+ <mesh filename="package://turtlebot_xtion_top_description/meshes/xtion/xtion_bracket_right.dae" scale="0.001 0.001 0.001"/>
+ </geometry>
+ <color rgba="0 225 0 1.0"/>
+ </visual>
+ </link>
+
+ <joint name="xtion_depth_joint" type="fixed">
+ <origin xyz="0 0.018 0" rpy="0 0 0" />
+ <parent link="xtion_link" />
+ <child link="xtion_depth_frame" />
+ </joint>
+
+ <link name="xtion_depth_frame">
+ <inertial>
+ <mass value="0.01" />
+ <origin xyz="0 0 0" />
+ <inertia ixx="0.001" ixy="0.0" ixz="0.0"
+ iyy="0.001" iyz="0.0" izz="0.001" />
+ </inertial>
+ </link>
+
+ <joint name="xtion_depth_optical_joint" type="fixed">
+ <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
+ <parent link="xtion_depth_frame" />
+ <child link="xtion_depth_optical_frame" />
+ </joint>
+
+ <link name="xtion_depth_optical_frame">
+ <inertial>
+ <mass value="0.001" />
+ <origin xyz="0 0 0" />
+ <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
+ iyy="0.0001" iyz="0.0" izz="0.0001" />
+ </inertial>
+ </link>
+
+ <joint name="xtion_rgb_joint" type="fixed">
+ <origin xyz="0 -0.005 0" rpy="0 0 0" />
+ <parent link="xtion_link" />
+ <child link="xtion_rgb_frame" />
+ </joint>
+
+ <link name="xtion_rgb_frame">
+ <inertial>
+ <mass value="0.001" />
+ <origin xyz="0 0 0" />
+ <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
+ iyy="0.0001" iyz="0.0" izz="0.0001" />
+ </inertial>
+ </link>
+
+ <joint name="xtion_rgb_optical_joint" type="fixed">
+ <origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
+ <parent link="xtion_rgb_frame" />
+ <child link="xtion_rgb_optical_frame" />
+ </joint>
+
+ <link name="xtion_rgb_optical_frame">
+ <inertial>
+ <mass value="0.001" />
+ <origin xyz="0 0 0" />
+ <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
+ iyy="0.0001" iyz="0.0" izz="0.0001" />
+ </inertial>
+ </link>
+ </xacro:macro>
+</robot>
@@ -0,0 +1,2 @@
+*.pyc
+*.urdf.xacro
@@ -0,0 +1,30 @@
+cmake_minimum_required(VERSION 2.4.6)
+include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
+
+# Set the build type. Options are:
+# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage
+# Debug : w/ debug symbols, w/o optimization
+# Release : w/o debug symbols, w/ optimization
+# RelWithDebInfo : w/ debug symbols, w/ optimization
+# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries
+#set(ROS_BUILD_TYPE RelWithDebInfo)
+
+rosbuild_init()
+
+#set the default path for built executables to the "bin" directory
+set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
+#set the default path for built libraries to the "lib" directory
+set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
+
+#uncomment if you have defined messages
+#rosbuild_genmsg()
+#uncomment if you have defined services
+#rosbuild_gensrv()
+
+#common commands for building c++ executables and libraries
+#rosbuild_add_library(${PROJECT_NAME} src/example.cpp)
+#target_link_libraries(${PROJECT_NAME} another_library)
+#rosbuild_add_boost_directories()
+#rosbuild_link_boost(${PROJECT_NAME} thread)
+#rosbuild_add_executable(example examples/example.cpp)
+#target_link_libraries(example ${PROJECT_NAME})
@@ -0,0 +1 @@
+include $(shell rospack find mk)/cmake.mk
@@ -0,0 +1,36 @@
+Format for yaml File
+--------------------
+- package: <package name>
+ files:
+ - filename: <filename>
+ parts:
+ - part_name: <macro name>
+ params:
+ <parameter name>: <parameter value>
+
+
+Generate urdf File
+--------------------
+Generate xml file.
+
+ rosrun urdf_compose compose.py [-o <outfile>] <yaml>
+
+If -o is not specificed, the default is standard output.
+
+
+Run Demo
+--------
+1. Open the urdf directory.
+
+ roscd urdf_compose/urdf
+
+2. Generate urdf files. (yaml files are located in the demo directory.)
+
+ rosrun urdf_compose compose.py -o xtion.urdf.xacro ../demo/xtion.yaml
+ rosrun urdf_compose compose.py -o turtlebot.urdf.xacro ../demo/turtlebot.yaml
+
+3. Launch rviz.
+
+ roslaunch urdf_compose demo.launch model:=<model>
+
+ <model> = {xtion.urdf.xacro, turtlebot.urdf.xacro}
@@ -0,0 +1,9 @@
+#! /usr/bin/env python
+
+import roslib
+
+roslib.load_manifest('urdf_compose')
+import compose
+
+if __name__ == "__main__":
+ compose.main()
@@ -0,0 +1,104 @@
+Background\ ColorR=0
+Background\ ColorG=0.00392157
+Background\ ColorB=0.223529
+Fixed\ Frame=/base_link
+Target\ Frame=<Fixed Frame>
+Grid.Alpha=0.5
+Grid.Cell\ Size=1
+Grid.ColorR=0.5
+Grid.ColorG=0.5
+Grid.ColorB=0.5
+Grid.Enabled=1
+Grid.Line\ Style=0
+Grid.Line\ Width=0.03
+Grid.Normal\ Cell\ Count=0
+Grid.OffsetX=0
+Grid.OffsetY=0
+Grid.OffsetZ=0
+Grid.Plane=0
+Grid.Plane\ Cell\ Count=10
+Grid.Reference\ Frame=<Fixed Frame>
+Robot\ Model.Alpha=1
+Robot\ Model.Collision\ Enabled=0
+Robot\ Model.Enabled=1
+Robot\ Model.Robot\ Description=robot_description
+Robot\ Model.TF\ Prefix=
+Robot\ Model.Update\ Interval=0
+Robot\ Model.Visual\ Enabled=1
+Robot\:\ Robot\ Model\ Link\ base_footprintShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ base_footprintShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ base_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ base_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ front_wheel_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ front_wheel_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ gyro_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ gyro_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ laserShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ laserShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ left_wheel_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ left_wheel_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ plate_0_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ plate_0_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ plate_1_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ plate_1_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ plate_2_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ plate_2_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ plate_3_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ plate_3_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ rear_wheel_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ rear_wheel_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ right_wheel_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ right_wheel_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ spacer_0_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ spacer_0_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ spacer_1_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ spacer_1_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ spacer_2_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ spacer_2_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ spacer_3_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ spacer_3_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ standoff_2in_0_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ standoff_2in_0_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ standoff_2in_1_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ standoff_2in_1_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ standoff_2in_2_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ standoff_2in_2_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ standoff_2in_3_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ standoff_2in_3_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ standoff_2in_4_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ standoff_2in_4_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ standoff_2in_5_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ standoff_2in_5_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ standoff_2in_6_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ standoff_2in_6_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ standoff_2in_7_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ standoff_2in_7_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ standoff_8in_0_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ standoff_8in_0_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ standoff_8in_1_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ standoff_8in_1_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ standoff_8in_2_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ standoff_8in_2_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ standoff_8in_3_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ standoff_8in_3_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ standoff_8in_4_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ standoff_8in_4_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ standoff_8in_5_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ standoff_8in_5_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ xtion_linkShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ xtion_linkShow\ Trail=0
+Robot\:\ Robot\ Model\ Link\ xtion_platformShow\ Axes=0
+Robot\:\ Robot\ Model\ Link\ xtion_platformShow\ Trail=0
+Tool\ 2D\ Nav\ GoalTopic=goal
+Tool\ 2D\ Pose\ EstimateTopic=initialpose
+Camera\ Type=rviz::XYOrbitViewController
+Camera\ Config=1.091 3.64076 2.60197 -0.571117 -2.26951e-07 -0.362999
+Property\ Grid\ State=selection=Robot Model.Enabled;expanded=.Global Options,Robot Model.Enabled;scrollpos=0,0;splitterpos=164,329;ispageselected=1
+[Display0]
+Name=Robot Model
+Package=rviz
+ClassName=rviz::RobotModelDisplay
+[Display1]
+Name=Grid
+Package=rviz
+ClassName=rviz::GridDisplay
Oops, something went wrong.

0 comments on commit 3bfbad4

Please sign in to comment.