Skip to content

Commit

Permalink
Merge branch '34-ros-package-repairs' of https://github.com/UBCAgroBo…
Browse files Browse the repository at this point in the history
…t/ROS into 34-ros-package-repairs
  • Loading branch information
vangeliq committed Dec 4, 2024
2 parents 97d73bc + a7ca7cf commit 1470dbe
Showing 1 changed file with 44 additions and 12 deletions.
56 changes: 44 additions & 12 deletions ros2_ws/src/python_workspace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@
# python_workspace package
This package contains nodes that gets image data, runs inference on them and also converts it into output needed for the extermination team.

## Node list
> **Note:** All example commands are run under the `ros2_ws` directory.

| Node Type | Description | Subscribes To | Publishes To | Example command |
|-------------------|-------------|---------------|-----------------------------------|-----------------|
| Picture Node | Captures and processes static images | - | `/input_image` | `ros2 run python_workspace picture_node --ros-args -p static_image_path:='./../assets/maize' -p frame_rate:=1`|
| Inference Node | Runs inference on input images | `/input_image` | - `/inference_out` <br> - `/output_img` | `ros2 run python_workspace inference_node --ros-args -p weights_path:='../models/maize/Maize.pt'`|
| Extermination Node| Processes inference results, displays and sends binary output for exttermination team | `/inference_out` | external binary | `ros2 run python_workspace extermination_node`|
## List of Topics and Data Types

### Node list
> **Note:** All example commands are run under the `ros2_ws` directory.
| Node Type | Subscribes To | Publishes To | Example command |
|-------------------|----------------|-----------------------------------|------|
| Picture Node | - | `/input_image` | `ros2 run python_workspace picture_node --ros-args -p static_image_path:='./../assets/maize' -p loop:=-1 -p frame_rate:=1`|
| Inference Node | `/input_image` | -`/inference_out` <br> - `/output_img` | `ros2 run python_workspace inference_node --ros-args -p weights_path:='../models/maize/Maize.pt'`|
| Extermination Node | `/inference_out` | external binary | `ros2 run python_workspace extermination_node`|

Other nodes are still a WIP

## List of Topics and Data Types
### List of Topics and Data Types

| Topic Name | Description | Data Type |
|-----------------------------|--------------------------------------|--------------------|
Expand All @@ -26,7 +25,7 @@ Other nodes are still a WIP



## Argument List
### Argument List

| Node Type | Argument Name | Argument Type | Sample Argument Value | Description |
|-------------------|---------------------|---------------|----------------------------------------------------|--------------------------------------------------|
Expand All @@ -37,9 +36,10 @@ Other nodes are still a WIP


## Additional information

### Compiling new Changes
```bash
colcon build --packages-select custom_interface python_workspace #not needed if the initial build uses --symlink-install
colcon build --packages-select custom_interface python_workspace
source install/setup.bash
```

Expand Down Expand Up @@ -70,3 +70,35 @@ To view the image topic :
1. go to plugins/visualization/image view. a new box will open up
2. click refresh topic
3. select the name of the image topic you want to see



## Testing the performance of the zed ros2 wrapper:

### using top:
ros2 node list
top -c -p $(pgrep -d',' -f name_of_command)


### using rqt:
install rqt with

`sudo apt install ros-humble-rqt*`
sudo apt install ros-${ROS_DISTRO}-rqt-top
to launch, just type `rqt` into the terminal


### visualizing the image topics
source: https://ros2jsguy.medium.com/4-data-visualization-using-ros-2-rviz2-pub-sub-communications-and-javascript-typescript-6e43cde75029




### looking at the rviz2 display
`ros2 launch zed_display_rviz2 display_zed_cam.launch.py camera_model:=zed2`

# Running:
```bash
source install/setup.bash
ros2 run python_workspace picture_node --ros-args -p static_image_path:=$IMAGE_FOLDER_PATH -p frame_rate:=1
```

0 comments on commit 1470dbe

Please sign in to comment.