Skip to content

Commit

Permalink
docs: 📝 Add README
Browse files Browse the repository at this point in the history
  • Loading branch information
KhalilSelyan committed Dec 25, 2023
1 parent 11eea88 commit 391072a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 47 deletions.
77 changes: 30 additions & 47 deletions common/awf_vehicle_rviz_plugin/rviz_2d_overlay_plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,67 +5,50 @@ Plugin for displaying 2D overlays over the RViz2 3D scene.
Based on the [jsk_visualization](https://github.com/jsk-ros-pkg/jsk_visualization)
package, which is currently only released for ROS1, under the 3-Clause BSD license.

## Text Overlay
## Purpose

![Screenshot showing the robot velocity as an overlay above the RViz 3D Scene, as well as the expanded properties of the plugin](doc/screenshot_vel_overlay.png)
This plugin provides a visual and easy-to-understand display of vehicle speed, turn signal, steering status and gears.

Both the text itself and formatting options for the text overlay are specified in
the [OverlayText.msg message type](https://github.com/teamspatzenhirn/awf_2d_overlay_vehicle/blob/main/rviz_2d_overlay_msgs/msg/OverlayText.msg)
.
## Inputs / Outputs

### Alignment and Positioning
### Input

To allow easy positioning of the overlay along the edges of the rviz window, and to support multiple/dynamic window
sizes, the position is given by offsets from the respective border.
Depending on whether the `horizontal_alignment` is `LEFT`, `RIGHT` or `CENTER`,
the `horizontal_distance` field sets the distance to the left or right border, or the offset from center.
| Name | Type | Description |
| ---------------------------------------- | ------------------------------------------------------- | ---------------------------------- |
| `/vehicle/status/velocity_status` | `autoware_auto_vehicle_msgs::msg::VelocityReport` | The topic is vehicle twist |
| `/vehicle/status/turn_indicators_status` | `autoware_auto_vehicle_msgs::msg::TurnIndicatorsReport` | The topic is status of turn signal |
| `/vehicle/status/hazard_status` | `autoware_auto_vehicle_msgs::msg::HazardReport` | The topic is status of hazard |
| `/vehicle/status/steering_status` | `autoware_auto_vehicle_msgs::msg::SteeringReport` | The topic is status of steering |
| `/vehicle/status/gear_status` | `autoware_auto_vehicle_msgs::msg::GearReport` | The topic is status of gear |

For `LEFT` and `RIGHT` alignment, a distance of zero means that the text is aligned to the border without any gap,
a positive distance moves the overlay towards the center.
## Parameter

For `CENTER` alignment, a distance of zero means completely centered, positive values move the overlay towards the
bottom right of the window.
### Core Parameters

`TOP` and `BOTTOM` for the vertical alignment work just like `LEFT` and `RIGHT` in the horizontal case.
#### SignalDisplay

### Using a string topic
| Name | Type | Default Value | Description |
| ------------------------ | ------ | -------------------- | --------------------------------- |
| `property_width_` | int | 128 | Width of the plotter window [px] |
| `property_height_` | int | 128 | Height of the plotter window [px] |
| `property_left_` | int | 128 | Left of the plotter window [px] |
| `property_top_` | int | 128 | Top of the plotter window [px] |
| `property_signal_color_` | QColor | QColor(25, 255, 240) | Turn Signal color |

A simple coverter node (`rviz2d_from_string_node`) is provided which can covert `std_msgs/msg/String` to `rviz_2d_overlay_msgs/msg/OverlayText`. The working principle is simple, it subscribes to a `String` topic, publishes the content as an `OverlayText` and the other proeries can be set from ROS parameters or by overtaking it in RViz2.
## Assumptions / Known limits

A launch file which runs this node and sets the parameters may look something like:
TBD.

```py
from launch import LaunchDescription
from launch_ros.actions import Node
## Usage

def generate_launch_description():
return LaunchDescription([
Node(
package='awf_2d_overlay_vehicle',
executable='string_to_overlay_text',
name='string_to_overlay_text_1',
output='screen',
parameters=[
{"string_topic": "chatter"},
{"fg_color": "b"}, # colors can be: r,g,b,w,k,p,y (red,green,blue,white,black,pink,yellow)
],
),
])
1. Start rviz and select Add under the Displays panel.

```
![select_add](./assets/images/select_add.png)

In case a `/chatter` topic is needed this can be published with a single command:
2. Select any one of the tier4_vehicle_rviz_plugin and press OK.

```py
ros2 topic pub /chatter std_msgs/String "data: Hello world"
```
![select_vehicle_plugin](./assets/images/select_vehicle_plugin.png)

## Circular Gauge Overlay
3. Enter the name of the topic where you want to view the status.

![Screenshot showing the PieChartDisplay, a circular gauge](doc/screenshot_PieChartDisplay.png)

The `PieChartDisplay` is a rather boring pie chart, as it only displays a single value.
`PieChartDisplay` and "Circular Gauge" are used synonymously in this package.
The gauge allows displaying a
[std_msgs/Float32](https://github.com/ros2/common_interfaces/blob/rolling/std_msgs/msg/Float32.msg).
Formatting and positioning, as well as setting the maximum value is only possible in the display options inside rviz.
![select_topic_name](./assets/images/select_topic_name.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 391072a

Please sign in to comment.