Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update RAE Default App #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions rae-default/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Video Streams

This App uploads a DepthAI pipeline to RAE and streams each camera output to RobotHub.
This App launches robot class and uploads a DepthAI pipeline to RAE to stream each camera output to RobotHub.

You can easily replace with you desired sockets that what to be streamed in `streams` dictionary. Also for configuring the pipeline you can edit `build_pipeline()`, such as resolution, fps and more.
You can easily replace with you desired sockets that what to be streamed in `streams` dictionary. Also for configuring the pipeline you can edit `build_pipeline()`, such as resolution, fps and more. On how to work with Robot class, please refer to [RAE SDK Docs](https://docs-beta.luxonis.com/develop/use-with-ros/rae-sdk/).

## Requirements

- RAE or a RVC3 device.

## Usage

- Assign devices to the App and launch it, one stream will be started.
- Assign devices to the App and launch it.
8 changes: 4 additions & 4 deletions rae-default/robotapp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ config_version = "2.0"
configuration = []

[info]
name = "RAE Streaming Application"
description = "Streams all cameras"
name = "RAE Default App"
description = "Default App for RAE"

[runtime]
application = "src/app.py#Application"
workdir = "/app"
pre_launch = "export ROS_DOMAIN_ID=30\n. /opt/ros/$ROS_DISTRO/setup.sh\n. /ws/install/setup.sh && export LD_LIBRARY_PATH=/usr/local/lib/python3.10/dist-packages${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
pre_launch = "export ROS_DOMAIN_ID=30\n. /opt/ros/$ROS_DISTRO/setup.sh\n. /ws/install/setup.sh"
permissions = ["rae-peripherals"]

[runtime.frontend]
redirectToIndex = true

[runtime.runs_on]
type = "image"
name = "luxonis/rae-ros-robot:dai_ros_py_base"
name = "ghcr.io/luxonis/rae-ros:v0.2.0-humble"
Empty file removed rae-default/src/api/__init__.py
Empty file.
Empty file.
198 changes: 0 additions & 198 deletions rae-default/src/api/ros/ros2_manager.py

This file was deleted.

23 changes: 10 additions & 13 deletions rae-default/src/app.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import robothub
import time
import depthai as dai
import logging
import logging as log
from time import sleep
import threading


from src.robot.robot import Robot
from src.utils.logging import Log
from rae_sdk.robot import Robot

def build_pipeline(streams):
pipeline = dai.Pipeline()
Expand Down Expand Up @@ -53,31 +52,29 @@ def __init__(self):
super().__init__()
self.device = None
self.stream_handles = {}
self.available_apps = []
self.mutex=threading.Lock()
self.logger = Log()
self.robot = Robot(self.logger)
self.robot = None

def on_start(self):
if not robothub.DEVICES:
self.logger.error(
log.error(
"The default app requires an assigned device to run. "
"Please go to RobotHub, navigate to the app's page, "
"click the \"Reassign devices\" button and select a device."
)
self._stop(1)
self.logger.info("Starting the app...")
log.info("Starting the app...")
sleep(2)
self.logger.info("Starting streams...")
log.info("Starting streams...")
self.init_streams()
self.logger.info("Starting Robot")
self.robot.start()
log.info("Starting Robot")
self.robot = Robot()

def on_stop(self):
self.logger.info("Stopping the app...")
log.info("Stopping the app...")
self.robot.stop()
if self.device:
self.logger.info("Closing device")
log.info("Closing device")
self.device.close()

def init_streams(self):
Expand Down
Empty file removed rae-default/src/robot/__init__.py
Empty file.
14 changes: 0 additions & 14 deletions rae-default/src/robot/movement.py

This file was deleted.

81 changes: 0 additions & 81 deletions rae-default/src/robot/robot.py

This file was deleted.

Empty file removed rae-default/src/utils/__init__.py
Empty file.
Loading