From 95f19f3e6539e0346e3fc87a271938c7aa13ab9b Mon Sep 17 00:00:00 2001 From: Jan Hernas <40989249+jasiex01@users.noreply.github.com> Date: Wed, 18 Oct 2023 13:10:59 +0200 Subject: [PATCH] Adjust description package to work in new Gazebo simulation (#5) * Add enviormental variable hooks * Adjust simulation xacro for new simulation * Macros.xacro cleanup * Addd surface element to wheels * Add custom topic name for joint state plugin * Fix gazebo launch warnings * Change bullet parameters * Update diff system plugin name * Update enviormental hooks * Remove joint prefix * Add imu system plugin * Bring back joint_prefix param * Add joints prefix param to all joints * Remove unnecessary link prefixes --- leo_description/CMakeLists.txt | 2 + .../hooks/gz_sim_resource_path.dsv | 1 + leo_description/urdf/macros.xacro | 333 ++++++++++-------- 3 files changed, 195 insertions(+), 141 deletions(-) create mode 100644 leo_description/hooks/gz_sim_resource_path.dsv diff --git a/leo_description/CMakeLists.txt b/leo_description/CMakeLists.txt index 0861db0..31ea79f 100644 --- a/leo_description/CMakeLists.txt +++ b/leo_description/CMakeLists.txt @@ -12,4 +12,6 @@ install( DESTINATION share/${PROJECT_NAME} ) +ament_environment_hooks("${CMAKE_CURRENT_SOURCE_DIR}/hooks/gz_sim_resource_path.dsv") + ament_package() diff --git a/leo_description/hooks/gz_sim_resource_path.dsv b/leo_description/hooks/gz_sim_resource_path.dsv new file mode 100644 index 0000000..4426101 --- /dev/null +++ b/leo_description/hooks/gz_sim_resource_path.dsv @@ -0,0 +1 @@ +prepend-non-duplicate;IGN_GAZEBO_RESOURCE_PATH;share; \ No newline at end of file diff --git a/leo_description/urdf/macros.xacro b/leo_description/urdf/macros.xacro index 61e0d27..9ac093e 100644 --- a/leo_description/urdf/macros.xacro +++ b/leo_description/urdf/macros.xacro @@ -231,7 +231,7 @@ + params="robot_ns:='''"> @@ -240,191 +240,242 @@ - 1e6 - 1.0 - 0.3 - 0.3 - 0.003 + + + + + 0.3 + 0.3 + + + 0.3 + 0.3 + 0.1 + + + + - 1e6 - 1.0 - 0.3 - 0.3 - 0.003 + + + + + 0.3 + 0.3 + + + 0.3 + 0.3 + 0.1 + + + + - 1e6 - 1.0 - 0.3 - 0.3 - 0.003 + + + + + 0.3 + 0.3 + + + 0.3 + 0.3 + 0.1 + + + + - 1e6 - 1.0 - 0.3 - 0.3 - 0.003 + + + + + 0.3 + 0.3 + + + 0.3 + 0.3 + 0.1 + + + + - 1e6 - 100.0 - 3.0 - 1.0 - 1 0 0 - 0.003 + + + + + 1.0 + 1.0 + 0 0 0 + + + 1 + 1 + 0.1 + + + + - 1e6 - 100.0 - 3.0 - 1.0 - 1 0 0 - 0.003 + + + + + 1.0 + 1.0 + 0 0 0 + + + 1 + 1 + 0.1 + + + + - 1e6 - 100.0 - 3.0 - 1.0 - 1 0 0 - 0.003 + + + + + 1.0 + 1.0 + 0 0 0 + + + 1 + 1 + 0.1 + + + + - 1e6 - 100.0 - 3.0 - 1.0 - 1 0 0 - 0.003 + + + + + 1.0 + 1.0 + 0 0 0 + + + 1 + 1 + 0.1 + + + + - - true - 30.0 - false - - 1.9 - - 640 - 480 - R8G8B8 - - - 0.02 - 300 - - - gaussian - 0.0 - 0.007 - - - -0.279817 - 0.060321 - 0.000487 - 0.000310 - 0.000000 -
0.5 0.5
-
-
- - ${robot_ns} - camera_optical_frame - + + + 1.9 + + 640 + 480 + R8G8B8 + + + 0.2 + 300 + + + gaussian + 0.0 + 0.007 + + + -0.279817 + 0.060321 + 0.000487 + 0.000310 + 0.000000 +
0.5 0.5
+
+
+ 1 + 30 + true + ${link_prefix}camera/image_raw + ${link_prefix}camera_frame
- + rocker_L_joint rocker_R_joint 100.0 + + + ${link_prefix}joint_states + + + + + 100 - - ${robot_ns} - imu/data_raw - ${link_prefix}imu_frame - 100.0 - 0.01 - false - + true + ${link_prefix}imu/data_raw + 1 + ${link_prefix}imu_frame - - - - gazebo_ros2_control/GazeboSystem - - - - - - - - - - -6 - 6 - - - - - - - - -6 - 6 - - - - - - - - -6 - 6 - - - - - - - - -6 - 6 - - - - - - - - - robot_description - robot_state_publisher - package://leo_description/config/controllers.yaml + + + wheel_FL_joint + wheel_FR_joint + wheel_RL_joint + wheel_RR_joint + 0.358 + 0.0625 + odom + ${link_prefix}base_footprint + 20 + ${link_prefix}cmd_vel + ${link_prefix}odom + ${link_prefix}tf + 2.5 + 3 + -2.5 + -3 -