From: Erik Andresen Date: Sun, 11 Oct 2026 17:40:04 +0000 (+0200) Subject: Added urdf, generated by hermes/Qwen-3.8 X-Git-Url: https://defiant.homedns.org/gitweb/?a=commitdiff_plain;h=8be7c9c21f07320de663ba4844279906946365c2;p=a4wd3.git Added urdf, generated by hermes/Qwen-3.8 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index bd8f72a..3a44de7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,10 @@ install(DIRECTORY params DESTINATION share/${PROJECT_NAME}) install(DIRECTORY maps DESTINATION share/${PROJECT_NAME}) +install(DIRECTORY urdf + DESTINATION share/${PROJECT_NAME}) +install(DIRECTORY meshes + DESTINATION share/${PROJECT_NAME}) install(PROGRAMS scripts/cpu_temp_pub.py DESTINATION lib/${PROJECT_NAME}) if(BUILD_TESTING) diff --git a/launch/a4wd3_launch.py b/launch/a4wd3_launch.py index 72293ac..88eab0c 100644 --- a/launch/a4wd3_launch.py +++ b/launch/a4wd3_launch.py @@ -8,11 +8,13 @@ from launch_xml.launch_description_sources import XMLLaunchDescriptionSource from launch import LaunchDescription from launch.actions import IncludeLaunchDescription, DeclareLaunchArgument, EmitEvent, RegisterEventHandler, LogInfo from launch.events import matches_action +from launch.substitutions import LaunchConfiguration, PathJoinSubstitution, Command, FileContent +from launch.conditions import IfCondition from launch_ros.actions import Node, LifecycleNode from launch_ros.events.lifecycle import ChangeState from launch_ros.event_handlers import OnStateTransition -from launch.substitutions import LaunchConfiguration, PathJoinSubstitution -from launch.conditions import IfCondition +from launch_ros.parameter_descriptions import ParameterValue +from launch_ros.substitutions import FindPackageShare from lifecycle_msgs.msg import Transition # save map: ros2 run nav2_map_server map_saver_cli -f /mapfolder/mapfilename @@ -55,6 +57,16 @@ def generate_launch_description(): name='a4wd3_display', output="screen", ), + # URDF-based static frames (base_link -> laser, imu). Replaces the former + # tf_base_scan / tf_base_imu static_transform_publisher nodes (duplicate + # publishers of the same static TF cause conflicts). + Node( + package='robot_state_publisher', + executable='robot_state_publisher', + name='robot_state_publisher', + parameters=[{'robot_description': ParameterValue(FileContent(PathJoinSubstitution([FindPackageShare('a4wd3'), 'urdf', 'a4wd3.urdf'])), value_type=str)}], + output="screen" + ), Node( package='bno085_uart', executable='bno085', @@ -62,13 +74,8 @@ def generate_launch_description(): parameters=[{"port": "/dev/ttyS2"}], output="screen", ), - Node( - package='tf2_ros', - executable='static_transform_publisher', - name='tf_base_imu', - arguments = ['--x', '-0.02', '--y', '-0.013', '--roll', '3.1416', '--yaw', '0.0', '--frame-id', 'base_link', '--child-frame-id', 'imu'], - output="screen" - ), + # NOTE: base_link -> imu and base_link -> laser static transforms now come from + # robot_state_publisher (urdf/a4wd3.urdf) instead of static_transform_publisher. Node( condition=IfCondition(with_gps), package='tf2_ros', @@ -77,13 +84,7 @@ def generate_launch_description(): arguments = ['--x', '-0.04', '--y', '-0.035', '--frame-id', 'base_link', '--child-frame-id', 'gps'], output="screen" ), - Node( - package='tf2_ros', - executable='static_transform_publisher', - name='tf_base_scan', - arguments = ['--x', '0.08125', '--y', '0.07425', '--yaw', '3.141592653589793', '--frame-id', 'base_link', '--child-frame-id', 'laser'], - output="screen" - ), + # (tf_base_scan removed: base_link -> laser now comes from the URDF via robot_state_publisher) Node( package='robot_localization', executable='ekf_node', diff --git a/meshes/a4wd3_base_rviz.stl b/meshes/a4wd3_base_rviz.stl new file mode 100644 index 0000000..1fbb7cf Binary files /dev/null and b/meshes/a4wd3_base_rviz.stl differ diff --git a/meshes/rplidar_a2m4_decimated.stl b/meshes/rplidar_a2m4_decimated.stl new file mode 100644 index 0000000..d83d6b5 Binary files /dev/null and b/meshes/rplidar_a2m4_decimated.stl differ diff --git a/urdf/a4wd3.urdf b/urdf/a4wd3.urdf new file mode 100644 index 0000000..cf67184 --- /dev/null +++ b/urdf/a4wd3.urdf @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +