commit e938b6921f320f848256deecace5dee52f5bfcb2 Author: Yoo Hee Sung <145455299+hs-YOO12@users.noreply.github.com> Date: Thu Aug 27 11:04:29 2026 +0900 Initial commit of duru_urdf package Co-Authored-By: Claude Sonnet 5 diff --git a/config/display.rviz b/config/display.rviz new file mode 100644 index 0000000..e7136f0 --- /dev/null +++ b/config/display.rviz @@ -0,0 +1,237 @@ +Panels: + - Class: rviz_common/Displays + Help Height: 78 + Name: Displays + Property Tree Widget: + Expanded: + - /Global Options1 + - /Status1 + - /RobotModel1 + - /TF1 + Splitter Ratio: 0.5 + Tree Height: 617 + - Class: rviz_common/Selection + Name: Selection + - Class: rviz_common/Tool Properties + Expanded: + - /2D Goal Pose1 + - /Publish Point1 + Name: Tool Properties + Splitter Ratio: 0.5886790156364441 + - Class: rviz_common/Views + Expanded: + - /Current View1 + Name: Views + Splitter Ratio: 0.5 +Visualization Manager: + Class: "" + Displays: + - Alpha: 0.5 + Cell Size: 1 + Class: rviz_default_plugins/Grid + Color: 160; 160; 164 + Enabled: true + Line Style: + Line Width: 0.029999999329447746 + Value: Lines + Name: Grid + Normal Cell Count: 0 + Offset: + X: 0 + Y: 0 + Z: 0 + Plane: XY + Plane Cell Count: 10 + Reference Frame: + Value: true + - Alpha: 1 + Class: rviz_default_plugins/RobotModel + Collision Enabled: false + Description File: "" + Description Source: Topic + Description Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /robot_description + Enabled: true + Links: + All Links Enabled: true + Expand Joint Details: false + Expand Link Details: false + Expand Tree: false + Link Tree Style: Links in Alphabetic Order + back_motor_left_2: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + back_motor_right_2: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + back_wheel_left_2: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + back_wheel_right_2: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + base_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + front_motor_left_2: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + front_motor_right_2: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + front_wheel_left_2: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + front_wheel_right_2: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + Name: RobotModel + TF Prefix: "" + Update Interval: 0 + Value: true + Visual Enabled: true + - Class: rviz_default_plugins/TF + Enabled: true + Frame Timeout: 15 + Frames: + All Enabled: true + back_motor_left_2: + Value: true + back_motor_right_2: + Value: true + back_wheel_left_2: + Value: true + back_wheel_right_2: + Value: true + base_link: + Value: true + front_motor_left_2: + Value: true + front_motor_right_2: + Value: true + front_wheel_left_2: + Value: true + front_wheel_right_2: + Value: true + Marker Scale: 0.5 + Name: TF + Show Arrows: true + Show Axes: true + Show Names: false + Tree: + base_link: + back_motor_right_2: + back_wheel_right_2: + {} + back_wheel_left_2: + back_motor_left_2: + {} + front_motor_left_2: + front_wheel_left_2: + {} + front_motor_right_2: + front_wheel_right_2: + {} + Update Interval: 0 + Value: true + Enabled: true + Global Options: + Background Color: 48; 48; 48 + Fixed Frame: base_link + Frame Rate: 30 + Name: root + Tools: + - Class: rviz_default_plugins/Interact + Hide Inactive Objects: true + - Class: rviz_default_plugins/MoveCamera + - Class: rviz_default_plugins/Select + - Class: rviz_default_plugins/FocusCamera + - Class: rviz_default_plugins/Measure + Line color: 128; 128; 0 + - Class: rviz_default_plugins/SetInitialPose + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /initialpose + - Class: rviz_default_plugins/SetGoal + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /goal_pose + - Class: rviz_default_plugins/PublishPoint + Single click: true + Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /clicked_point + Transformation: + Current: + Class: rviz_default_plugins/TF + Value: true + Views: + Current: + Class: rviz_default_plugins/Orbit + Distance: 0.8402727246284485 + Enable Stereo Rendering: + Stereo Eye Separation: 0.05999999865889549 + Stereo Focal Distance: 1 + Swap Stereo Eyes: false + Value: false + Focal Point: + X: 0 + Y: 0 + Z: 0 + Focal Shape Fixed Size: true + Focal Shape Size: 0.05000000074505806 + Invert Z Axis: false + Name: Current View + Near Clip Distance: 0.009999999776482582 + Pitch: 0.6097970008850098 + Target Frame: + Value: Orbit (rviz) + Yaw: 0.5103846192359924 + Saved: ~ +Window Geometry: + Displays: + collapsed: false + Height: 846 + Hide Left Dock: false + Hide Right Dock: false + QMainWindow State: 000000ff00000000fd000000040000000000000156000002f4fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d000002f4000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f000002f4fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003d000002f4000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004420000003efc0100000002fb0000000800540069006d00650100000000000004420000000000000000fb0000000800540069006d006501000000000000045000000000000000000000023f000002f400000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Selection: + collapsed: false + Tool Properties: + collapsed: false + Views: + collapsed: false + Width: 1200 + X: 201 + Y: 69 diff --git a/duru_urdf_description/__init__.py b/duru_urdf_description/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/launch/display.launch.py b/launch/display.launch.py new file mode 100644 index 0000000..9513e7c --- /dev/null +++ b/launch/display.launch.py @@ -0,0 +1,64 @@ +from launch_ros.actions import Node +from launch import LaunchDescription +from launch.actions import DeclareLaunchArgument +from launch.substitutions import LaunchConfiguration +from launch.conditions import IfCondition, UnlessCondition +import xacro +import os +from ament_index_python.packages import get_package_share_directory + + +def generate_launch_description(): + share_dir = get_package_share_directory('duru_urdf_description') + + xacro_file = os.path.join(share_dir, 'urdf', 'duru_urdf.xacro') + robot_description_config = xacro.process_file(xacro_file) + robot_urdf = robot_description_config.toxml() + + rviz_config_file = os.path.join(share_dir, 'config', 'display.rviz') + + gui_arg = DeclareLaunchArgument( + name='gui', + default_value='True' + ) + + show_gui = LaunchConfiguration('gui') + + robot_state_publisher_node = Node( + package='robot_state_publisher', + executable='robot_state_publisher', + name='robot_state_publisher', + parameters=[ + {'robot_description': robot_urdf} + ] + ) + + joint_state_publisher_node = Node( + condition=UnlessCondition(show_gui), + package='joint_state_publisher', + executable='joint_state_publisher', + name='joint_state_publisher' + ) + + joint_state_publisher_gui_node = Node( + condition=IfCondition(show_gui), + package='joint_state_publisher_gui', + executable='joint_state_publisher_gui', + name='joint_state_publisher_gui' + ) + + rviz_node = Node( + package='rviz2', + executable='rviz2', + name='rviz2', + arguments=['-d', rviz_config_file], + output='screen' + ) + + return LaunchDescription([ + gui_arg, + robot_state_publisher_node, + joint_state_publisher_node, + joint_state_publisher_gui_node, + rviz_node + ]) diff --git a/launch/gazebo.launch.py b/launch/gazebo.launch.py new file mode 100644 index 0000000..11bee0c --- /dev/null +++ b/launch/gazebo.launch.py @@ -0,0 +1,73 @@ +from launch_ros.actions import Node +from launch_ros.substitutions import FindPackageShare +from launch import LaunchDescription +from launch.actions import IncludeLaunchDescription +from launch.launch_description_sources import PythonLaunchDescriptionSource +from launch.substitutions import PathJoinSubstitution +import os +import xacro +from ament_index_python.packages import get_package_share_directory + + +def generate_launch_description(): + share_dir = get_package_share_directory('duru_urdf_description') + + xacro_file = os.path.join(share_dir, 'urdf', 'duru_urdf.xacro') + robot_description_config = xacro.process_file(xacro_file) + robot_urdf = robot_description_config.toxml() + + robot_state_publisher_node = Node( + package='robot_state_publisher', + executable='robot_state_publisher', + name='robot_state_publisher', + parameters=[ + {'robot_description': robot_urdf} + ] + ) + + joint_state_publisher_node = Node( + package='joint_state_publisher', + executable='joint_state_publisher', + name='joint_state_publisher' + ) + + gazebo_server = IncludeLaunchDescription( + PythonLaunchDescriptionSource([ + PathJoinSubstitution([ + FindPackageShare('gazebo_ros'), + 'launch', + 'gzserver.launch.py' + ]) + ]), + launch_arguments={ + 'pause': 'true' + }.items() + ) + + gazebo_client = IncludeLaunchDescription( + PythonLaunchDescriptionSource([ + PathJoinSubstitution([ + FindPackageShare('gazebo_ros'), + 'launch', + 'gzclient.launch.py' + ]) + ]) + ) + + urdf_spawn_node = Node( + package='gazebo_ros', + executable='spawn_entity.py', + arguments=[ + '-entity', 'duru_urdf', + '-topic', 'robot_description' + ], + output='screen' + ) + + return LaunchDescription([ + robot_state_publisher_node, + joint_state_publisher_node, + gazebo_server, + gazebo_client, + urdf_spawn_node, + ]) diff --git a/meshes/base_link.stl b/meshes/base_link.stl new file mode 100644 index 0000000..4678765 Binary files /dev/null and b/meshes/base_link.stl differ diff --git a/meshes/fwl_1_1.stl b/meshes/fwl_1_1.stl new file mode 100644 index 0000000..00ec579 Binary files /dev/null and b/meshes/fwl_1_1.stl differ diff --git a/meshes/fwr_1_1.stl b/meshes/fwr_1_1.stl new file mode 100644 index 0000000..b4a43f6 Binary files /dev/null and b/meshes/fwr_1_1.stl differ diff --git a/meshes/imu_1.stl b/meshes/imu_1.stl new file mode 100644 index 0000000..57623c6 Binary files /dev/null and b/meshes/imu_1.stl differ diff --git a/meshes/lidar_1.stl b/meshes/lidar_1.stl new file mode 100644 index 0000000..5cce0fa Binary files /dev/null and b/meshes/lidar_1.stl differ diff --git a/meshes/rwl_1_1.stl b/meshes/rwl_1_1.stl new file mode 100644 index 0000000..f15973b Binary files /dev/null and b/meshes/rwl_1_1.stl differ diff --git a/meshes/rwr_1_1.stl b/meshes/rwr_1_1.stl new file mode 100644 index 0000000..ba2f4b4 Binary files /dev/null and b/meshes/rwr_1_1.stl differ diff --git a/package.xml b/package.xml new file mode 100644 index 0000000..fbf1ccd --- /dev/null +++ b/package.xml @@ -0,0 +1,24 @@ + + + +duru_urdf_description + 0.0.0 +The duru_urdf_description package + author + TODO: License declaration + + xacro + rviz2 + robot_state_publisher + joint_state_publisher + joint_state_publisher_gui + + ament_copyright + ament_flake8 + ament_pep257 + python3-pytest + + + ament_python + + diff --git a/resource/duru_urdf_description b/resource/duru_urdf_description new file mode 100644 index 0000000..e69de29 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..646a7ea --- /dev/null +++ b/setup.cfg @@ -0,0 +1,4 @@ +[develop] +script-dir=$base/lib/duru_urdf_description +[install] +install-scripts=$base/lib/duru_urdf_description diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..cc77d00 --- /dev/null +++ b/setup.py @@ -0,0 +1,31 @@ +from setuptools import setup +import os +from glob import glob + +package_name = 'duru_urdf_description' + +setup( + name=package_name, + version='0.0.0', + packages=[package_name], + data_files=[ + ('share/ament_index/resource_index/packages', + ['resource/' + package_name]), + ('share/' + package_name, ['package.xml']), + (os.path.join('share', package_name, 'launch'), glob('launch/*.launch.py')), + (os.path.join('share', package_name, 'urdf'), glob('urdf/*')), + (os.path.join('share', package_name, 'meshes'), glob('meshes/*')), + (os.path.join('share', package_name, 'config'), glob('config/*')) + ], + install_requires=['setuptools'], + zip_safe=True, + maintainer='author', + maintainer_email='todo@todo.com', + description='The ' + package_name + ' package', + license='TODO: License declaration', + tests_require=['pytest'], + entry_points={ + 'console_scripts': [ + ], + }, +) diff --git a/test/test_copyright.py b/test/test_copyright.py new file mode 100644 index 0000000..cc8ff03 --- /dev/null +++ b/test/test_copyright.py @@ -0,0 +1,23 @@ +# Copyright 2015 Open Source Robotics Foundation, Inc. +# +# 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. + +from ament_copyright.main import main +import pytest + + +@pytest.mark.copyright +@pytest.mark.linter +def test_copyright(): + rc = main(argv=['.', 'test']) + assert rc == 0, 'Found errors' diff --git a/test/test_flake8.py b/test/test_flake8.py new file mode 100644 index 0000000..27ee107 --- /dev/null +++ b/test/test_flake8.py @@ -0,0 +1,25 @@ +# Copyright 2017 Open Source Robotics Foundation, Inc. +# +# 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. + +from ament_flake8.main import main_with_errors +import pytest + + +@pytest.mark.flake8 +@pytest.mark.linter +def test_flake8(): + rc, errors = main_with_errors(argv=[]) + assert rc == 0, \ + 'Found %d code style errors / warnings:\n' % len(errors) + \ + '\n'.join(errors) diff --git a/test/test_pep257.py b/test/test_pep257.py new file mode 100644 index 0000000..b234a38 --- /dev/null +++ b/test/test_pep257.py @@ -0,0 +1,23 @@ +# Copyright 2015 Open Source Robotics Foundation, Inc. +# +# 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. + +from ament_pep257.main import main +import pytest + + +@pytest.mark.linter +@pytest.mark.pep257 +def test_pep257(): + rc = main(argv=['.', 'test']) + assert rc == 0, 'Found code style errors / warnings' diff --git a/urdf/duru_urdf.gazebo b/urdf/duru_urdf.gazebo new file mode 100644 index 0000000..b4b6899 --- /dev/null +++ b/urdf/duru_urdf.gazebo @@ -0,0 +1,59 @@ + + + + + + + + + + ${body_color} + 0.2 + 0.2 + true + true + + + + ${body_color} + 0.2 + 0.2 + true + + + + ${body_color} + 0.2 + 0.2 + true + + + + ${body_color} + 0.2 + 0.2 + true + + + + ${body_color} + 0.2 + 0.2 + true + + + + ${body_color} + 0.2 + 0.2 + true + + + + ${body_color} + 0.2 + 0.2 + true + + + diff --git a/urdf/duru_urdf.trans b/urdf/duru_urdf.trans new file mode 100644 index 0000000..b018ab9 --- /dev/null +++ b/urdf/duru_urdf.trans @@ -0,0 +1,48 @@ + + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + + transmission_interface/SimpleTransmission + + hardware_interface/EffortJointInterface + + + hardware_interface/EffortJointInterface + 1 + + + + diff --git a/urdf/duru_urdf.xacro b/urdf/duru_urdf.xacro new file mode 100644 index 0000000..5c68e6a --- /dev/null +++ b/urdf/duru_urdf.xacro @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/urdf/materials.xacro b/urdf/materials.xacro new file mode 100644 index 0000000..34d69f2 --- /dev/null +++ b/urdf/materials.xacro @@ -0,0 +1,8 @@ + + + + + + + +