diff --git a/src/robot_description/CMakeLists.txt b/src/robot_description/CMakeLists.txt new file mode 100644 index 0000000..5b5033e --- /dev/null +++ b/src/robot_description/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.5) +project(robot_description) + +find_package(ament_cmake REQUIRED) +find_package(urdf REQUIRED) + +install( + DIRECTORY launch urdf rviz + DESTINATION share/${PROJECT_NAME} +) + +ament_package() \ No newline at end of file diff --git a/src/robot_description/launch/description.launch.py b/src/robot_description/launch/description.launch.py new file mode 100644 index 0000000..5cdde4c --- /dev/null +++ b/src/robot_description/launch/description.launch.py @@ -0,0 +1,79 @@ +import os +from launch import LaunchDescription +from launch.actions import DeclareLaunchArgument +from launch.substitutions import LaunchConfiguration, Command, PathJoinSubstitution, EnvironmentVariable +from launch.conditions import IfCondition +from launch_ros.actions import Node +from launch_ros.substitutions import FindPackageShare +from launch_ros.parameter_descriptions import ParameterValue + +def generate_launch_description(): + robot_base = os.getenv('ROBOT_BASE', '2wd') + + urdf_path = PathJoinSubstitution( + [FindPackageShare('robot_description'), 'urdf/robots', f"{robot_base}.urdf.xacro"] + ) + + rviz_config_path = PathJoinSubstitution( + [FindPackageShare('robot_description'), 'rviz', 'description.rviz'] + ) + + return LaunchDescription([ + # Arguments + DeclareLaunchArgument( + name='urdf', + default_value=urdf_path, + description='URDF path', + ), + + DeclareLaunchArgument( + name='publish_joints', + default_value='true', + description='Launch joint_state_publisher', + ), + + DeclareLaunchArgument( + name='rviz', + default_value='false', + description='Launch rviz', + ), + + DeclareLaunchArgument( + name="use_sim_time", + default_value="false", + description="Use simulation (Gazebo) clock if true", + ), + + # Nodes + Node( + package='joint_state_publisher', + executable='joint_state_publisher', + name='joint_state_publisher', + condition=IfCondition(LaunchConfiguration('publish_joints')), + parameters=[{ + 'use_sim_time': LaunchConfiguration('use_sim_time') + }], + ), + + Node( + package='robot_state_publisher', + executable='robot_state_publisher', + name='robot_state_publisher', + output='screen', + parameters=[{ + 'use_sim_time': LaunchConfiguration('use_sim_time'), + 'robot_description': ParameterValue(Command(['xacro ', LaunchConfiguration('urdf')])) + }], + ), + + Node( + package='rviz2', + executable='rviz2', + name='rviz2', + condition=IfCondition(LaunchConfiguration('rviz')), + arguments=['-d', rviz_config_path], + parameters=[{ + 'use_sim_time': LaunchConfiguration('use_sim_time') + }], + ) + ]) diff --git a/src/robot_description/package.xml b/src/robot_description/package.xml new file mode 100644 index 0000000..bf98fc7 --- /dev/null +++ b/src/robot_description/package.xml @@ -0,0 +1,19 @@ + + + + robot_description + 0.0.0 + INSA Toulouse Description Package + Ronan Bonnet + Apache 2.0 + https://github.com/ClubRobotInsat/Info2025 + https://github.com/ClubRobotInsat/Info2025/issues + ament_cmake + joint_state_publisher + robot_state_publisher + rviz2 + xacro + + ament_cmake + + \ No newline at end of file diff --git a/src/robot_description/rviz/description.rviz b/src/robot_description/rviz/description.rviz new file mode 100644 index 0000000..a1ff5ae --- /dev/null +++ b/src/robot_description/rviz/description.rviz @@ -0,0 +1,142 @@ +Panels: + - Class: rviz_common/Displays + Help Height: 78 + Name: Displays + Property Tree Widget: + Expanded: ~ + Splitter Ratio: 0.5 + Tree Height: 793 +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: 0.8999999761581421 + 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 + base_footprint: + Alpha: 1 + Show Axes: false + Show Trail: false + base_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + Mass Properties: + Inertia: false + Mass: false + 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 + base_footprint: + Value: true + base_link: + Value: true + Marker Scale: 0.10000000149011612 + Name: TF + Show Arrows: true + Show Axes: true + Show Names: true + Tree: + base_footprint: + base_link: + {} + Update Interval: 0 + Value: true + - Class: rviz_default_plugins/Axes + Enabled: true + Length: 1 + Name: Axes + Radius: 0.0010000000474974513 + Reference Frame: + Value: true + Enabled: true + Global Options: + Background Color: 238; 238; 236 + Fixed Frame: base_footprint + 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 + Transformation: + Current: + Class: rviz_default_plugins/TF + Value: true + Views: + Current: + Class: rviz_default_plugins/Orbit + Distance: 0.5964717268943787 + 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.5003980398178101 + Target Frame: + Value: Orbit (rviz) + Yaw: 6.013586521148682 + Saved: ~ +Window Geometry: + Displays: + collapsed: false + Height: 1016 + Hide Left Dock: false + Hide Right Dock: false + QMainWindow State: 000000ff00000000fd000000010000000000000156000003a2fc0200000001fb000000100044006900730070006c006100790073010000003b000003a2000000c700ffffff00000624000003a200000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + Width: 1920 + X: 0 + Y: 27 diff --git a/src/robot_description/urdf/2wd.properties.xacro b/src/robot_description/urdf/2wd.properties.xacro new file mode 100644 index 0000000..d84df2e --- /dev/null +++ b/src/robot_description/urdf/2wd.properties.xacro @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/robot_description/urdf/inertial_macros.xacro b/src/robot_description/urdf/inertial_macros.xacro new file mode 100644 index 0000000..488de03 --- /dev/null +++ b/src/robot_description/urdf/inertial_macros.xacro @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/robot_description/urdf/parts/base/base.gazebo.xacro b/src/robot_description/urdf/parts/base/base.gazebo.xacro new file mode 100644 index 0000000..3875f27 --- /dev/null +++ b/src/robot_description/urdf/parts/base/base.gazebo.xacro @@ -0,0 +1,28 @@ + + + + + + + + 0.8392 0.6314 0.0 1.0 + + + 0.8392 0.6314 0.0 1.0 + + + 0.99 0.99 0.99 1.0 + + + 0.0 0.0 0.0 0.0 + + + + + false + + + + + + \ No newline at end of file diff --git a/src/robot_description/urdf/parts/base/base.urdf.xacro b/src/robot_description/urdf/parts/base/base.urdf.xacro new file mode 100644 index 0000000..0d1d1e8 --- /dev/null +++ b/src/robot_description/urdf/parts/base/base.urdf.xacro @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/robot_description/urdf/parts/wheels/caster_wheel.gazebo.xacro b/src/robot_description/urdf/parts/wheels/caster_wheel.gazebo.xacro new file mode 100644 index 0000000..7b1f644 --- /dev/null +++ b/src/robot_description/urdf/parts/wheels/caster_wheel.gazebo.xacro @@ -0,0 +1,9 @@ + + + + + 0.01 + 0.01 + + + \ No newline at end of file diff --git a/src/robot_description/urdf/parts/wheels/caster_wheel.urdf.xacro b/src/robot_description/urdf/parts/wheels/caster_wheel.urdf.xacro new file mode 100644 index 0000000..bfb4f0a --- /dev/null +++ b/src/robot_description/urdf/parts/wheels/caster_wheel.urdf.xacro @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/robot_description/urdf/parts/wheels/mecanum_wheel.gazebo.xacro b/src/robot_description/urdf/parts/wheels/mecanum_wheel.gazebo.xacro new file mode 100644 index 0000000..a0f9d2a --- /dev/null +++ b/src/robot_description/urdf/parts/wheels/mecanum_wheel.gazebo.xacro @@ -0,0 +1,17 @@ + + + + + + + 0.1764 0.4588 0.8509 1.0 + 0.1764 0.4588 0.8509 1.0 + 0.1764 0.4588 0.8509 1.0 + 0.0 0.0 0.0 0.0 + + + 0.01 + 0.01 + + + \ No newline at end of file diff --git a/src/robot_description/urdf/parts/wheels/mecanum_wheel.urdf.xacro b/src/robot_description/urdf/parts/wheels/mecanum_wheel.urdf.xacro new file mode 100644 index 0000000..e2cf417 --- /dev/null +++ b/src/robot_description/urdf/parts/wheels/mecanum_wheel.urdf.xacro @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/robot_description/urdf/parts/wheels/wheel.gazebo.xacro b/src/robot_description/urdf/parts/wheels/wheel.gazebo.xacro new file mode 100644 index 0000000..7cb34df --- /dev/null +++ b/src/robot_description/urdf/parts/wheels/wheel.gazebo.xacro @@ -0,0 +1,15 @@ + + + + + + + 0.1764 0.4588 0.8509 1.0 + 0.1764 0.4588 0.8509 1.0 + 0.1764 0.4588 0.8509 1.0 + 0.0 0.0 0.0 0.0 + + + + + \ No newline at end of file diff --git a/src/robot_description/urdf/parts/wheels/wheel.urdf.xacro b/src/robot_description/urdf/parts/wheels/wheel.urdf.xacro new file mode 100644 index 0000000..4d01274 --- /dev/null +++ b/src/robot_description/urdf/parts/wheels/wheel.urdf.xacro @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/robot_description/urdf/robots/2wd.urdf.xacro b/src/robot_description/urdf/robots/2wd.urdf.xacro new file mode 100644 index 0000000..c4786dd --- /dev/null +++ b/src/robot_description/urdf/robots/2wd.urdf.xacro @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/robot_description/urdf/sensors/depth_sensor.urdf.xacro b/src/robot_description/urdf/sensors/depth_sensor.urdf.xacro new file mode 100644 index 0000000..19619fd --- /dev/null +++ b/src/robot_description/urdf/sensors/depth_sensor.urdf.xacro @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.416 0.051 0.047 1.0 + 0.416 0.051 0.047 1.0 + 0.416 0.051 0.047 1.0 + 0.416 0.051 0.047 1.0 + + + + rgb(213,28,40) + + + + + + + + + + + + + + + + + + true + 30.0 + + 1.50098 + + 640 + 480 + R8G8B8 + + + + + /camera/camera_info:=/camera/color/camera_info + /camera/image_raw:=/camera/color/image_raw + /camera/points:=/camera/depth/color/points + /camera/depth/image_raw:=/camera/depth/image_rect_raw + + + + best_effort + + + + + 0.015 + 3.0 + 0.07 + camera_depth_link + 0.00000001 + 0.00000001 + 0.00000001 + 0.00000001 + 0.00000001 + + + + + + \ No newline at end of file diff --git a/src/robot_description/urdf/sensors/generic_laser.urdf.xacro b/src/robot_description/urdf/sensors/generic_laser.urdf.xacro new file mode 100644 index 0000000..f691c9b --- /dev/null +++ b/src/robot_description/urdf/sensors/generic_laser.urdf.xacro @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/robot_description/urdf/sensors/imu.gazebo.xacro b/src/robot_description/urdf/sensors/imu.gazebo.xacro new file mode 100644 index 0000000..db15d5f --- /dev/null +++ b/src/robot_description/urdf/sensors/imu.gazebo.xacro @@ -0,0 +1,28 @@ + + + + + true + + true + 20 + true + __default_topic__ + + + ~/out:=imu/data + + imu/data + imu_link + 10.0 + 0.0 + 0 0 0 + 0 0 0 + imu_link + false + + 0 0 0 0 0 0 + + + + \ No newline at end of file diff --git a/src/robot_description/urdf/sensors/imu.urdf.xacro b/src/robot_description/urdf/sensors/imu.urdf.xacro new file mode 100644 index 0000000..3efb3ed --- /dev/null +++ b/src/robot_description/urdf/sensors/imu.urdf.xacro @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/robot_description/urdf/sensors/laser.urdf.xacro b/src/robot_description/urdf/sensors/laser.urdf.xacro new file mode 100644 index 0000000..ad12f98 --- /dev/null +++ b/src/robot_description/urdf/sensors/laser.urdf.xacro @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.003 0.639 0.223 1.0 + 0.003 0.639 0.223 1.0 + 0.003 0.639 0.223 1.0 + 0.0 0.0 0.0 0.0 + + + + + + + + + + + + + true + ${update_rate} + 0 0 0 0 0 0 + false + + + + ${ray_count} + 1 + ${min_angle} + ${max_angle} + + + + ${min_range} + ${max_range} + 0.01 + + + + + ~/out:=${topic_name} + + sensor_msgs/LaserScan + true + ${update_rate} + ${topic_name} + ${frame_id} + sensor_msgs/LaserScan + + + + + \ No newline at end of file