Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ commands may use incompatible installations or incomplete environment state.
- Reuse existing launch patterns and substitutions. Keep launch argument,
parameter, topic, and namespace names consistent across launch files, config
files, and node declarations.
- When editing or creating launch files, consider whether there is a need for passing
through the `use_sim_time` parameter. Most packages should support simulation time.

## Configuration

Expand Down
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
4 changes: 3 additions & 1 deletion src/bitbots_misc/bitbots_bringup/launch/highlevel.launch
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@
</include>
</group>
<group if="$(var whistle_detector)">
<include file="$(find-pkg-share bitbots_whistle_detector)/launch/whistle_detector.launch"/>
<include file="$(find-pkg-share bitbots_whistle_detector)/launch/whistle_detector.launch">
<arg name="sim" value="$(var sim)"/>
</include>
</group>
<!-- launch localization or fake localization -->
<group if="$(var localization)">
Expand Down
3 changes: 3 additions & 0 deletions src/bitbots_misc/bitbots_diagnostic/launch/aggregator.launch
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?xml version="1.0"?>
<launch>
<arg name="sim" default="false" description="Whether to use simulation time" />

<node pkg="diagnostic_aggregator" exec="aggregator_node" args="--ros-args --log-level WARN">
<param from="$(find-pkg-share bitbots_diagnostic)/config/analyzers.yaml" />
<param name="use_sim_time" value="$(var sim)" />
</node>
</launch>

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<node name="robot_state_publisher" pkg="robot_state_publisher" exec="robot_state_publisher">
<param name="publish_frequency" value="100.0"/>
<param name="robot_description" value="$(command '$(find-exec xacro) $(find-pkg-share piplus_description)/urdf/pi_plus_22dof.urdf.xacro')"/>
<param name="use_sim_time" value="$(var sim)"/>
</node>

<include file="$(find-pkg-share bitbots_extrinsic_calibration)/launch/calibration.launch">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<launch>
<arg name="sim" default="false" description="Whether to use simulation time" />

<node pkg="bitbots_whistle_detector" exec="whistle_detector" name="bitbots_whistle_detector" output="screen">
<param name="use_sim_time" value="$(var sim)" />
</node>
</launch>
8 changes: 7 additions & 1 deletion src/lib/bitbots_tf_buffer/src/bitbots_tf_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,14 @@ class Buffer {
rcl_node_t *node_handle =
static_cast<rcl_node_t *>(reinterpret_cast<void *>(node.attr("handle").attr("pointer").cast<size_t>()));
const char *node_name = rcl_node_get_name(node_handle);

// inherit the use_sim_time parameter from the outer node
const bool use_sim_time = node.attr("get_parameter")("use_sim_time").attr("value").cast<bool>();
rclcpp::NodeOptions node_options;
node_options.parameter_overrides({rclcpp::Parameter("use_sim_time", use_sim_time)});

// create node with name <python_node_name>_tf
node_ = std::make_shared<rclcpp::Node>((std::string(node_name) + "_tf").c_str());
node_ = std::make_shared<rclcpp::Node>((std::string(node_name) + "_tf").c_str(), node_options);

// Get buffer duration from python duration
auto duration =
Expand Down
Loading