-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from pge23-24/main
add Launch files for vision
- Loading branch information
Showing
11 changed files
with
125 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,55 @@ | ||
# VISION_WS | ||
|
||
Cette documentation ne prent pas en compte Docker | ||
|
||
## Build | ||
## Utilisation | ||
|
||
Premier build : | ||
### Build | ||
|
||
```bash | ||
colcon build --packages-select py_pubsub_msgs --cmake-args -DPYTHON_EXECUTABLE=/usr/bin/python3 | ||
source scripts/build_vision_ws.sh | ||
``` | ||
|
||
Ensuite, celle ci suffit : | ||
### Lancement | ||
|
||
#### Traitement Yolo toutes les caméras | ||
|
||
```bash | ||
colcon build --packages-select py_pubsub_msgs | ||
bash scripts/run_all_camera_yolo.sh | ||
# ou | ||
ros2 launch py_pubsub launch_all_camera.py | ||
``` | ||
|
||
## Utilisation | ||
#### Display toutes les caméras | ||
|
||
Activer la venv : | ||
```bash | ||
source .venv/bin/activate | ||
bash scripts/run_all_display.sh | ||
# ou | ||
ros2 launch py_pubsub launch_all_camera.py | ||
``` | ||
|
||
Désactiver la venv : | ||
```bash | ||
deactivate | ||
``` | ||
#### Traitement Yolo sur une caméra | ||
|
||
Lancement script traitement caméra (entre 1 et 4): | ||
```bash | ||
bash run_camera_yolo.sh <num_cam> | ||
bash scripts/run_camera_yolo.sh <id> | ||
ros2 run py_pubsub camera --ros-args -p image_topic_id:=<id> | ||
``` | ||
|
||
Lancement script display caméra (entre 1 et 4): | ||
#### Display une caméra | ||
|
||
```bash | ||
bash run_display.sh <num_cam> | ||
bash scripts/run_display.sh <id> | ||
ros2 run py_pubsub display --ros-args -p image_topic_id:=<id> | ||
``` | ||
|
||
## Communication | ||
|
||
Les messages sont : | ||
* angles et classes + header : py_pubsub_msgs.msg ClassCoordinates | ||
* l'image au format standard ROS : sensor_msgs.msg Image | ||
## Prototype | ||
|
||
# Charger l'environnement ROS | ||
source /opt/ros/foxy/setup.bash | ||
Activer la venv : | ||
|
||
# Construire le package spécifié | ||
```bash | ||
colcon build --packages-select py_pubsub_msgs --cmake-args -DPYTHON_EXECUTABLE=/usr/bin/python3 | ||
colcon build --packages-select py_pubsub --cmake-args -DPYTHON_EXECUTABLE=/usr/bin/python3 | ||
source .venv/bin/activate | ||
``` | ||
|
||
source install/setup.bash | ||
Désactiver la venv : | ||
|
||
```bash | ||
deactivate | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source install/setup.bash | ||
|
||
ros2 launch py_pubsub launch_all_camera.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source install/setup.bash | ||
|
||
ros2 launch py_pubsub launch_all_display.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import launch | ||
from launch import LaunchDescription | ||
from launch_ros.actions import Node | ||
|
||
def generate_launch_description(): | ||
ld = LaunchDescription() | ||
|
||
for cam_id in range(1, 5): | ||
node = Node( | ||
package='py_pubsub', | ||
executable='camera_yolo', | ||
name=f'camera_yolo_{cam_id}', | ||
parameters=[ | ||
{"cam_id": cam_id} | ||
] | ||
) | ||
ld.add_action(node) | ||
|
||
return ld | ||
|
||
if __name__ == '__main__': | ||
generate_launch_description() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import launch | ||
from launch import LaunchDescription | ||
from launch_ros.actions import Node | ||
|
||
def generate_launch_description(): | ||
ld = LaunchDescription() | ||
|
||
for cam_id in range(1, 5): | ||
node = Node( | ||
package='py_pubsub', | ||
executable='display', | ||
name=f'display_{cam_id}', | ||
parameters=[ | ||
{"image_topic_id": cam_id} | ||
] | ||
) | ||
ld.add_action(node) | ||
|
||
return ld | ||
|
||
if __name__ == '__main__': | ||
generate_launch_description() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.