Skip to content

Commit

Permalink
added relay arg and node
Browse files Browse the repository at this point in the history
  • Loading branch information
ARK3r committed Jan 26, 2024
1 parent 0e04086 commit a0f15ef
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions example_11/bringup/launch/carlikebot.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,17 @@ def generate_launch_description():
description="Start RViz2 automatically with this launch file.",
)
)
declared_arguments.append(
DeclareLaunchArgument(
"relay_odometry_tf",
default_value="false",
description="Relay odometry TF from the steering controller to the TF tree.",
)
)

# Initialize Arguments
gui = LaunchConfiguration("gui")
relay_odometry_tf = LaunchConfiguration("relay_odometry_tf")

# Get URDF via xacro
robot_description_content = Command(
Expand Down Expand Up @@ -71,6 +79,7 @@ def generate_launch_description():
output="both",
remappings=[
("~/robot_description", "/robot_description"),
("/bicycle_steering_controller/odometry_tf", "/tf"),
],
)
robot_state_pub_ackermann_node = Node(
Expand Down Expand Up @@ -104,6 +113,14 @@ def generate_launch_description():
arguments=["bicycle_steering_controller", "--controller-manager", "/controller_manager"],
)

relay_node = Node(
package="topic_tools",
executable="relay",
name="relay_odometry_node",
arguments=["/bicycle_steering_controller/tf_odometry", "/tf"],
condition=IfCondition(relay_odometry_tf),
)

# Delay rviz start after `joint_state_broadcaster`
delay_rviz_after_joint_state_broadcaster_spawner = RegisterEventHandler(
event_handler=OnProcessExit(
Expand All @@ -124,6 +141,7 @@ def generate_launch_description():
control_node,
robot_state_pub_ackermann_node,
joint_state_broadcaster_spawner,
relay_node,
delay_rviz_after_joint_state_broadcaster_spawner,
delay_robot_controller_spawner_after_joint_state_broadcaster_spawner,
]
Expand Down

0 comments on commit a0f15ef

Please sign in to comment.