Skip to content

Commit 5c319ec

Browse files
[2505] Updated documentation of the ROS2PoseControl (#134)
Signed-off-by: Patryk Antosz <[email protected]> Co-authored-by: Jan Hanca <[email protected]>
1 parent 5934062 commit 5c319ec

File tree

4 files changed

+35
-16
lines changed

4 files changed

+35
-16
lines changed

Gems/ROS2PoseControl/gem.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"gem_name": "ROS2PoseControl",
3-
"version": "3.0.0",
3+
"version": "3.0.1",
44
"display_name": "ROS2PoseControl",
55
"license": "Apache-2.0",
66
"license_url": "https://opensource.org/licenses/Apache-2.0",

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Pointcloud asset was obtained from [potree](https://github.com/potree/potree).
192192

193193
# ROS2PoseControl
194194

195-
A utility gem that introduces a way to control robots in simulation as puppets with Pose messages or TFs.
195+
The utility gem enabling controlling robots in simulation as puppets with Pose messages or TFs. For a more detailed description, check the [PoseControl user guide](./doc/UserGuide/PoseControl.md).
196196

197197
# GeoJSONSpawner
198198

doc/Images/PoseControlUI.png

-21.4 KB
Loading

doc/UserGuide/PoseControl.md

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Pose control
22

3-
You can use the `ROS2PoseControl` component to control the robot or any arbitrary entity via ROS 2 position or tf messages.
3+
You can use the `ROS2PoseControl` component to control the robot or any arbitrary entity via ROS 2 position or TF messages.
44

55
## Adding component
6-
The ROS2PoseControl can be attached to the entity you wish to control.
6+
The `ROS2PoseControl` can be attached to the entity you wish to control.
77
If you would like to have collisions with a controlled robot, you can add a Rigid Body Component.
88
If so, set its mode to Kinematic.
99

@@ -19,19 +19,38 @@ You can use this component in the following modes:
1919

2020
2. Using the [tf2](https://docs.ros.org/en/humble/Tutorials/Intermediate/Tf2/Introduction-To-Tf2.html) messages - the component will look for the transform frame specified by you and use it to transform the entity.
2121

22-
Option | Description
23-
--------| -----
24-
Is Tracking | Turns this component on/off
25-
Tracking Mode | Select the tracking mode
26-
Topic for goal message | Standard topic configuration (only used in mode PoseMessages)
27-
Target Frame | Frame of the tractor (only used in mode TF2)
28-
Reference Frame | Frame of the origin (only used in mode TF2)
29-
Lock Z Axis | The Z axis will point up, preventing tilting
30-
Start Offset Tag | If specified, the robot will controlled with the offset of the tagged entity
31-
Clamp to ground | The controlled entity will follow the collider under the robot.
32-
Ground offset | The offset to the collider is applied when the `Clamp to ground` option is used.
22+
Option | Description |
23+
-----------------------------|----------------------------------------------------------------------------------|
24+
Initial pose restore policy | Select the pose restoring policy |
25+
Tracking Mode | Select the tracking mode |
26+
Topic for goal message | Standard topic configuration (only used in mode PoseMessages) |
27+
Target Frame | Frame of the controlled entity/prefab (only used in mode TF2) |
28+
Reference Frame | Frame of the origin (only used in mode TF2) |
29+
Lock Z Axis | The Z axis will point up, preventing tilting |
30+
Start Offset Tag | If specified, the robot will be controlled with the offset of the tagged entity |
31+
Clamp to ground | The controlled entity will follow the collider under the robot. |
32+
Ground offset | The offset to the collider is applied when the `Clamp to ground` option is used. |
3333

3434

3535
## ImGui live options
3636

37-
Using the ~ key, you can pull up ImGui options. There, you will see two toggles using which you can modify the `Is Tracking` and `Tracking mode` settings live.
37+
Using the `[Home]` key, you can pull up ImGui options. There, you will see two toggles using which you can modify the `Is Tracking` and `Tracking mode` settings live.
38+
39+
## Initial pose restoring
40+
The `ROS2PoseControl` component can manage and restore the local transforms of a controlled entity and all its children. This is useful when working with prefabs. When the component is activated, the initial local transforms are saved, defining the "initial pose," which represents the prefab's state immediately after spawning and before any physics interactions occur.
41+
The component supports three restoring policies:
42+
- `Never` - the initial pose will never be restored.
43+
- `Once` - the initial pose will be restored once after the first goal pose request to the `ROS2PoseControl`.
44+
- `Everytime` - the initial pose will be restored every time the `ROS2PoseControl` receives a goal pose request.
45+
46+
## Usage
47+
To use the `ROS2PoseControl` add it to an entity, that should be controlled (e.g., the root of the prefab), configure it according to your preferences (see [Configuration](#configuration)) and run GameMode or GameLauncher.
48+
### Tracking Mode Pose Messages
49+
If `ROS2PoseControl` component is configured to track `Pose Messages`, use the topic that has been set in the `Topic for control message` to send `geometry_msgs::msg::PoseStamped` messages with the desired pose.
50+
Example:
51+
```bash
52+
ros2 topic pub /goal_pose geometry_msgs/msg/PoseStamped '{header: {stamp: {sec: 0, nanosec: 0}, frame_id: ""}, pose: {position: {x: 10.0, y: 10.0, z: 40.0}, orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}}' -1
53+
```
54+
55+
### Tracking Mode TF
56+
If `ROS2PoseControl` component is configured to track `TF`, ensure that the frames defined in the `Target Frame` and `Reference Frame` fields are present in the scene, rosbag, or other environment to which ROS 2 has access. Additionally, both frames must be part of the same TF tree; otherwise, the component will not be able to calculate a lookup transform.

0 commit comments

Comments
 (0)