Skip to content

Commit

Permalink
Better documentation
Browse files Browse the repository at this point in the history
Readme
  • Loading branch information
Fireronin committed Aug 6, 2024
1 parent fca84ee commit 13d7574
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 13 deletions.
Binary file added doc/Images/GoalPoseBehaviour.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 49 additions & 12 deletions doc/UserGuide/PoseControl.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,74 @@
# Pose control

You can use the `ROS2PoseControl` component to control the robot or any arbitrary entity via ROS 2 position or tf messages.
You can use the `ROS2PoseControl` component to control the robot or any arbitrary entity via ROS 2 position or tf2 messages.

## Adding component
The ROS2PoseControl can be attached to the entity you wish to control.
If you would like to have collisions with a controlled robot, you can add a Rigid Body Component.
If so, set its mode to Kinematic.
This component will automatically disable physics component of controlled object and all it's children.

## Configuration

After adding the component, you should see a window like this:

![Pose control UI](../Images/PoseControlUI.png)

You can use this component in the following modes:

1. Using `PoseStamped` messages - the component listens to the selected topic of type [`geometry_msgs::PoseStamped`](https://docs.ros2.org/latest/api/geometry_msgs/msg/PoseStamped.html) and changes transform of the entity based on Pose received. The timestamp of the `PoseStamped` message is ignored and position is applied based on message arrival order.

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.
Firstly you will need to enable tracking and select the tacking mode.

Option | Description
--------| -----
Is Tracking | Turns this component on/off
Tracking Mode | Select the tracking mode
Topic for goal message | Standard topic configuration (only used in mode PoseMessages)

You can select one of two tracking modes, and in later sections additional configuration options are described.

### TF2

In this mode component will listen to [tf2](https://docs.ros.org/en/humble/Tutorials/Intermediate/Tf2/Introduction-To-Tf2.html) messages and will set pose of the controlled object to the transform between specified target and reference frame.

Option | Description
--------| -----
Reference Frame | Frame of the origin
Target Frame | Frame of the tractor (only used in mode TF2)
Reference Frame | Frame of the origin (only used in mode TF2)
Lock Z Axis | The Z axis will point up, preventing tilting

### Goal Pose

Option | Description
--------| -----
Reference Frame | Frame of the origin
Topic for goal message | Standard topic configuration (only used in mode PoseMessages)

In this mode component will listen to [`geometry_msgs::PoseStamped`](https://docs.ros2.org/latest/api/geometry_msgs/msg/PoseStamped.html) then it will resolve requests described in those messages in one of 4 ways as described in diagram bellow.
![Goal pose behavior](../Images/GoalPoseBehaviour.png)

**Important** For mode where transformation between Reference frame and provided frame is computed [tf2](https://docs.ros.org/en/humble/Tutorials/Intermediate/Tf2/Introduction-To-Tf2.html) describing such transformation must be published before.

### Start Offset Tag

Option | Description
--------| -----
Start Offset Tag | If specified, the robot will controlled with the offset of the tagged entity

If this is set, then on the scene there should be exactly one object that has that tag. Then transform of this offset will be used as an origin for all transform. It is recommended to put object with Start Offset Tag at the location corresponding to the location of Reference frame in the simulation. If not set default world origin will be used.

### Lock Z Axis

Option | Description
--------| -----
Lock Z Axis | The Z axis will point up, preventing tilting

If enabled rotation of the controlled object will be always such that it's Z axis will point up. This will prevent tilting and excessive shaking if the data used to control is noisy.

### Clamping to ground

Option | Description
--------| -----
Clamp to ground | The controlled entity will follow the collider under the robot.
Ground offset | The offset to the collider is applied when the `Clamp to ground` option is used.


## ImGui live options
This setting if enabled will force object to be always specified ground offset above the ground. This can be useful if the data was recorded on the slope and the simulation is on flat terrain or if data contains large drift in Z axis.


## ImGui live options (for developers)

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.
6 changes: 5 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,8 @@ TBD

# SensorDebug

A tool that allows to adjust frequency, activate and deactive sensor during game mode.
A tool that allows to adjust frequency, activate and deactive sensor during game mode.

# ROS2PoseControl

This gem introduces a component that allows for control for the pose of the objects using ROS2 messages. For detail documentation look [here](./doc/UserGuide/PoseControl.md).

0 comments on commit 13d7574

Please sign in to comment.