Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BasedOnStyle: LLVM
16 changes: 16 additions & 0 deletions .github/workflows/cpp-formatter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: C++ Formatting Check

on: [push, pull_request]

jobs:
cpp_formatter:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Clang Formatter
uses: DoozyX/clang-format-lint-action@v0.18.1
with:
clangFormatVersion: 14
source: "src"
26 changes: 26 additions & 0 deletions .github/workflows/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: ci
on:
push:
branches:
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: sudo apt-get -y install doxygen
- run: pip install mkdocs-material
- run: pip install mkdoxy
- run: mkdocs gh-deploy --force
27 changes: 27 additions & 0 deletions .github/workflows/ros2_build_ros2_debian_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build Debian Packages (ROS2 Jazzy)
on:
workflow_dispatch:
release:
types: [created]
jobs:
build-debian-packages:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Install required packages
run: sudo apt-get update && sudo apt-get install libsdl2-dev -y
- name: Checkout this repository
uses: actions/checkout@v2.3.4
- name: Build Debian packages
uses: ichiro-its/ros2-build-debian-action@main
with:
ros2-distro: jazzy
- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
REPO_FULL=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
TAG_NAME=$(gh release view --repo "$REPO_FULL" --json tagName --jq ".tagName")

gh release upload "$TAG_NAME" package/*.deb --repo "$REPO_FULL"
37 changes: 37 additions & 0 deletions .github/workflows/ros2_jazzy_code_compiles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: ros2_jazzy_code_compiles

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch: {}

jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v3
- uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: jazzy

- name: Install required packages
# To compile and run the code we require cmake, ninja and opencv
run: sudo apt-get update && sudo apt-get install build-essential cmake ninja-build ros-jazzy-diagnostic-updater libsdl2-dev

- name: Install dependencies
working-directory: ${{ github.workspace }}
run: |
sudo rosdep init || true
rosdep update --rosdistro=jazzy

- name: Colcon build
working-directory: ${{ github.workspace }}
run: |
source /opt/ros/jazzy/setup.bash
colcon build
22 changes: 22 additions & 0 deletions .github/workflows/ros2_jazzy_code_compiles_windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: ROS2 Jazzy with Pixi on Windows

on:
push:
branches:
- main
pull_request:

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.8.3

- name: Run colcon build (Release Mode)
shell: cmd
run: pixi run build

32 changes: 32 additions & 0 deletions .github/workflows/ros2_jazzy_conda_package_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Create ROS2 Jazzy package on Linux

on:
workflow_dispatch:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Pixi
uses: prefix-dev/setup-pixi@v0.8.3

- name: Build package with Pixi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: pixi run bash -e {0}
run: |
source rattler/set_build_var.sh
rattler-build build --recipe rattler/recipe.yaml -c conda-forge -c https://prefix.dev/robostack-jazzy --package-format tar-bz2
- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
REPO_FULL=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
TAG_NAME=$(gh release view --repo "$REPO_FULL" --json tagName --jq ".tagName")

gh release upload "$TAG_NAME" output/linux-64/ros-jazzy-*.tar.bz2 --repo "$REPO_FULL"

56 changes: 56 additions & 0 deletions .github/workflows/ros2_jazzy_conda_package_win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Create ROS2 Jazzy package on Windows

on:
workflow_dispatch:
release:
types: [created]

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Pixi
uses: prefix-dev/setup-pixi@v0.8.3


- name: Build package with Pixi (Windows)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: pwsh
run: |
rattler/set_build_var.ps1
pixi run rattler-build build --recipe rattler/recipe.yaml -c conda-forge -c https://prefix.dev/robostack-jazzy --package-format tar-bz2


- name: Upload Windows Conda Package to GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: pwsh
run: |
$ErrorActionPreference = "Stop"

$repo = (gh repo view --json nameWithOwner | ConvertFrom-Json).nameWithOwner

$tag = gh release view --repo $repo --json tagName --jq ".tagName"

$pkg = Get-ChildItem "output/win-64/ros-jazzy-*.tar.bz2" |
Where-Object { $_.Extension -in ".bz2", ".conda" } |
Sort-Object LastWriteTime -Descending |
Select-Object -First 1

if (-not $pkg) {
Write-Error "❌ No conda package found in win-64."
}

if ($pkg.Name -like "*.tar.bz2") {
$renamed = $pkg.FullName -replace '\.tar.bz2$', '-win.tar.bz2'
Copy-Item $pkg.FullName $renamed
} else {
$renamed = $pkg.FullName
}

gh release upload $tag $renamed --repo $repo --clobber
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,19 @@
*.exe
*.out
*.app

# ROS2 build folders
build/
install/
log/


# Rattler build folders
output/

# IDE folders
.vscode/

# Pixi artifacts
pixi.lock
.pixi/
41 changes: 41 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
cmake_minimum_required(VERSION 3.1...3.14)
project(ti_iwr_pointcloud C CXX)

find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(sensor_msgs REQUIRED)

include(FetchContent)

FetchContent_Declare(
Serial
GIT_REPOSITORY https://github.com/ami-iit/serial_cpp.git
GIT_TAG v1.3.0
)
FetchContent_MakeAvailable(Serial)


add_executable(publish_node src/publish_node.cpp
src/packet_parser/packet_parser.cpp
src/packet_parser/serial_data_parser.cpp
src/packet_parser/serial_cmd_parser.cpp
src/packet_parser/tlv_parser.cpp)

ament_target_dependencies(publish_node
rclcpp
sensor_msgs
)
target_link_libraries(publish_node "${cpp_typesupport_target}" serial_cpp::serial_cpp)
target_include_directories(publish_node PUBLIC src/)

if(UNIX AND NOT APPLE) # Linux only
target_compile_options(publish_node PRIVATE -Wall)
endif()

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

ament_package()
6 changes: 6 additions & 0 deletions colcon.pkg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "ti_iwr_pointcloud",
"cmake-args":[
"-G Ninja"
]
}
62 changes: 62 additions & 0 deletions docs/about/implementation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# 🌟 **`publish_node` - Radar PointCloud Publisher**

Publishes 3D radar point cloud data as `sensor_msgs/PointCloud2` by interfacing with a custom radar parser (`PacketParser`). Ideal for integrating Texas Instruments radar sensors with ROS 2.

---

### ✅ Topics

| Topic | Type | Description |
|---------------------|----------------------------------|-----------------------------------------|
| `/radar_3d_points` | `sensor_msgs/msg/PointCloud2` | 3D radar point cloud with SNR as intensity |

---

### ⚙️ Parameters

| Name | Type | Default Value | Description |
|------------------|----------|------------------------------------------------|--------------------------------------------|
| `cfg_path` | string | `"../radar/cfg/cfg_default_30fps.cfg"` | Path to the radar configuration file |
| `cli_port` | string | `"/dev/pts/2"` | Serial port for radar CLI control |
| `cli_baudrate` | int | `115200` | Baudrate for the CLI port |
| `data_port` | string | `"/dev/pts/6"` | Serial port for radar data stream |
| `data_baudrate` | int | `921600` | Baudrate for the data port |
| `publish_topic` | string | `"/radar_3d_points"` | Topic name to publish the point cloud data |

---

### 📦 Message Notes

- `sensor_msgs/msg/PointCloud2` fields:
- `x`, `y`, `z`: Cartesian coordinates (float32)
- `intensity`: SNR value (float32), mapped from radar point's `snr`

---

### 🧩 Implementation Notes

- Built using **`rclcpp`**.
- Uses a **separate thread** for processing and publishing radar frames.
- Interfaces with a custom radar parser (`PacketParser`).
- Uses a **condition variable and mutex** for frame queue synchronization.
- Each received radar frame is converted into a ROS 2 `PointCloud2` message.
- The frame is published to a topic specified by a **configurable parameter**.

---

### 🏁 Launch Example

```bash
ros2 run ti_iwr_pointcloud publish_node
```

---

### 🧪 Dependencies

- `rclcpp`
- `sensor_msgs`
- `serial_cpp`
- Custom radar parser (PacketParser)
- Parameter server for dynamic config
- C++ standard threading and synchronization
Binary file added docs/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions docs/assets/stylesheets/logo.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.md-header__button.md-logo {
margin-top: 0;
margin-bottom: 0;
padding-top: 0;
padding-bottom: 0;
}

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
height: 10%;
width: 10%;
}
4 changes: 4 additions & 0 deletions docs/contributing/license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License

This work is licensed under the apache-2.0 license.

16 changes: 16 additions & 0 deletions docs/contributing/rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Contribution rules

For contributing we recommend creating a fork and when ready a pull request to merge the changes with this repository.
In the pull request please state:

- What has been added/changed?
- Some reasoning about implementation details

Please don't do refactors without consent of administrators <RichardKroesen & Hoog-V> as we will not merge them.

## New features

If you have any cool feature/idea to add to the code, please start an issue in GitHub to introduce the idea to the maintainers.



Loading