Resurgence (PY2022)
Codebase for the Husky Robotics 2021-2022 rover Resurgence
Loading...
Searching...
No Matches
net::mc::tasks::CameraStreamTask Class Reference

This task is responsible for sending the camera streams to Mission Control over websocket. More...

#include <MissionControlTasks.h>

Inheritance diagram for net::mc::tasks::CameraStreamTask:
Collaboration diagram for net::mc::tasks::CameraStreamTask:

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.
 
- Public Member Functions inherited from util::AsyncTask< Clock >
 AsyncTask (const std::optional< std::string > &name=std::nullopt)
 Construct a new task.
 
 AsyncTask (const AsyncTask &)=delete
 
AsyncTaskoperator= (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.
 
- Protected Member Functions inherited from util::AsyncTask< Clock >
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.
 

Detailed Description

This task is responsible for sending the camera streams to Mission Control over websocket.

Member Function Documentation

◆ closeStream()

void net::mc::tasks::CameraStreamTask::closeStream ( const robot::types::CameraID & cam)

Stop streaming a camera to Mission Control.

Parameters
camThe camera to stop streaming.

◆ openStream()

void net::mc::tasks::CameraStreamTask::openStream ( const robot::types::CameraID & cam,
int fps )

Start streaming a new camera to Mission Control.

Parameters
camThe camera to stream.
fpsThe fps to stream at.

◆ task()

void net::mc::tasks::CameraStreamTask::task ( std::unique_lock< std::mutex > & lock)
overrideprotectedvirtual

The long-running task, overridden by client code.

If a task wants to stop itself, it can just return.

Parameters
lockThe 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 >.


The documentation for this class was generated from the following files: