Skip to content

Commit

Permalink
Update the driver to include smart release v4xx (#5) (#8)
Browse files Browse the repository at this point in the history
Extended driver to include multi-sensor interfaces and sensors simulators introduced for robust testing.

Co-authored-by: Shahrukh <[email protected]>
  • Loading branch information
smartBUILDBOT and smartSRA authored May 4, 2022
1 parent df1c9cc commit 9eacd9a
Show file tree
Hide file tree
Showing 43 changed files with 1,708 additions and 1,345 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/dockerbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,20 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Build the docker container
run: docker build . -t umrr-ros:latest

- name: Get the smartaccess binaries
working-directory: ./umrr_ros2_driver
- name: Get the Smart Access binaries
run: echo "yes" | ./smart_extract.sh

- name: Build the docker container
run: docker build . -t umrr-ros:latest

- name: Building the driver with the docker container
run: docker run --rm -v`pwd`:/code umrr-ros colcon build
run: docker run --rm -v`pwd`:/code umrr-ros colcon build --packages-select umrr_ros2_driver

- name: Running the unit/integration tests via the docker container and exit
run: docker-compose up --exit-code-from ros_node
run: docker-compose up

- name: Getting the test coverage
run: docker run --rm -v`pwd`:/code umrr-ros colcon test-result --all --verbose
run: docker run --rm -v`pwd`:/code umrr-ros colcon test-result --all --verbose

- name: Shut down docker containers and networks
run: docker-compose down
run: docker-compose down
15 changes: 9 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ install
log
*.pyc
umrr_ros2_driver/__pycache__
umrr_ros2_driver/smartmicro/cJSON
umrr_ros2_driver/smartmicro/lib
umrr_ros2_driver/smartmicro/osal
umrr_ros2_driver/smartmicro/smart_access_release
umrr_ros2_driver/smartmicro/LICENSE_3rdParty.txt
umrr_ros2_driver/smartmicro/LICENSE.txt
simulator/simulation/build_dir
simulator/simulation/out
umrr_ros2_driver/smartmicro/*
!umrr_ros2_driver/smartmicro/include
umrr_ros2_driver/smartmicro/include/*
!umrr_ros2_driver/smartmicro/include/DataServicesIface.h
!umrr_ros2_driver/smartmicro/include/InstructionBuffer.h
!umrr_ros2_driver/smartmicro/include/Types.h
!umrr_ros2_driver/smartmicro/Readme.md
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ All notable changes to this project will be documented in this file. This projec
## v1.0.0 - 2021-11-01

This is the first official versioned release of the `smartmicro_ros2_radars`. It provides a ros2 node that is wrapped around `Smart Access C++ API v3.3.15`, interfacing with smartmicro automotive radars and publishing the incoming data as point cloud.

## v2.0.0 - 2022-05-05

This major release of the driver includes multi-user interfaces. The driver now supports and publishes data from UMRR96 and UMRR11.
A new test approach has been implemented which simulates the sensors and interfaces with the node hence making the tests more robust.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
ros-foxy-point-cloud-msg-wrapper \
tcpdump \
wget
RUN pip3 install dpkt

WORKDIR /code
39 changes: 22 additions & 17 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
There is a need for a node that will interface with a smartmicro radar driver and publish the data
acquired by the sensor through the ROS2 pipeline. This package implements such a node.

## Get the smartaccess release
## Get the Smart Access release
```bash
./smart_extract.sh
```
Expand All @@ -22,13 +22,14 @@ ros2 launch umrr_ros2_driver radar.launch.py
- ROS2 foxy

### UMRR-96 radar and Smart Access API version
A [smartmicro](https://www.smartmicro.com/automotive-radar) UMRR-96 radar (or data recorded from it)
is required to run this node. This code is bundled with a version of Smart Access API. Please make
A [smartmicro](https://www.smartmicro.com/automotive-radar) UMRR96 radar, UMRR11 radar or both are
required to run this node. This code is bundled with a version of Smart Access API. Please make
sure the version used to publish the data is compatible with this version:

- Date of release: `November 01, 2021`
- Library version: `v3.3.15`
- User interface version: `Smartaccess UMRR96 Type 153 AUTOMOTIVE v4.1.1`
- Date of release: `March 25, 2022`
- Smart Access Automotive version: `v1.1.0`
- User interface version: `UMRR96 Type 153 AUTOMOTIVE v1.2.1`
- User interface version: `UMRR11 Type 132 AUTOMOTIVE v1.1.1`

### Point cloud message wrapper library
To add targets to the point cloud in a safe and quick fashion a
Expand Down Expand Up @@ -61,36 +62,37 @@ For more details, see the [`radar.template.yaml`](param/radar.template.yaml) fil
- `iface_name`: name of the used network interface
- `frame_id`: name of the frame in which the messages will be published
- `history_size`: size of history for the message publisher
- `model`: the model of the sensor being used

## Configuration of the sensors
In order to use multiple sensors with the node the sensors should be configured separately. There are
two possible ways to assign IP addresses to the sensors:
- Through the smartmicro tool `DriveRecorder`.
- Using the `Smart Access C++ API`.
In order to use multiple sensors (maximum of up to ten sensors) with the node the sensors should be configured separately.
The IP addresses of the sensors could be assigned using:
- The smartmicro tool `DriveRecorder`.
- Using the `Smart Access C++ API`

Each sensor has to be assigned a unique IP address!

## Development
The dockerfile can be used to build and test the ros driver.

Building docker container
Accept the agreement and get the smartaccess release
```bash
docker build . -t umrr-ros:latest
./smart_extract.sh
```

Accept the agreement and get the smartaccess release
Building docker container
```bash
./smart_extract.sh
docker build . -t umrr-ros:latest
```

Building the driver with the docker container
```bash
docker run --rm -v`pwd`:/code umrr-ros colcon build
docker run --rm -v`pwd`:/code umrr-ros colcon build --packages-select umrr_ros2_driver
```

Running the unit and integration tests via the docker compose
```bash
docker-compose up --exit-code-from ros_node
docker-compose up
```

Getting the test coverage via the docker container
Expand All @@ -102,7 +104,10 @@ Stop and remove docker containers and networks
```bash
docker-compose down
```

## ARMv8 Support
The Smart Access release which will be downloaded using the script also offers platform support for armv8. In order to build the driver on an armv8 machine, the `CmakeLists.txt` should be adopted.
Instead of using the default `lib-linux-x86_64_gcc_9` the user should plugin the `lib-linux-armv8-gcc_9` for armv8.

## Contribution
This project is a joint effort between [smartmicro](https://www.smartmicro.com/) and [Apex.AI](https://www.apex.ai/). The initial version of the code was developed by Igor Bogoslavskyi of Apex.AI (@niosus) and was thereafter adapted and extended by smartmicro.

Expand Down
25 changes: 22 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,38 @@

version: "3"
services:
build_simulator:
image: umrr-ros:latest
volumes:
- .:/code
entrypoint: ["/code/simulator/simulation/build_simulator.sh"]
sensor_0:
depends_on:
build_simulator:
condition: service_completed_successfully
image: umrr-ros:latest
volumes:
- .:/code
entrypoint: ["python3", "/code/umrr_ros2_driver/test/transmit_pcap.py"]
environment:
- SMART_ACCESS_CFG_FILE_PATH=/code/simulator/config_umrr11/com_lib_config.json
- LD_LIBRARY_PATH=/code/umrr_ros2_driver/smartmicro/lib-linux-x86_64-gcc_9
entrypoint: ["/code/simulator/simulation/out/bin/simulator"]
command: ["4", "1", "1"]
networks:
device_network:
ipv4_address: 172.22.10.101
sensor_1:
depends_on:
build_simulator:
condition: service_completed_successfully
image: umrr-ros:latest
volumes:
- .:/code
entrypoint: ["python3", "/code/umrr_ros2_driver/test/transmit_pcap.py"]
environment:
- SMART_ACCESS_CFG_FILE_PATH=/code/simulator/config_umrr96/com_lib_config.json
- LD_LIBRARY_PATH=/code/umrr_ros2_driver/smartmicro/lib-linux-x86_64-gcc_9
entrypoint: ["/code/simulator/simulation/out/bin/simulator"]
command: ["5", "1", "2"]
networks:
device_network:
ipv4_address: 172.22.10.102
Expand All @@ -37,7 +56,7 @@ services:
- "sensor_1"
volumes:
- .:/code
command: ["colcon", "test"]
command: ["colcon", "test", "--packages-above", "umrr_ros2_driver"]
networks:
device_network:
ipv4_address: 172.22.10.100
Expand Down
16 changes: 16 additions & 0 deletions simulator/config_umrr11/com_lib_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Com Lib Config",
"version": "1.0.0",
"client_id": 100,
"role": "slave",
"shared_lib_path": "/code/umrr_ros2_driver/smartmicro/lib-linux-x86_64-gcc_9",
"config_path": "/code/simulator/config_umrr11",
"user_interface_name": "umrr11_t132_automotive",
"user_interface_major_v": 1,
"user_interface_minor_v": 1,
"user_interface_patch_v": 1,
"download_path": "",
"instruction_serialization_type": "port_based",
"data_serialization_type": "port_based",
"alive": false
}
12 changes: 12 additions & 0 deletions simulator/config_umrr11/hw_inventory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"hwItems": [
{
"type": "eth",
"dev_id": 1,
"iface_name": "eth0",
"port": 55555
}
],
"name": "HW inventory List",
"version": "1.1.0"
}
14 changes: 14 additions & 0 deletions simulator/config_umrr11/routing_table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"clients": [
{
"client_id": 1,
"data_serialization_type": "port_based",
"instruction_serialization_type": "port_based",
"ip": "172.22.10.100",
"link_type": "eth",
"port": 55555
}
],
"name": "Client Routing Table",
"version": "1.0.0"
}
16 changes: 16 additions & 0 deletions simulator/config_umrr96/com_lib_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Com Lib Config",
"version": "1.0.0",
"client_id": 200,
"role": "slave",
"shared_lib_path": "/code/umrr_ros2_driver/smartmicro/lib-linux-x86_64-gcc_9",
"config_path": "/code/simulator/config_umrr96",
"user_interface_name": "umrr96_t153_automotive",
"user_interface_major_v": 1,
"user_interface_minor_v": 2,
"user_interface_patch_v": 1,
"download_path": "",
"instruction_serialization_type": "port_based",
"data_serialization_type": "port_based",
"alive": false
}
12 changes: 12 additions & 0 deletions simulator/config_umrr96/hw_inventory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"hwItems": [
{
"type": "eth",
"dev_id": 1,
"iface_name": "eth0",
"port": 55555
}
],
"name": "HW inventory List",
"version": "1.1.0"
}
14 changes: 14 additions & 0 deletions simulator/config_umrr96/routing_table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"clients": [
{
"client_id": 1,
"data_serialization_type": "port_based",
"instruction_serialization_type": "port_based",
"ip": "172.22.10.100",
"link_type": "eth",
"port": 55555
}
],
"name": "Client Routing Table",
"version": "1.0.0"
}
29 changes: 29 additions & 0 deletions simulator/simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
project(SensorSimulator)

cmake_minimum_required(VERSION 3.13)

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_C_COMPILER gcc)
set(CMAKE_CXX_COMPILER g++)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64 -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread -m64 -fPIC")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m64 -fPIC")

link_directories(${CMAKE_CURRENT_SOURCE_DIR}/${SMART_ACCESS_LIB_FOLDER})

add_executable(simulator
src/simulator.cpp)

target_include_directories(simulator PUBLIC
../../umrr_ros2_driver/smartmicro/include
umrr_ros2_driver/smartmicro/include/umrr11_t132_automotive_v1_1_1
umrr_ros2_driver/smartmicro/include/umrr96_t153_automotive_v1_2_1)

target_link_libraries(simulator
com_lib
osal
umrr11_t132_automotivev1.1.1_user_interface
umrr96_t153_automotivev1.2.1_user_interface
dl)

install(TARGETS simulator DESTINATION bin)
12 changes: 12 additions & 0 deletions simulator/simulation/build_simulator.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
work_dir=$(pwd)
set -e

cd /code/simulator/simulation

mkdir -p build_dir
cmake -G "Unix Makefiles" -S. -Bbuild_dir \
-DCMAKE_INSTALL_PREFIX=out \
-DSMART_ACCESS_LIB_FOLDER=../../umrr_ros2_driver/smartmicro/lib-linux-x86_64-gcc_9
make -C build_dir
make -C build_dir install
Loading

0 comments on commit 9eacd9a

Please sign in to comment.