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

Camera 4.0 #50

Draft
wants to merge 30 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9b7f68d
The docker-compose builds, so that has to count for something?
Hermanoid Oct 2, 2024
50bb546
The Github CI fun begins
Hermanoid Oct 9, 2024
6a83d81
Oops basestation is wierd
Hermanoid Oct 9, 2024
1c21ca0
deleted raylib build and shifted apt packages
Sodapop465 Oct 9, 2024
bf5199a
Merge branch 'docker_compose' of https://github.com/Colorado-School-o…
Sodapop465 Oct 9, 2024
ad401b8
YEET RAYLIB (sorry nora)
Hermanoid Oct 9, 2024
575975c
Many yeeting changes, need to be tested :)
Hermanoid Oct 9, 2024
084526b
I do believe the CI is cooking
Hermanoid Oct 23, 2024
f32d07b
Oops
Hermanoid Oct 23, 2024
96a6b7b
Yeet driverstation_ui (deleting code to make build pass 👍)
Hermanoid Oct 23, 2024
66cb6b8
Why is git submodules being dumb
Hermanoid Oct 23, 2024
2705722
GAH NOTHING WORKS
yameatmeyourdead Feb 6, 2025
9894fe4
add amd64 target
yameatmeyourdead Feb 6, 2025
fb4f607
Merge branch 'main' into fix-ci
yameatmeyourdead Feb 6, 2025
d9b9d8b
it builds?
yameatmeyourdead Feb 13, 2025
b5b8812
create dummy stream
yameatmeyourdead Feb 13, 2025
e6ca59b
fix to make it build on hardware
yameatmeyourdead Feb 13, 2025
4cdd9a5
Merge branch 'camera-4.0' of https://github.com/CSMRobotics/MATE into…
yameatmeyourdead Feb 13, 2025
f71d5e4
actually make the test server work
yameatmeyourdead Feb 13, 2025
ba63605
Merge branch 'camera-4.0' of https://github.com/CSMRobotics/MATE into…
yameatmeyourdead Feb 13, 2025
63cdec6
cameras actually work now. MIPI pipelines untested atm
yameatmeyourdead Feb 13, 2025
563b942
Replace old rov_cameras with new; some other "cleaning"
Hermanoid Feb 20, 2025
30cdc1a
Shuffling some images (untested teehee)
Hermanoid Feb 20, 2025
51bd70f
Fixed the amd build
Hermanoid Feb 20, 2025
d78fdc6
Fix merge conflicts between fix-ci and main
Hermanoid Feb 20, 2025
1953d12
Merge branch 'fix-ci' into camera-4.0
Hermanoid Feb 20, 2025
5a19220
Add gstreamer dependencies and get building
Hermanoid Feb 20, 2025
004eaef
removed submodules permanently, should fix CI warning
yameatmeyourdead Feb 21, 2025
835ab7a
thanks vim for vomiting swap files in my directories i really appreci…
yameatmeyourdead Feb 21, 2025
3d6a03f
lower latency streams and less cpu usage
yameatmeyourdead Mar 6, 2025
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: 0 additions & 6 deletions .gitmodules

This file was deleted.

16 changes: 8 additions & 8 deletions Dockerfile.rov
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM osrf/ros:humble-desktop-full
ARG BASE_IMAGE=osrf/ros:humble-desktop-full
FROM ${BASE_IMAGE}

ENV DEBIAN_FRONTEND noninteractive
ENV SHELL /bin/bash
Expand All @@ -16,17 +17,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
# install gstreamer
RUN add-apt-repository universe && apt-get update && \
apt-get install -y --no-install-recommends \
libgstreamer1.0-0 \
libgstreamer1.0-dev \
libgstreamer-plugins-bad1.0-0 \
libgstreamer-plugins-base1.0-0 \
libgstreamer-plugins-base1.0-dev \
libgstreamer1.0 \
libgstreamer1.0-dev \
libgstreamer-plugins-bad1.0-dev \
libgstreamer-plugins-good1.0-dev \
libgstreamer-plugins-base1.0-dev \
libgstrtspserver-1.0-dev \
libsrtp2-dev \
gstreamer1.0-rtsp \
libgtk-3-dev \
libgtk2.0-dev \
gstreamer1.0-x && \
# install v4l2
apt-get install -y libv4l-dev v4l-utils && \
apt-get install -y libopenjp2-7 \
libopenjp2-7-dev \
Expand Down
82 changes: 0 additions & 82 deletions Dockerfile.rov.amd64

This file was deleted.

19 changes: 6 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,21 @@ services:
- /run/systemd/system:/run/systemd/system
- /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket
- /sys:/sys:ro
- /usr/lib/gstreamer-1.0/:/usr/lib/gstreamer-1.0
- /dev:/dev
- /run/udev:/run/udev:ro
- /tmp/.X11-unix:/tmp/.X11-unix
- /usr/lib/gstreamer-1.0/:/usr/lib/gstreamer-1.0
- /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvcompositor.so:/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvcompositor.so
restart: "no"

