Skip to content

Commit

Permalink
added tf_prefix to imu_sensor_broadcaster
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Delicat <[email protected]>
  • Loading branch information
delihus committed Nov 14, 2023
1 parent 539cd89 commit 976a6da
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions rosbot_controller/config/diff_drive_controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ simulation_ignition_ros_control:
/**/imu_broadcaster:
ros__parameters:
sensor_name: imu
# All transforms are overwritten in launch file due to the namespace argument
# frame_id: imu_link
tf_frame_prefix_enable: True
frame_id: imu_link
static_covariance_orientation: [1.9e-3, 0.0, 0.0, 0.0, 1.9e-3, 0.0, 0.0, 0.0, 1.9e-3] # Values taken from datasheet
static_covariance_angular_velocity: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0e-3] # Values measured experimentally
static_covariance_linear_acceleration: [6.4e-2, 0.0, 0.0, 2.2e-2, 0.0, 0.0, 0.0, 0.0, 0.0] # Values measured experimentally
Expand Down
4 changes: 2 additions & 2 deletions rosbot_controller/config/mecanum_drive_controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
/**/imu_broadcaster:
ros__parameters:
sensor_name: imu
# All transforms are overwritten in launch file due to the namespace argument
# frame_id: imu_link
tf_frame_prefix_enable: True
frame_id: imu_link
static_covariance_orientation: [1.9e-3, 0.0, 0.0, 0.0, 1.9e-3, 0.0, 0.0, 0.0, 1.9e-3] # Values taken from datasheet
static_covariance_angular_velocity: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0e-3] # Values based on diff_drive
static_covariance_linear_acceleration: [6.4e-2, 0.0, 0.0, 2.2e-2, 0.0, 0.0, 0.0, 0.0, 0.0] # Values based on diff_drive
Expand Down
9 changes: 8 additions & 1 deletion rosbot_controller/launch/controller.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def generate_launch_description():
default_value="",
description="Namespace for all topics and tfs",
)
namespace_tf_prefix = PythonExpression(
["''", " if '", namespace, "' == '' ", "else ", "'", namespace, "_'"]
)

mecanum = LaunchConfiguration("mecanum")
declare_mecanum_arg = DeclareLaunchArgument(
Expand Down Expand Up @@ -133,7 +136,11 @@ def generate_launch_description():
robot_description,
robot_controllers,
# imu_broadcaster frame_id override
{"frame_id": LaunchConfiguration("imu_frame", default=[namespace, "_imu_link"])},
{
"frame_id": LaunchConfiguration(
"imu_frame", default=[namespace_tf_prefix, "imu_link"]
)
},
{
"tf_frame_prefix": LaunchConfiguration(
"rosbot_base_tf_frame_prefix", default=[namespace]
Expand Down

0 comments on commit 976a6da

Please sign in to comment.