Add gemini 335 336 urdf

This commit is contained in:
Joe Dong
2024-06-11 16:41:46 +08:00
parent b3861ed60d
commit 10148df62e
18 changed files with 454 additions and 20 deletions
+9 -20
View File
@@ -1,25 +1,14 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.5)
project(orbbec_description)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# find dependencies
find_package(ament_cmake REQUIRED)
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# uncomment the line when a copyright and license is not present in all source files
#set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# uncomment the line when this package is not in a git repo
#set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
# Install files
install(DIRECTORY
launch
meshes
rviz
urdf
DESTINATION share/${PROJECT_NAME})
ament_package()
ament_package()
+33
View File
@@ -0,0 +1,33 @@
# Copyright 2023 Intel Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import xacro
import tempfile
def to_urdf(xacro_path, parameters=None):
"""Convert the given xacro file to URDF file.
* xacro_path -- the path to the xacro file
* parameters -- to be used when xacro file is parsed.
"""
with tempfile.NamedTemporaryFile(prefix="%s_" % os.path.basename(xacro_path), delete=False) as xacro_file:
urdf_path = xacro_file.name
# open and process file
doc = xacro.process_file(xacro_path, mappings=parameters)
# open the output file
with open(urdf_path, 'w') as urdf_file:
urdf_file.write(doc.toprettyxml(indent=' '))
return urdf_path
@@ -0,0 +1,55 @@
# Copyright 2023 Intel Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# /* Author: Doron Hirshberg */
import os
import launch
from launch_ros.actions import Node
import launch.events
from ament_index_python.packages import get_package_share_directory
import sys
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
from launch_utils import to_urdf
def generate_launch_description():
available_urdf_files = [f for f in os.listdir(os.path.join(get_package_share_directory('orbbec_description'), 'urdf')) if f.startswith('test_')]
params = dict([aa for aa in [aa.split(':=') for aa in sys.argv] if len(aa) == 2])
if ('model' not in params or params['model'] not in available_urdf_files):
print('USAGE:')
print('ros2 launch orbbec_description view_model.launch.py model:=<model>')
print('Available argumants for <model> are as follows:')
print('\n'.join(available_urdf_files))
return launch.LaunchDescription()
rviz_config_dir = os.path.join(get_package_share_directory('orbbec_description'), 'rviz', 'urdf.rviz')
xacro_path = os.path.join(get_package_share_directory('orbbec_description'), 'urdf', params['model'])
urdf = to_urdf(xacro_path, {'use_nominal_extrinsics': 'true', 'add_plug': 'true'})
rviz_node = Node(
package='rviz2',
executable='rviz2',
name='rviz2',
output='screen',
arguments=['-d', rviz_config_dir],
parameters=[{'use_sim_time': False}]
)
model_node = Node(
name='model_node',
package='robot_state_publisher',
executable='robot_state_publisher',
namespace='',
output='screen',
arguments=[urdf]
)
return launch.LaunchDescription([rviz_node, model_node])
View File
@@ -0,0 +1,325 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by
Stephen Brawner (brawner@gmail.com)
Commit Version: 1.6.0-4-g7f85cfe Build Version: 1.6.7995.38578
For more information, please see http://wiki.ros.org/sw_urdf_exporter -->
<robot xmlns:xacro="http://ros.org/wiki/xacro" name="gemini_335_336">
<xacro:property name="mesh_path" value="package://orbbec_description/meshes/gemini335_336/" />
<link name="camera_link">
<inertial>
<origin xyz="0.00277269933215555 -1.06084680351007E-05 0.012801025085723" rpy="0 0 0" />
<mass value="0.0186143499064346" />
<inertia ixx="1.38922229644605E-05" ixy="-4.74617876641156E-09"
ixz="1.99175628166615E-08"
iyy="1.70686808598814E-06" iyz="-7.18717290327325E-09" izz="1.31766831843134E-05" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="${mesh_path}camera_link.STL" />
</geometry>
<material name="">
<color rgba="1 1 1 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="${mesh_path}camera_link.STL" />
</geometry>
</collision>
</link>
<link name="camera_bottom_screw_frame">
<inertial>
<origin xyz="0.00255168206289301 -0.00123934714960528 0.0118889875786098" rpy="0 0 0" />
<mass value="0.00564476880678651" />
<inertia ixx="3.07690693820862E-06" ixy="-1.85045956307764E-08"
ixz="-9.2792327175816E-09"
iyy="2.27632852811487E-07" iyz="1.65233162864392E-08" izz="2.93985735090777E-06" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="${mesh_path}camera_bottom_screw_frame.STL" />
</geometry>
<material name="">
<color rgba="0.792156862745098 0.819607843137255 0.933333333333333 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="${mesh_path}camera_bottom_screw_frame.STL" />
</geometry>
</collision>
</link>
<joint name="camera_bottom_screw_frame_joint" type="fixed">
<origin xyz="0 0 0" rpy="0 0 0" />
<parent link="camera_link" />
<child link="camera_bottom_screw_frame" />
<axis xyz="0 0 0" />
</joint>
<link name="camera_infra_1_frame">
<inertial>
<origin xyz="-0.00158020887627678 -1.52683853303637E-08 -1.4860800305164E-07"
rpy="0 0 0" />
<mass value="0.000453168790516429" />
<inertia ixx="4.34108781911687E-09" ixy="-3.69655517007001E-13"
ixz="-1.45486421873185E-13"
iyy="4.84012226840139E-09" iyz="1.92888940614786E-14" izz="4.84044260907388E-09" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="${mesh_path}camera_infra_1_frame.STL" />
</geometry>
<material name="">
<color rgba="0.501960784313725 0.250980392156863 0.250980392156863 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="${mesh_path}camera_infra_1_frame.STL" />
</geometry>
</collision>
</link>
<joint name="camera_infra_1_joint" type="fixed">
<origin xyz="0.01587 -0.025 0.0125" rpy="0 0 0" />
<parent link="camera_bottom_screw_frame" />
<child link="camera_infra_1_frame" />
<axis xyz="0 0 0" />
</joint>
<link name="camera_infra_1_optical_frame">
<inertial>
<origin xyz="1.52683853338331E-08 1.48608003051636E-07 -0.00158020887627678" rpy="0 0 0" />
<mass value="0.000453168790516429" />
<inertia ixx="4.84012226840139E-09" ixy="1.92888940614797E-14"
ixz="3.69655517006993E-13"
iyy="4.84044260907388E-09" iyz="1.45486421873192E-13" izz="4.34108781911687E-09" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="${mesh_path}camera_infra_1_optical_frame.STL" />
</geometry>
<material name="">
<color rgba="0.501960784313725 0.250980392156863 0.250980392156863 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="${mesh_path}camera_infra_1_optical_frame.STL" />
</geometry>
</collision>
</link>
<joint name="camera_infra_1_optical_joint" type="fixed">
<origin xyz="0.01587 -0.025 0.0125" rpy="-1.5707963267949 0 -1.5707963267949" />
<parent link="camera_bottom_screw_frame" />
<child link="camera_infra_1_optical_frame" />
<axis xyz="0 0 0" />
</joint>
<link name="camera_infra2_frame">
<inertial>
<origin xyz="-0.00158020887627678 -1.52683853303637E-08 -1.48608003050581E-07"
rpy="0 0 0" />
<mass value="0.000453168790516429" />
<inertia ixx="4.34108781911687E-09" ixy="-3.69655517007898E-13"
ixz="-1.45486421873762E-13"
iyy="4.84012226840139E-09" iyz="1.92888940594506E-14" izz="4.84044260907389E-09" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="${mesh_path}camera_infra2_frame.STL" />
</geometry>
<material name="">
<color rgba="0.501960784313725 0.250980392156863 0.250980392156863 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="${mesh_path}camera_infra2_frame.STL" />
</geometry>
</collision>
</link>
<joint name="camera_infra2_joint" type="fixed">
<origin xyz="0.01587 0.025 0.0125" rpy="0 0 0" />
<parent link="camera_bottom_screw_frame" />
<child link="camera_infra2_frame" />
<axis xyz="0 0 0" />
</joint>
<link name="camera_infra2_optical_frame">
<inertial>
<origin xyz="1.52683853268942E-08 1.4860800305058E-07 -0.00158020887627678" rpy="0 0 0" />
<mass value="0.000453168790516429" />
<inertia ixx="4.84012226840139E-09" ixy="1.92888940594538E-14"
ixz="3.69655517007897E-13"
iyy="4.84044260907389E-09" iyz="1.45486421873764E-13" izz="4.34108781911687E-09" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="${mesh_path}camera_infra2_optical_frame.STL" />
</geometry>
<material name="">
<color rgba="0.501960784313725 0.250980392156863 0.250980392156863 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="${mesh_path}camera_infra2_optical_frame.STL" />
</geometry>
</collision>
</link>
<joint name="camera_infra2_optical_joint" type="fixed">
<origin xyz="0.01587 0.025 0.0125" rpy="-1.5707963267949 0 -1.5707963267949" />
<parent link="camera_bottom_screw_frame" />
<child link="camera_infra2_optical_frame" />
<axis xyz="0 0 0" />
</joint>
<link name="camera_color_frame">
<inertial>
<origin xyz="-0.00177079701156752 -2.20101367029782E-07 2.09893364599916E-07"
rpy="0 0 0" />
<mass value="0.000139779365329478" />
<inertia ixx="6.69130695410276E-10" ixy="-1.53742421247628E-13"
ixz="-2.28137695085953E-14"
iyy="6.11277085561398E-10" iyz="4.18921196289284E-14" izz="6.11078036871936E-10" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="${mesh_path}camera_color_frame.STL" />
</geometry>
<material name="">
<color rgba="0.501960784313725 0.250980392156863 0.250980392156863 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="${mesh_path}camera_color_frame.STL" />
</geometry>
</collision>
</link>
<joint name="camera_color_joint" type="fixed">
<origin xyz="0.017533 0.010995 0.012505" rpy="0 0 0" />
<parent link="camera_bottom_screw_frame" />
<child link="camera_color_frame" />
<axis xyz="0 0 0" />
</joint>
<link name="camera_color_optical_frame">
<inertial>
<origin xyz="2.20101367029782E-07 -2.09893364599916E-07 -0.00177079701156752"
rpy="0 0 0" />
<mass value="0.000139779365329478" />
<inertia ixx="6.11277085561398E-10" ixy="4.18921196289284E-14"
ixz="1.53742421247628E-13"
iyy="6.11078036871936E-10" iyz="2.28137695085953E-14" izz="6.69130695410276E-10" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="${mesh_path}camera_color_optical_frame.STL" />
</geometry>
<material name="">
<color rgba="0.501960784313725 0.250980392156863 0.250980392156863 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="${mesh_path}camera_color_optical_frame.STL" />
</geometry>
</collision>
</link>
<joint name="camera_color_optical_joint" type="fixed">
<origin xyz="0.017533 0.010995 0.012505" rpy="-1.5707963267949 0 -1.5707963267949" />
<parent link="camera_bottom_screw_frame" />
<child link="camera_color_optical_frame" />
<axis xyz="0 0 0" />
</joint>
<link name="camera_depth_frame">
<inertial>
<origin xyz="-0.00158020887627678 -1.52683853338331E-08 -1.48608003051662E-07"
rpy="0 0 0" />
<mass value="0.000453168790516429" />
<inertia ixx="4.34108781911687E-09" ixy="-3.69655517006982E-13"
ixz="-1.45486421873185E-13"
iyy="4.84012226840139E-09" iyz="1.92888940614707E-14" izz="4.84044260907388E-09" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="${mesh_path}camera_depth_frame.STL" />
</geometry>
<material name="">
<color rgba="0.501960784313725 0.250980392156863 0.250980392156863 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="${mesh_path}camera_depth_frame.STL" />
</geometry>
</collision>
</link>
<joint name="camera_depth_joint" type="fixed">
<origin xyz="0.01587 -0.025 0.0125" rpy="0 0 0" />
<parent link="camera_bottom_screw_frame" />
<child link="camera_depth_frame" />
<axis xyz="0 0 0" />
</joint>
<link name="camera_depth_optical_frame">
<inertial>
<origin xyz="1.52683853338331E-08 1.4860800305165E-07 -0.00158020887627678" rpy="0 0 0" />
<mass value="0.000453168790516429" />
<inertia ixx="4.84012226840139E-09" ixy="1.9288894061467E-14" ixz="3.69655517006976E-13"
iyy="4.84044260907388E-09" iyz="1.454864218732E-13" izz="4.34108781911687E-09" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="${mesh_path}camera_depth_optical_frame.STL" />
</geometry>
<material name="">
<color rgba="0.501960784313725 0.250980392156863 0.250980392156863 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="${mesh_path}camera_depth_optical_frame.STL" />
</geometry>
</collision>
</link>
<joint name="camera_depth_optical_joint" type="fixed">
<origin xyz="0.01587 -0.025 0.0125" rpy="-1.5707963267949 0 -1.5707963267949" />
<parent link="camera_bottom_screw_frame" />
<child link="camera_depth_optical_frame" />
<axis xyz="0 0 0" />
</joint>
</robot>
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner@gmail.com)
Commit Version: 1.6.0-4-g7f85cfe Build Version: 1.6.7995.38578
For more information, please see http://wiki.ros.org/sw_urdf_exporter -->
<robot name="gemini_335" xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:include filename="_gemini_335_336.urdf.xacro"/>
<!-- Define a virtual root link -->
<link name="base_link"/>
<!-- Connect the virtual root to the actual base link -->
<joint name="base_link_to_camera_link" type="fixed">
<parent link="base_link"/>
<child link="camera_link"/>
<origin xyz="0 0 0" rpy="0 0 0"/>
</joint>
</robot>
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner@gmail.com)
Commit Version: 1.6.0-4-g7f85cfe Build Version: 1.6.7995.38578
For more information, please see http://wiki.ros.org/sw_urdf_exporter -->
<robot name="gemini_336" xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:include filename="_gemini_335_336.urdf.xacro"/>
<!-- Define a virtual root link -->
<link name="base_link"/>
<!-- Connect the virtual root to the actual base link -->
<joint name="base_link_to_camera_link" type="fixed">
<parent link="base_link"/>
<child link="camera_link"/>
<origin xyz="0 0 0" rpy="0 0 0"/>
</joint>
</robot>