rov_amd64:
extends:
service: rov
image: csmmaterobotics/rov:amd64
platform: linux/amd64
build:
context: .
dockerfile: Dockerfile.rov.amd64
platforms:
- linux/amd64
environment:
- DISPLAY=${DISPLAY}
- LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libgomp.so.1
# For future me when you're trying to set these variables:
# echo 'export DOCKER_USER="$(id -u):$(id -g)"' >> ~/.bash_profile
user: ${DOCKER_USER}
pid: host
ipc: host
args:
- BASE_IMAGE=osrf/ros:humble-desktop-full
volumes:
- /dev/shm:/dev/shm
- /bin/systemctl:/bin/systemctl
Expand Down
3 changes: 2 additions & 1 deletion libraries.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
OpenCV4 >= 4.2
Eigen3 >= 3.3.7
Eigen3 >= 3.3.7
libi2c >= 4.3
1 change: 0 additions & 1 deletion src/external/raygui
Submodule raygui deleted from 25c8c6
1 change: 0 additions & 1 deletion src/external/raylib
Submodule raylib deleted from ae50bf
1 change: 0 additions & 1 deletion src/external/vslam
Submodule vslam deleted from 4e6074
Empty file removed src/rov/.run_docker.sh.swo
Empty file.
70 changes: 28 additions & 42 deletions src/rov/rov_cameras/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,66 +1,52 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.8)
project(rov_cameras)

# Default to C99
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()

if(DEBUG_OUTPUT)
add_compile_definitions(DEBUG_OUTPUT=true)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rov_interfaces REQUIRED)
find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(cv_bridge REQUIRED)
find_package(compressed_image_transport REQUIRED)
find_package(OpenCV REQUIRED)

add_executable(rov_cameras src/main.cpp src/mjpeg_camera.cpp src/h264_camera.cpp src/camera_to_file.cpp)
find_package(PkgConfig REQUIRED)
pkg_search_module(GST REQUIRED gstreamer-1.0>=1.4
gstreamer-sdp-1.0>=1.4
gstreamer-video-1.0>=1.4
gstreamer-app-1.0>=1.4)
pkg_search_module(GST_RTSP REQUIRED gstreamer-rtsp-server-1.0)
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)

add_executable(rov_cameras src/cameras.cpp src/main.cpp)
target_include_directories(rov_cameras PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
${OpenCV_INCLUDE_DIRS})
ament_target_dependencies(
rov_cameras
"rclcpp"
"sensor_msgs"
"std_msgs"
"cv_bridge"
"compressed_image_transport"
$<INSTALL_INTERFACE:include>)
target_compile_features(rov_cameras PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17
target_include_directories(rov_cameras PRIVATE ${GST_INCLUDE_DIRS} ${GST_RTSP_INCLUDE_DIRS})
target_link_libraries(rov_cameras ${GST_LIBRARIES} ${GST_RTSP_LIBRARIES} gstrtsp-1.0 gstsdp-1.0 gstreamer-1.0 gio-2.0 gobject-2.0 glib-2.0)

ament_target_dependencies(rov_cameras
rclcpp
rov_interfaces
)

target_link_libraries(rov_cameras ${OpenCV_LIBS} udev pthread)

install(TARGETS rov_cameras
DESTINATION lib/${PROJECT_NAME})

install(DIRECTORY include/
DESTINATION include/)

install(DIRECTORY launch/
DESTINATION share/${PROJECT_NAME})
install(DIRECTORY config/
DESTINATION share/${PROJECT_NAME}/config)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# uncomment the line when a copyright and license is not present in all source files
#set(ament_cmake_copyright_FOUND TRUE)
# comment the line when a copyright and license is added to all source files
set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# uncomment the line when this package is not in a git repo
#set(ament_cmake_cpplint_FOUND TRUE)
# comment the line when this package is in a git repo and when
# a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()

Expand Down
File renamed without changes.
19 changes: 0 additions & 19 deletions src/rov/rov_cameras/include/rov_cameras/camera_to_file.hpp

This file was deleted.

50 changes: 50 additions & 0 deletions src/rov/rov_cameras/include/rov_cameras/cameras.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#ifndef CAMERAS_HPP
#define CAMERAS_HPP

#include "gst/gst.h"

#include <thread>
#include <unordered_map>
#include <cstdint>

#include <rclcpp/rclcpp.hpp>

enum class CameraSensor : uint8_t {
MIPI_0 = 0,
MIPI_1 = 1,
TEST = 255
};

class Camera {
public:
Camera() = default;
Camera(int argc, char** argv, CameraSensor sensorID);
private:
void run_rtsp_stream(int argc, char** argv, CameraSensor sensorID);

std::thread gst_rtsp_server_thread;
};

class CameraManager {
public:
static CameraManager* getInstance(int argc, char** argv);

bool addCamera(CameraSensor sensorID);
private:
CameraManager(int argc, char** argv);

int argc;
char** argv;

std::unordered_map<CameraSensor, Camera> cameras;
};

class CameraNode : public rclcpp::Node {
public:
CameraNode(int argc, char** argv);
private:
CameraManager* manager;
};


#endif
Loading