Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c84cc25
basic setup and partial driver.hpp impl
ToKine0 Oct 9, 2025
c7dc488
fix: initial build setup (driver skeleton)
ToKine0 Oct 15, 2025
977346a
feat(driver): add base implementation of am_driver
ToKine0 Oct 15, 2025
67e2b54
feat: add structs, decode_packet method
ToKine0 Oct 16, 2025
6f92cb4
feat: read_packet implementation
ToKine0 Oct 22, 2025
bd78976
feat: decode_packet implementation
ToKine0 Oct 22, 2025
c9f2a51
feat: report can be requested using request_report, get_report
ToKine0 Oct 23, 2025
725991d
feat: diagnostic mode implementation
ToKine0 Oct 26, 2025
5d7cacd
feat: possible implementation saving report in json file
ToKine0 Oct 26, 2025
f74a53b
feat: possible skeleton ros2 nodes
ToKine0 Oct 26, 2025
ca1bd6d
fix: missing .cpp
ToKine0 Oct 26, 2025
2e202ce
fix: missing .cpp
ToKine0 Oct 26, 2025
3003af0
feat: possible implementation of drone node
ToKine0 Oct 29, 2025
51c7d60
fix(driver): corrected indentation on while loop and starting impleme…
ToKine0 Oct 30, 2025
a7c246f
feat(): skeleton of nodes implementation
ToKine0 Oct 30, 2025
4e99ed4
fix(driver): fixed async_read
ToKine0 Oct 30, 2025
af9b47f
feat(driver): skeleton implementation of process_packet
ToKine0 Nov 2, 2025
50ebb7b
feat(driver): process_packet and append_bits implementation
ToKine0 Nov 5, 2025
01df9df
fix(driver): added two bits before full message in process_packet, to…
ToKine0 Nov 5, 2025
801c375
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 5, 2025
4b40075
fix: corrected code format
ToKine0 Nov 5, 2025
79dde41
fix(driver): from bit to hex, resolved format problem with while loop
ToKine0 Nov 9, 2025
964733b
feat(ros2): publish method implemention using process_packet()
ToKine0 Nov 9, 2025
8bc0aa5
feat: added main in ros2 nodes, removed last bit driver for future se…
ToKine0 Nov 12, 2025
d44320e
feat: skeleton of tdma hybrid implementation and sending based on typ…
ToKine0 Jan 5, 2026
86fe4f6
feat(driver): implemented the sending part, and started the receiving
ToKine0 Jan 6, 2026
975fe10
feat(driver): receiver logic skeleton
ToKine0 Jan 8, 2026
a941c7e
feat(driver): receiving implementation
ToKine0 Jan 9, 2026
88e499d
feat(ros2): adding skeleton of receiving and publishing function
ToKine0 Jan 9, 2026
876b7ec
fix(ros2): added publishing in the right topic
ToKine0 Jan 15, 2026
1751807
feat(TDMA): starting TDMA protcol
ToKine0 Jan 15, 2026
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
140 changes: 70 additions & 70 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,74 +12,74 @@
#
# See https://github.com/pre-commit/pre-commit

repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-case-conflict
- id: check-docstring-first
- id: check-merge-conflict
- id: check-symlinks
- id: check-xml
- id: check-yaml
args: ["--allow-multiple-documents"]
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
exclude_types: [rst]
- id: fix-byte-order-marker
- id: requirements-txt-fixer
# Python hooks
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.2
hooks:
- id: ruff-format
- id: ruff
name: ruff-isort
args: [
"--select=I",
"--fix"
]
- id: ruff
name: ruff-pyupgrade
args: [
"--select=UP",
"--fix"
]
- id: ruff
name: ruff-pydocstyle
args: [
"--select=D",
"--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D401",
"--fix",
]
stages: [pre-commit]
pass_filenames: true
- id: ruff
name: ruff-check
args: [
"--select=F,PT,B,C4,T20,S,N",
"--ignore=T201,N812,B006,S101,S311,S607,S603",
"--fix"
]
stages: [pre-commit]
pass_filenames: true
# C++ hooks
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v20.1.7
hooks:
- id: clang-format
args: [--style=file]
# Spellcheck in comments and docs
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
args: ['--write-changes', '--ignore-words-list=theses,fom']
# repos:
# # Standard hooks
# - repo: https://github.com/pre-commit/pre-commit-hooks
# rev: v5.0.0
# hooks:
# - id: check-added-large-files
# - id: check-ast
# - id: check-case-conflict
# - id: check-docstring-first
# - id: check-merge-conflict
# - id: check-symlinks
# - id: check-xml
# - id: check-yaml
# args: ["--allow-multiple-documents"]
# - id: debug-statements
# - id: end-of-file-fixer
# - id: mixed-line-ending
# - id: trailing-whitespace
# exclude_types: [rst]
# - id: fix-byte-order-marker
# - id: requirements-txt-fixer
# # Python hooks
# - repo: https://github.com/astral-sh/ruff-pre-commit
# rev: v0.12.2
# hooks:
# - id: ruff-format
# - id: ruff
# name: ruff-isort
# args: [
# "--select=I",
# "--fix"
# ]
# - id: ruff
# name: ruff-pyupgrade
# args: [
# "--select=UP",
# "--fix"
# ]
# - id: ruff
# name: ruff-pydocstyle
# args: [
# "--select=D",
# "--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D401",
# "--fix",
# ]
# stages: [pre-commit]
# pass_filenames: true
# - id: ruff
# name: ruff-check
# args: [
# "--select=F,PT,B,C4,T20,S,N",
# "--ignore=T201,N812,B006,S101,S311,S607,S603",
# "--fix"
# ]
# stages: [pre-commit]
# pass_filenames: true
# # C++ hooks
# - repo: https://github.com/pre-commit/mirrors-clang-format
# rev: v20.1.7
# hooks:
# - id: clang-format
# args: [--style=file]
# # Spellcheck in comments and docs
# - repo: https://github.com/codespell-project/codespell
# rev: v2.4.1
# hooks:
# - id: codespell
# args: ['--write-changes', '--ignore-words-list=theses,fom']

ci:
autoupdate_schedule: quarterly
# ci:
# autoupdate_schedule: quarterly
62 changes: 62 additions & 0 deletions acoustic_modem/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
cmake_minimum_required(VERSION 3.8)
project(acoustic_modem)

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 20)
endif()

find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
find_package(serial_driver REQUIRED)
find_package(io_context REQUIRED)
find_package(nlohmann_json REQUIRED)


include_directories(include)

#set(LIB_NAME ${PROJECT_NAME})

add_library(${PROJECT_NAME} SHARED
src/am_driver.cpp)


ament_target_dependencies(${PROJECT_NAME}
rclcpp
std_msgs
serial_driver
io_context
nlohmann_json
)

# Install library and headers
install(
TARGETS ${PROJECT_NAME}
EXPORT export_${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)


#target_link_libraries()

#install(TARGETS
#am_node
#DESTINATION lib/${PROJECT_NAME}
#)


install(
DIRECTORY include/
DESTINATION include
)


ament_package()

# if(BUILD_TESTING)
# find_package(ament_cmake_gtest REQUIRED)
# ament_add_gtest(test_driver test/test_driver.cpp)
# target_link_libraries(test_driver ${PROJECT_NAME})
# endif()
55 changes: 55 additions & 0 deletions acoustic_modem/include/am_base_node.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#ifndef AM_BASE_NODE.HPP
#define AM_BASE_NODE .HPP

#include <memory>
#include <rclcpp/rclcpp.hpp>
#include <std_msgs/msg/string.hpp>
#include "am_driver.hpp"

/**
* Creating two nodes, one for each system
* Initially implementing uni-directional communication:
* drone -> base station
*
* this one should have publisher and then through acoustic channel should read
* data
*
* (read_packet)
*/

class BaseNode : public rclcpp::Node {
public:
explicit BaseNode();

private:
/**
* initialize the connection by creating AcousticModemDriver object
*/
void init_connection();

void set_publishers();


void poll_and_publish_rx();

/**
* publish message in correct topic based by header type
*/
void publish_in_correct_topic();

/**
* extract header from message to publish it in the correct type
* shifts the message as before
*/
uint8 extract_type_and_shift(std::vector<uint8_t>& msg);

rclcpp::Publisher<std_msgs::msg::String>::SharedPtr data_1_;
rclcpp::Publisher<std_msgs::msg::String>::SharedPtr data_2_;
rclcpp::Publisher<std_msgs::msg::String>::SharedPtr data_3_;
rclcpp::Publisher<std_msgs::msg::String>::SharedPtr data_4_;
std::unique_ptr<AcousticModemDriver> base_modem_;
// std::string latest_;
rclcpp::TimerBase::SharedPtr timer_;
}

#endif
Loading