Skip to content

Commit 836922c

Browse files
Merge remote-tracking branch 'origin/ros2_dev' into ros2_master
2 parents 68a7a5d + 1939453 commit 836922c

File tree

22 files changed

+1499
-97
lines changed

22 files changed

+1499
-97
lines changed

README.md

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# adma_ros2_driver
22
Further Information can be found at the [GeneSys Technical Support Center](https://genesys-offenburg.de/support-center/).
33

4-
## Integrated ROS Topics
4+
## Integrated Standard ROS Topics
55
The ADMA uses a combination of GNSS-Receiver and different rate and acceleration sensors. Due to this, different ROS topics are getting filled with sensor, GNSS and combined measurement data as shown in the following list:
66

77
| Topic | Content | Description |
@@ -13,6 +13,7 @@ The ADMA uses a combination of GNSS-Receiver and different rate and acceleration
1313
| /adma/fix | [sensor_msgs::Navsatfix](http://docs.ros.org/en/melodic/api/sensor_msgs/html/msg/NavSatFix.html) | GNSS Information in the standard ROS format. |
1414
| /adma/imu | [sensor_msgs::imu](http://docs.ros.org/en/melodic/api/sensor_msgs/html/msg/Imu.html) | Inertial data in the standard ROS format. |
1515
| /adma/data_raw | Raw UDP data stream | ADMA raw data as binary data stream. |
16+
| /adma/odometrsy | [nav_msgs::Odometry](http://docs.ros.org/en/noetic/api/nav_msgs/html/msg/Odometry.html) | Position, velocity and orientation |
1617

1718
## Environment information
1819
This setup was implemented and tested with the following conditions:
@@ -30,14 +31,27 @@ cd ~/ros2_ws/src
3031
git clone -b ros_2 $REPO_URL(HTPPS/SSH)
3132
```
3233

33-
2. Build workspace
34+
2. install all ROS dependencies (the warning for `ament_cmake_clange_format` can be ignored..)
35+
```bash
36+
cd ~/ros2_ws
37+
# source ROS
38+
. /opt/ros/$INSTALLED_ROS_CONTRIB/setup.bash
39+
# initialize rosdep
40+
sudo rosdep init # only required if not already done for other projects on your system
41+
# update rosdep
42+
rosdep update
43+
# install dependencies
44+
rosdep install --from-paths src --ignore-src -y
45+
```
46+
47+
3. Build your workspace
3448
```bash
3549
cd ~/ros2_ws
3650
. /opt/ros/$INSTALLED_ROS_CONTRIB/setup.bash
3751
colcon build --symlink-install
3852
```
3953

40-
3. Source workspace and launch
54+
4. Source workspace and launch
4155
```bash
4256
. install/setup.bash
4357
ros2 launch adma_ros2_driver adma_driver.launch.py
@@ -47,7 +61,22 @@ ros2 launch adma_ros2_driver adma_driver.launch.py
4761
### Config File
4862
For configuring the ADMA ROS Driver the according parameters in the `adma_ros2_driver/config/driver_config.yaml` file have to be modified.
4963
If the workspace was built with `colcon build --symlink-install`, it is possible to restart the node after changing configuration parameters directly. Otherwise (built without '--symlink-install') it is necessary to rebuild the workspace to update the files.
50-
Same "linking" rule applies to the `launch.py` files. The available parameters are described in the table below.
64+
Same "linking" rule applies to the `launch.py` files. The available parameters are described below.
65+
66+
#### ROS Topic configuration
67+
The ROS Topics can be output in desired measurement point locations in the vehicle. This can be done by using the ADMA POI's (Point of Interest). The POI's are defined in the ADMA Webinterface
68+
through user defined offsets to the Measurement Reference Point (MRP). In the ADMA ROS Driver, the POI's in which each ROS topic shall be output can be selected with the relating ID in the
69+
Driver Config File (0 = MRP, 1-8 = POI 1-8). As Default, the ROS Topics are output in POI1.
70+
71+
By default, the odometry topic outputs Yaw relative to the north direction. You can configure an offset for Yaw using the "odometry_yaw_offset" parameter.
72+
73+
With the mode, it is possible to switch between the online and the replay mode. The replay mode is a built in replay function for subscribing to the /adma/data_raw topic of a replayed bag file.
74+
This enables only the decoder part of the driver, that takes the rosbag data and publishes them in the standard ADMA ROS driver topics.
75+
76+
With the time_mode parameter it is possible to define how the ROS header time stamps shall be defined. Either by the ADMA INS Time (default) or by the ROS system time.
77+
78+
![ConfigFile](https://github.com/GeneSysElektronik/adma_ros_driver/assets/105273302/dd0d2eb0-3ec5-4649-8949-1ec591de530b)
79+
5180

5281
### Launch File
5382
#### Topic Remapping
@@ -61,7 +90,7 @@ It is possible to remap ROS topics in the driver to new namings by editing the `
6190
| use_performance_check | True / False | True if you want to log informations about the performance | driver_config.yaml |
6291
| gnss_frame | name as string | ROS frame_id of the NavSat topic | driver_config.yaml |
6392
| imu_frame | name as string | ROS frame_id of the IMU topic | driver_config.yaml |
64-
| protocol_version | "v3.2" / "v3.3.3" / "v3.3.4" | the ADMAnet protocol version of your ADMA | driver_config.yaml |
93+
| protocol_version | "v3.2" / "v3.3.3" / "v3.3.4" / "v3.3.5" | the ADMAnet protocol version of your ADMA | driver_config.yaml |
6594
| frame_ids | BOOL | Define the ROS topic names | driver_config.yaml |
6695
| log_gsdb | BOOL | Enable creating a GSDB file for logging the raw data | adma_driver.launch.py |
6796
| record_rosbag | BOOL | Enable logging a rosbag file | adma_driver.launch.py |
@@ -80,7 +109,7 @@ To switch between those, the`protocol_version` parameter in the `config/driver_c
80109

81110
- UDP packet protocol of 856 bytes
82111
- supports 8 POI
83-
- v3.3.4
112+
- v3.3.5
84113

85114
- UDP packet protocol of 856 bytes
86115
- supports 8 POI
@@ -91,7 +120,7 @@ To switch between those, the`protocol_version` parameter in the `config/driver_c
91120
## Data Output
92121
The ADMA ROS driver is able to output two different file formats.
93122

94-
![Online](https://github.com/GeneSysElektronik/adma_ros_driver/assets/105273302/fbd7470e-6d6f-4499-8fd2-08a0110f89e2)
123+
![Online](https://github.com/GeneSysElektronik/adma_ros_driver/assets/105273302/f10a2ed1-1e7b-47b4-9f03-14a68fcdeac3)
95124

96125
### GeneSys Binary Raw Data (.gsdb)
97126
![Integration of GSDB in the GeneSys Toolchain](https://user-images.githubusercontent.com/105273302/230074686-9b17826a-16d4-4f6a-83f7-8cd19daad914.jpg)

adma_ros2_driver/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,47 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
1212
add_compile_options() # (-Wall -Wextra) #-Wpedantic)
1313
endif()
1414

15+
# define ROS dependencies
1516
find_package(ament_cmake REQUIRED)
1617
find_package(rclcpp REQUIRED)
1718
find_package(rclcpp_components REQUIRED)
1819
find_package(sensor_msgs REQUIRED)
1920
find_package(geometry_msgs REQUIRED)
21+
find_package(nav_msgs REQUIRED)
2022
find_package(std_msgs REQUIRED)
2123
find_package(tf2_ros REQUIRED)
2224
find_package(tf2_geometry_msgs REQUIRED)
25+
26+
# define genesys dependencies
2327
find_package(adma_ros_driver_msgs REQUIRED)
2428

2529
include_directories(include)
2630

31+
# define library of this package
2732
add_library(${PROJECT_NAME}_node SHARED
2833
src/parser/adma2ros_parser.cpp
2934
src/parser/adma2ros_parser_v32.cpp
3035
src/parser/adma2ros_parser_v333.cpp
3136
src/parser/adma2ros_parser_v334.cpp
37+
src/parser/adma2ros_parser_v335.cpp
3238
src/parser/parser_utils.cpp
3339
src/adma_driver.cpp
3440
)
3541

42+
# link ROS deps to this package
3643
ament_target_dependencies(${PROJECT_NAME}_node
3744
rclcpp
3845
rclcpp_components
3946
sensor_msgs
4047
geometry_msgs
48+
nav_msgs
4149
std_msgs
4250
tf2_ros
4351
tf2_geometry_msgs
4452
adma_ros_driver_msgs
4553
)
4654

55+
# setup executable
4756
rclcpp_components_register_node(${PROJECT_NAME}_node
4857
PLUGIN "genesys::ADMADriver"
4958
EXECUTABLE adma_driver
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
1-
genesys:
1+
/**:
22
adma_ros2_driver:
33
ros__parameters:
44
destination_ip: '192.168.88.255'
55
destination_port: 11021
66
use_performance_check: False
7-
protocol_version: 'v3.3.4'
7+
protocol_version: 'v3.3.5'
88
frame_ids:
99
navsatfix: 'gnss_link'
1010
imu: 'imu_link'
1111
adma: 'adma'
1212
adma_status: 'adma_status'
1313
raw_data: 'data_raw'
14+
odometry_pose_id: 'adma' # header.frame_id (basicly could be a "name" of desired POI)
15+
odometry_twist_id: 'odometry' # odometry.child_frame_id
16+
odometry_yaw_offset: 0.0 # in degrees
17+
topic_pois: # those values can be mixed individually
18+
navsatfix: 1 # either 1-8 for desired POI or 0 if MRP(Measurement Reference Point) is required
19+
imu: 1
20+
velocity: 1
21+
odometry: 1
22+
mode: 0 # 0 = live (default) / 1 = rosbag replay of raw data
23+
time_mode: 0 # 0 = ADMA INS time / 1 = ROS system time

adma_ros2_driver/include/adma_ros2_driver/adma_driver.hpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <sensor_msgs/msg/nav_sat_fix.hpp>
66
#include <std_msgs/msg/float64.hpp>
77
#include <std_msgs/msg/string.hpp>
8+
#include <nav_msgs/msg/odometry.hpp>
89

910
#include "adma_ros2_driver/parser/adma2ros_parser.hpp"
1011
#include "adma_ros_driver_msgs/msg/adma_data.hpp"
@@ -26,6 +27,7 @@ class ADMADriver : public rclcpp::Node
2627
void initializeUDP(std::string adma_address);
2728
void updateLoop();
2829
void parseData(std::array<char, 856> recv_buf);
30+
void rawDataCallback(adma_ros_driver_msgs::msg::AdmaDataRaw::SharedPtr rawDataMsg);
2931

3032
// Socket file descriptor for receiving from adma
3133
int rcv_sock_fd_;
@@ -41,6 +43,9 @@ class ADMADriver : public rclcpp::Node
4143
bool performance_check_ = true;
4244
std::string protocol_version_;
4345

46+
// subscriber
47+
rclcpp::Subscription<adma_ros_driver_msgs::msg::AdmaDataRaw>::SharedPtr subRawData_;
48+
4449
// publisher
4550
rclcpp::Publisher<adma_ros_driver_msgs::msg::AdmaData>::SharedPtr pub_adma_data_;
4651
rclcpp::Publisher<adma_ros_driver_msgs::msg::AdmaDataRaw>::SharedPtr pub_adma_data_raw_;
@@ -50,14 +55,31 @@ class ADMADriver : public rclcpp::Node
5055
rclcpp::Publisher<sensor_msgs::msg::Imu>::SharedPtr pub_imu_;
5156
rclcpp::Publisher<std_msgs::msg::Float64>::SharedPtr pub_heading_;
5257
rclcpp::Publisher<std_msgs::msg::Float64>::SharedPtr pub_velocity_;
58+
rclcpp::Publisher<nav_msgs::msg::Odometry>::SharedPtr pub_odometry_;
5359

5460
// frame_ids for the ros msgs
5561
std::string gnss_frame_;
5662
std::string imu_frame_;
5763
std::string adma_frame_;
5864
std::string adma_status_frame_;
5965
std::string raw_data_frame_;
66+
std::string odometry_pose_frame_;
67+
std::string odometry_child_frame_;
6068

6169
ADMA2ROSParser * parser_;
70+
71+
// yaw offset angle if the odometry should be rotated by a fixed angle
72+
double odometry_yaw_offset_;
73+
74+
// desired data sources per topic (POI_x or MRP)
75+
uint8_t navsatfix_id_;
76+
uint8_t imu_id_;
77+
uint8_t velocity_id_;
78+
uint8_t odometry_id_;
79+
std::array<adma_ros_driver_msgs::msg::POI, 8> pois;
80+
81+
// parameters for mode and time source
82+
uint8_t mode_;
83+
uint8_t time_mode_;
6284
};
6385
} // namespace genesys

0 commit comments

Comments
 (0)