Skip to content

Commit 1971e7f

Browse files
authored
Added gz_ros2_control note to jetty too (#642)
Signed-off-by: Alejandro Hernandez Cordero <[email protected]>
1 parent 5039517 commit 1971e7f

File tree

3 files changed

+89
-17
lines changed

3 files changed

+89
-17
lines changed

harmonic/ros2_launch_gazebo.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ within this tag. Here's an example for launching Gazebo server:
3939
<arg name="container_name" default="ros_gz_container" />
4040
<arg name="create_own_container" default="False" />
4141
<arg name="use_composition" default="False" />
42-
<gz_server
42+
<gz_server
4343
world_sdf_file="$(var world_sdf_file)"
4444
world_sdf_string="$(var world_sdf_string)"
4545
container_name="$(var container_name)"
@@ -144,11 +144,11 @@ More info about `ros_gz_bridge` can be viewed [here](ros2_integration).
144144
More info about composition can be viewed [here](ros2_overview.md#composition).
145145

146146
## Further Considerations for ROS2 Control
147-
147+
148148
If you're planning to use `ros2_control` with Gazebo, please take a look at the [example launch files](https://github.com/ros-controls/gz_ros2_control/tree/rolling/gz_ros2_control_demos/launch) in the `gz_ros2_control` repository
149-
149+
150150
It is essential to publish the `/clock` topic for the `controller_manager` to function correctly:
151-
151+
152152
gz_bridge = Node(
153153
package="ros_gz_bridge",
154154
executable="parameter_bridge",
@@ -158,25 +158,24 @@ More info about composition can be viewed [here](ros2_overview.md#composition).
158158
}],
159159
output="screen",
160160
)
161-
162-
161+
163162
If you **do not** publish the `/clock` topic, the `controller_manager` will issue warnings or errors such as:
164-
163+
165164
[gazebo-1] [WARN] [1744219953.983130822] [controller_manager]: No clock received, using time argument instead! Check your node's clock configuration (use_sim_time parameter) and if a valid clock source is available.
166-
165+
167166
Timing Issues
168167
-------------
169-
168+
170169
By default, the `controller_manager` launched by `gz_ros2_control` has ``use_sim_time=true``. If for any reason this is set to ``false``, it will fall back to the system clock.
171-
170+
172171
This results in logs like:
173-
172+
174173
[gazebo-1] [INFO] [1744209678.974210234] [gz_ros_control]: Loading controller_manager
175174
[gazebo-1] [INFO] [1744209679.000651931] [controller_manager]: Using Steady (Monotonic) clock for triggering controller manager cycles.
176-
175+
177176
Eventually leading to a fatal error:
178-
177+
179178
[gazebo-1] terminate called after throwing an instance of 'std::runtime_error'
180179
[gazebo-1] what(): can't compare times with different time sources
181-
180+
182181
Ensure `use_sim_time` is correctly set to `true` when working with simulation time to avoid such mismatches.

ionic/ros2_launch_gazebo.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ within this tag. Here's an example for launching Gazebo server:
3939
<arg name="container_name" default="ros_gz_container" />
4040
<arg name="create_own_container" default="False" />
4141
<arg name="use_composition" default="False" />
42-
<gz_server
42+
<gz_server
4343
world_sdf_file="$(var world_sdf_file)"
4444
world_sdf_string="$(var world_sdf_string)"
4545
container_name="$(var container_name)"
@@ -143,3 +143,40 @@ In the above launch files you may notice that the `create_own_container` argumen
143143

144144
More info about `ros_gz_bridge` can be viewed [here](ros2_integration).
145145
More info about composition can be viewed [here](ros2_overview.md#composition).
146+
147+
## Further Considerations for ROS2 Control
148+
149+
If you're planning to use `ros2_control` with Gazebo, please take a look at the [example launch files](https://github.com/ros-controls/gz_ros2_control/tree/rolling/gz_ros2_control_demos/launch) in the `gz_ros2_control` repository
150+
151+
It is essential to publish the `/clock` topic for the `controller_manager` to function correctly:
152+
153+
gz_bridge = Node(
154+
package="ros_gz_bridge",
155+
executable="parameter_bridge",
156+
arguments=['/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock'],
157+
parameters=[{
158+
"qos_overrides./tf_static.publisher.durability": "transient_local"
159+
}],
160+
output="screen",
161+
)
162+
163+
If you **do not** publish the `/clock` topic, the `controller_manager` will issue warnings or errors such as:
164+
165+
[gazebo-1] [WARN] [1744219953.983130822] [controller_manager]: No clock received, using time argument instead! Check your node's clock configuration (use_sim_time parameter) and if a valid clock source is available.
166+
167+
Timing Issues
168+
-------------
169+
170+
By default, the `controller_manager` launched by `gz_ros2_control` has ``use_sim_time=true``. If for any reason this is set to ``false``, it will fall back to the system clock.
171+
172+
This results in logs like:
173+
174+
[gazebo-1] [INFO] [1744209678.974210234] [gz_ros_control]: Loading controller_manager
175+
[gazebo-1] [INFO] [1744209679.000651931] [controller_manager]: Using Steady (Monotonic) clock for triggering controller manager cycles.
176+
177+
Eventually leading to a fatal error:
178+
179+
[gazebo-1] terminate called after throwing an instance of 'std::runtime_error'
180+
[gazebo-1] what(): can't compare times with different time sources
181+
182+
Ensure `use_sim_time` is correctly set to `true` when working with simulation time to avoid such mismatches.

jetty/ros2_launch_gazebo.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ within this tag. Here's an example for launching Gazebo server:
3939
<arg name="container_name" default="ros_gz_container" />
4040
<arg name="create_own_container" default="False" />
4141
<arg name="use_composition" default="False" />
42-
<gz_server
42+
<gz_server
4343
world_sdf_file="$(var world_sdf_file)"
4444
world_sdf_string="$(var world_sdf_string)"
4545
container_name="$(var container_name)"
@@ -128,7 +128,6 @@ def generate_launch_description():
128128
return ld
129129
```
130130

131-
132131
## Launching with ros_gz_bridge
133132

134133
An example launch file for XML can be viewed [here](https://github.com/gazebosim/ros_gz/blob/jazzy/ros_gz_sim/launch/ros_gz_sim.launch)
@@ -143,3 +142,40 @@ In the above launch files you may notice that the `create_own_container` argumen
143142

144143
More info about `ros_gz_bridge` can be viewed [here](ros2_integration).
145144
More info about composition can be viewed [here](ros2_overview.md#composition).
145+
146+
## Further Considerations for ROS2 Control
147+
148+
If you're planning to use `ros2_control` with Gazebo, please take a look at the [example launch files](https://github.com/ros-controls/gz_ros2_control/tree/rolling/gz_ros2_control_demos/launch) in the `gz_ros2_control` repository
149+
150+
It is essential to publish the `/clock` topic for the `controller_manager` to function correctly:
151+
152+
gz_bridge = Node(
153+
package="ros_gz_bridge",
154+
executable="parameter_bridge",
155+
arguments=['/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock'],
156+
parameters=[{
157+
"qos_overrides./tf_static.publisher.durability": "transient_local"
158+
}],
159+
output="screen",
160+
)
161+
162+
If you **do not** publish the `/clock` topic, the `controller_manager` will issue warnings or errors such as:
163+
164+
[gazebo-1] [WARN] [1744219953.983130822] [controller_manager]: No clock received, using time argument instead! Check your node's clock configuration (use_sim_time parameter) and if a valid clock source is available.
165+
166+
Timing Issues
167+
-------------
168+
169+
By default, the `controller_manager` launched by `gz_ros2_control` has ``use_sim_time=true``. If for any reason this is set to ``false``, it will fall back to the system clock.
170+
171+
This results in logs like:
172+
173+
[gazebo-1] [INFO] [1744209678.974210234] [gz_ros_control]: Loading controller_manager
174+
[gazebo-1] [INFO] [1744209679.000651931] [controller_manager]: Using Steady (Monotonic) clock for triggering controller manager cycles.
175+
176+
Eventually leading to a fatal error:
177+
178+
[gazebo-1] terminate called after throwing an instance of 'std::runtime_error'
179+
[gazebo-1] what(): can't compare times with different time sources
180+
181+
Ensure `use_sim_time` is correctly set to `true` when working with simulation time to avoid such mismatches.

0 commit comments

Comments
 (0)