-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d414e69
commit 77f70d0
Showing
14 changed files
with
277 additions
and
80 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
.devcontainer/devcontainer.json → .devcontainer/jetson/devcontainer.json
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,28 @@ | ||
// See this page for reference of options: https://containers.dev/implementors/json_reference | ||
{ | ||
"name": "x86", | ||
"image": "ghcr.io/tritonuas/obcpp:main", | ||
// enable when need to connect over USB to pixhawk | ||
// also: need to run obcpp with sudo or add tuas user to dialout group with | ||
// `sudo usermod -aG dialout tuas && newgrp && bash` | ||
// "runArgs": ["--device=/dev/ttyACM0"], | ||
|
||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
// Use bash instead ofk sh | ||
"terminal.integrated.defaultProfile.linux": "bash" | ||
}, | ||
"extensions": [ | ||
"shd101wyy.markdown-preview-enhanced", | ||
"ms-vscode.cpptools", | ||
"nick-dimeglio.family-guy-funny-moments", | ||
"twxs.cmake", | ||
"me-dutour-mathieu.vscode-github-actions" | ||
] | ||
} | ||
} | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "" | ||
} |
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,3 +1,3 @@ | ||
[submodule "protos"] | ||
path = protos | ||
url = git@github.com:tritonuas/protos.git | ||
url = https://github.com/tritonuas/protos.git |
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 |
---|---|---|
@@ -1,14 +1,47 @@ | ||
#ifndef INCLUDE_CAMERA_LUCID_HPP_ | ||
#define INCLUDE_CAMERA_LUCID_HPP_ | ||
|
||
#ifdef ARENA_SDK_INSTALLED | ||
// #ifdef ARENA_SDK_INSTALLED | ||
|
||
#include <memory> | ||
|
||
#include "camera/interface.hpp" | ||
|
||
class LucidCamera : public CameraInterface { | ||
// override all the camera connection interface functions | ||
public: | ||
LucidCamera(); | ||
~LucidCamera(); | ||
|
||
void connect(); | ||
bool isConnected(); | ||
|
||
void startTakingPictures(std::chrono::seconds interval) override; | ||
void stopTakingPictures() override; | ||
|
||
std::optional<ImageData> getLatestImage() override; | ||
std::queue<ImageData> getAllImages() override; | ||
|
||
private: | ||
static std::shared_mutex arenaSystemLock; | ||
static Arena::ISystem* pSystem; | ||
|
||
|
||
std::atomic_bool isConnected; | ||
|
||
std::atomic_bool isTakingPictures; | ||
|
||
void captureEvery(std::chrono::seconds interval); | ||
|
||
std::queue<ImageData> imageQueue; | ||
std::shared_mutex imageQueueLock; | ||
|
||
std::thread captureThread; | ||
|
||
ImageData takePicture(); | ||
std::shared_mutex imageQueueMut; | ||
|
||
}; | ||
|
||
#endif // ARENA_SDK_INSTALLED | ||
// #endif // ARENA_SDK_INSTALLED | ||
|
||
#endif // INCLUDE_CAMERA_LUCID_HPP_ |
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,24 +1,37 @@ | ||
#ifndef INCLUDE_CAMERA_MOCK_HPP_ | ||
#define INCLUDE_CAMERA_MOCK_HPP_ | ||
|
||
#include <thread> | ||
#include <memory> | ||
#include <shared_mutex> | ||
|
||
#include "camera/interface.hpp" | ||
|
||
class MockCamera : public CameraInterface { | ||
public: | ||
explicit MockCamera(CameraConfiguration config); | ||
~MockCamera() = default; | ||
~MockCamera(); | ||
|
||
void connect() override; | ||
bool verifyConnection() override; | ||
void takePicture() override; | ||
ImageData getLastPicture() override; | ||
bool takePictureForSeconds(int sec) override; | ||
void startTakingPictures(double intervalSec) override; | ||
bool isDoneTakingPictures() override; | ||
bool isConnected() override; | ||
|
||
void startTakingPictures(std::chrono::seconds interval) override; | ||
void stopTakingPictures() override; | ||
|
||
std::optional<ImageData> getLatestImage() override; | ||
std::queue<ImageData> getAllImages() override; | ||
|
||
private: | ||
std::unique_ptr<ImageData> lastPicture; | ||
std::atomic_bool isTakingPictures; | ||
|
||
void captureEvery(std::chrono::seconds interval); | ||
|
||
std::queue<ImageData> imageQueue; | ||
std::shared_mutex imageQueueLock; | ||
|
||
std::thread captureThread; | ||
|
||
ImageData takePicture(); | ||
}; | ||
|
||
#endif // INCLUDE_CAMERA_MOCK_HPP_ |
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,30 @@ | ||
#include "camera/lucid.hpp" | ||
|
||
#include <chrono> | ||
#include <thread> | ||
#include <optional> | ||
|
||
#include <loguru.hpp> | ||
|
||
#include "utilities/locks.hpp" | ||
|
||
LucidCamera::LucidCamera() { | ||
|
||
} | ||
|
||
LucidCamera::~LucidCamera() { | ||
|
||
} | ||
|
||
void LucidCamera::connect() { | ||
WriteLock lock(this->arenaSystemLock) | ||
pSystem = Arena::OpenSystem(); | ||
} | ||
|
||
bool LucidCamera::isConnected(); | ||
|
||
void LucidCamera::startTakingPictures(std::chrono::seconds interval) override; | ||
void LucidCamera::stopTakingPictures() override; | ||
|
||
std::optional<ImageData> LucidCamera::getLatestImage() override; | ||
std::queue<ImageData> LucidCamera::getAllImages() override; |
Oops, something went wrong.