Resurgence (PY2022)
Codebase for the Husky Robotics 2021-2022 rover Resurgence
|
This task is responsible for sending the camera streams to Mission Control over websocket. More...
#include <MissionControlTasks.h>
Public Member Functions | |
CameraStreamTask (websocket::SingleClientWSServer &server) | |
void | openStream (const robot::types::CameraID &cam, int fps) |
Start streaming a new camera to Mission Control. | |
void | closeStream (const robot::types::CameraID &cam) |
Stop streaming a camera to Mission Control. | |
![]() | |
AsyncTask (const std::optional< std::string > &name=std::nullopt) | |
Construct a new task. | |
AsyncTask (const AsyncTask &)=delete | |
AsyncTask & | operator= (const AsyncTask &)=delete |
virtual void | start () |
Start the task. | |
virtual void | stop () |
Stop the task and wait for it to finish. | |
bool | isRunning () |
Check if the task is running. | |
Protected Member Functions | |
void | task (std::unique_lock< std::mutex > &lock) override |
The long-running task, overridden by client code. | |
![]() | |
bool | isRunningInternal () |
Version of AsyncTask::isRunning() that does no synchronization. | |
bool | wait_until (std::unique_lock< std::mutex > &lock, const std::chrono::time_point< Clock > &tp) |
Wait until the specified time point, or until the task has been stopped. | |
template<typename Rep, typename Period> | |
bool | wait_for (std::unique_lock< std::mutex > &lock, const std::chrono::duration< Rep, Period > &dur) |
Wait for a given duration, or until the task has been stopped. | |
void | wait_until_done (std::unique_lock< std::mutex > &lock) |
Wait until the task has been stopped. | |
void | notify () override |
Not for use by client code. | |
This task is responsible for sending the camera streams to Mission Control over websocket.
void net::mc::tasks::CameraStreamTask::closeStream | ( | const robot::types::CameraID & | cam | ) |
Stop streaming a camera to Mission Control.
cam | The camera to stop streaming. |
void net::mc::tasks::CameraStreamTask::openStream | ( | const robot::types::CameraID & | cam, |
int | fps ) |
Start streaming a new camera to Mission Control.
cam | The camera to stream. |
fps | The fps to stream at. |
|
overrideprotectedvirtual |
The long-running task, overridden by client code.
If a task wants to stop itself, it can just return.
lock | The lock on the private internal state of the AsyncTask. Client code should generally not use this except for the wait_until_xxx methods. |
Implements util::AsyncTask< Clock >.