diff --git a/src/hangar_sim/config/control/picknik_ur.ros2_control.yaml b/src/hangar_sim/config/control/picknik_ur.ros2_control.yaml index 995815a5f..80975c333 100644 --- a/src/hangar_sim/config/control/picknik_ur.ros2_control.yaml +++ b/src/hangar_sim/config/control/picknik_ur.ros2_control.yaml @@ -44,8 +44,8 @@ platform_velocity_controller: rear_right_wheel_command_joint_name: "rear_right_wheel" rear_left_wheel_command_joint_name: "rear_left_wheel" - kinematics.wheels_radius: 0.05 - kinematics.sum_of_robot_center_projection_on_X_Y_axis: 0.4704 + kinematics.wheels_radius: 0.0759 + kinematics.sum_of_robot_center_projection_on_X_Y_axis: 0.59 wheel_separation_multiplier: 1.0 wheel_radius_multiplier: 1.0 @@ -53,8 +53,8 @@ platform_velocity_controller: reference_timeout: 0.1 use_stamped_vel: False - pose_covariance_diagonal: [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 0.03] - twist_covariance_diagonal: [0.001, 0.001, 0.001, 1000000.0, 1000000.0, 0.03] + pose_covariance_diagonal: [0.1, 0.1, 1000000.0, 1000000.0, 1000000.0, 0.5] + twist_covariance_diagonal: [0.1, 0.1, 0.1, 1000000.0, 1000000.0, 0.5] cmd_vel_timeout: 0.5 @@ -105,8 +105,8 @@ platform_velocity_controller_nav2: rear_right_wheel_command_joint_name: "rear_right_wheel" rear_left_wheel_command_joint_name: "rear_left_wheel" - kinematics.wheels_radius: 0.05 - kinematics.sum_of_robot_center_projection_on_X_Y_axis: 0.4704 + kinematics.wheels_radius: 0.0759 + kinematics.sum_of_robot_center_projection_on_X_Y_axis: 0.59 wheel_separation_multiplier: 1.0 wheel_radius_multiplier: 1.0 @@ -282,7 +282,14 @@ force_torque_sensor_broadcaster: imu_sensor_broadcaster: ros__parameters: sensor_name: imu_site - frame_id: imu_link + frame_id: ridgeback_base_link + # Static covariance values (row-major 3x3 matrices) + # Orientation covariance (rad^2) + static_covariance_orientation: [0.001, 0.0, 0.0, 0.0, 0.001, 0.0, 0.0, 0.0, 0.001] + # Angular velocity covariance (rad/s)^2 + static_covariance_angular_velocity: [0.01, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.01] + # Linear acceleration covariance (m/s^2)^2 + static_covariance_linear_acceleration: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0] velocity_force_controller: diff --git a/src/hangar_sim/config/fuse/fuse.yaml b/src/hangar_sim/config/fuse/fuse.yaml index db8a0d8a1..fbc429d41 100644 --- a/src/hangar_sim/config/fuse/fuse.yaml +++ b/src/hangar_sim/config/fuse/fuse.yaml @@ -1,5 +1,5 @@ # Mobile base localization configuration using fuse -# Using 3D odometry model for wheel odometry-based pose estimation +# Ground vehicle state estimation: wheel odometry + IMU state_estimator: ros__parameters: # Fixed-lag smoother configuration @@ -15,7 +15,10 @@ state_estimator: mobile_base_motion: # Process noise for state variables # Order: x, y, z, roll, pitch, yaw, vx, vy, vz, vroll, vpitch, vyaw, ax, ay, az - process_noise_diagonal: [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 1.0, 1.0, 1.0] + # z, roll, pitch and their derivatives are near-zero for a ground robot. + #process_noise_diagonal: [0.25, 0.25, 0.00001, 0.00001, 0.00001, 0.25 + # -, 0.1, 0.1, 0.00001, 0.00001, 0.0001, 0.1, 0.0001, 0.0001, 0.00001] + process_noise_diagonal: [1.0, 1.0, 0.0001, 0.0001, 0.0001, 0.5, 0.5, 0.5, 0.0001, 0.0001, 0.0001, 0.25, 0.00001, 0.00001, 0.00001] sensor_models: initial_localization_sensor: @@ -25,32 +28,48 @@ state_estimator: wheel_odom_sensor: type: fuse_models::Odometry3D motion_models: [mobile_base_motion] + imu_sensor: + type: fuse_models::Imu3D + motion_models: [mobile_base_motion] initial_localization_sensor: publish_on_startup: true # Order: x, y, z, roll, pitch, yaw, vx, vy, vz, vroll, vpitch, vyaw, ax, ay, az initial_state: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] - initial_sigma: [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1] + # Order: x, y, z, roll, pitch, yaw, vx, vy, vz, vroll, vpitch, vyaw, ax, ay, az + # z and its derivatives start with very tight sigma — ground robot stays on the plane. + initial_sigma: [0.1, 0.1, 0.001, 0.01, 0.01, 0.1, 0.1, 0.1, 0.001, 0.01, 0.01, 0.1, 0.001, 0.001, 0.001] + # Wheel odometry — provides translation (x, y) and yaw + # Using differential mode because platform_velocity_controller/odom is + # wheel-integrated odometry that drifts over time. Differential mode fuses + # only the relative change between consecutive messages, preventing + # accumulated drift from corrupting the estimate. wheel_odom_sensor: - # Using /odom_reliable from QoS relay (bridges BEST_EFFORT to RELIABLE) - topic: /odom_reliable + topic: /platform_velocity_controller/odom queue_size: 10 - # 2D position from wheels (no z) - position_dimensions: ['x', 'y'] - # Heading only + pose_loss: + type: fuse_loss::HuberLoss + a: 1.0 + linear_velocity_loss: + type: fuse_loss::HuberLoss + a: 1.0 + position_dimensions: ['x', 'y', 'z'] orientation_dimensions: ['yaw'] - # Forward velocity - linear_velocity_dimensions: ['x'] - # Turn rate + linear_velocity_dimensions: ['x', 'y'] angular_velocity_dimensions: ['yaw'] - # Use relative constraints (pose changes rather than absolute poses) differential: true - # Covariances - use large values for unused dimensions - # Order: x, y, z, roll, pitch, yaw - pose_covariance_diagonal: [0.05, 0.05, 1e9, 1e9, 1e9, 0.05] - # Order: vx, vy, vz, vroll, vpitch, vyaw - twist_covariance_diagonal: [0.05, 1e9, 1e9, 1e9, 1e9, 0.05] + independent: false + use_twist_covariance: true + + # IMU sensor — provides orientation and yaw rate + # - Roll/pitch/yaw orientation (absolute, covariance 0.001 vs wheel odom 0.5) + # - Yaw angular velocity from gyroscope + imu_sensor: + topic: /imu_sensor_broadcaster/imu_reliable + orientation_dimensions: ['roll', 'pitch', 'yaw'] + angular_velocity_dimensions: ['yaw'] + queue_size: 10 # Publish filtered odometry publishers: @@ -59,8 +78,8 @@ state_estimator: filtered_publisher: topic: 'odom_filtered' - base_link_frame_id: 'base_footprint' - base_link_output_frame_id: 'base_footprint' + base_link_frame_id: 'ridgeback_base_link' + base_link_output_frame_id: 'ridgeback_base_link' odom_frame_id: 'odom' map_frame_id: 'map' world_frame_id: 'odom' diff --git a/src/hangar_sim/description/front_left_wheel_link.xml b/src/hangar_sim/description/front_left_wheel_link.xml index f06fcf854..158b7346a 100644 --- a/src/hangar_sim/description/front_left_wheel_link.xml +++ b/src/hangar_sim/description/front_left_wheel_link.xml @@ -2,356 +2,232 @@ - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/hangar_sim/description/front_right_wheel_link.xml b/src/hangar_sim/description/front_right_wheel_link.xml index 38c6acce2..647208f44 100644 --- a/src/hangar_sim/description/front_right_wheel_link.xml +++ b/src/hangar_sim/description/front_right_wheel_link.xml @@ -2,356 +2,232 @@ - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/hangar_sim/description/hangar_scene.xml b/src/hangar_sim/description/hangar_scene.xml index a5c4d2e66..745bf9545 100644 --- a/src/hangar_sim/description/hangar_scene.xml +++ b/src/hangar_sim/description/hangar_scene.xml @@ -5,7 +5,13 @@ -