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

Include new T169 user-interface #28

Merged
merged 5 commits into from
Feb 6, 2023
Merged
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ umrr_ros2_driver/__pycache__
simulator/simulation/build_dir
simulator/simulation/out
umrr_ros2_driver/include/umrr_ros2_driver/sensor_params.hpp
umrr_ros2_driver/include/umrr_ros2_driver/sensor_commands.hpp
umrr_ros2_driver/smartmicro/*
!umrr_ros2_driver/smartmicro/include
umrr_ros2_driver/smartmicro/include/*
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ This minor release introduces signal-to-noise field in the pointclouds and also
## v3.2.1 - 2022-12-16

This release fixes the offset which causes anomaly in pointclouds from DRVEGRD 152 sensor. It also fixes the timestamp calculation bug which causes rviz to crash and updates the simulator source files.

## v4.0.0 - 2023-02-06

This release includes the new DRVEGRD 169 user-interface. The release includes new modes for DRVEGRD 169 and also introduces an additional ros2 service to save configurations. Previously used model 'UMRR9F' in radar parameters has been divided into two versions, the 'UMRR9F_V1_1_1' and 'UMRR9F_V2_0_0'.
19 changes: 14 additions & 5 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ A [smartmicro](https://www.smartmicro.com/automotive-radar) UMRR96, UMRR11, DRVE
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: `December 16, 2022`
- Smart Access Automotive version: `v2.2.3`
- Date of release: `February 06, 2023`
- Smart Access Automotive version: `v3.0.0`
- User interface version: `UMRR96 Type 153 AUTOMOTIVE v1.2.1`
- User interface version: `UMRR11 Type 132 AUTOMOTIVE v1.1.1`
- User interface version: `UMRR9F Type 169 AUTOMOTIVE v1.1.1`
- User interface version: `UMRR9F Type 169 AUTOMOTIVE v2.0.0`
- User interface version: `UMRR9D Type 152 AUTOMOTIVE v1.0.2`

### Sensor Firmwares
Expand All @@ -39,6 +40,7 @@ This ROS2 driver release is compatible with the following sensor firmwares:
- UMRR96 Type 153: V5.2.4
- UMRR9D Type 152: V2.1.0
- UMRR9F Type 169: V1.3.0
- UMRR9F Type 169: V2.0.2

### Point cloud message wrapper library
To add targets to the point cloud in a safe and quick fashion a
Expand Down Expand Up @@ -72,7 +74,7 @@ For more details, see the [`radar.template.yaml`](umrr_ros2_driver/param/radar.t
- `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
- `model`: the model('umrr11', 'umrr9d', 'umrr96', 'umrr9f_v1_1_1', 'umrr9f_v2_0_0') of the sensor being used

## Mode of operations of the sensors
The smartmicro radars come equipped with numerous features and modes of operation. Using the ros2 services provided one
Expand All @@ -84,7 +86,7 @@ A ros2 `SetMode` service should be called to implement these mode changes. There
- `sensor_id`: the id of the sensor to which the service call should be sent.

For instance, changing the `Index of Transmit Antenna (tx_antenna_idx)` of a UMRR-11 sensor to `AEB (2)` mode would require the following call:
`ros2 service call /smartmicro_radar_node/set_radar_mode umrr_ros2_msgs/srv/SetMode "{param: "tx_antenna_idx", value: 2, sensor_id: 100}"`
`ros2 service call /smart_radar/set_radar_mode umrr_ros2_msgs/srv/SetMode "{param: "tx_antenna_idx", value: 2, sensor_id: 100}"`

## Configuration of the sensors
In order to use multiple sensors (maximum of up to eight sensors) with the node the sensors should be configured separately.
Expand All @@ -101,11 +103,18 @@ value in decimal `3232238400` should be used.
- `sensor_id`: the sensor whose ip address is to be changed.

The call for such a service would be as follows:
`ros2 service call /smartmicro_radar_node/set_ip_address umrr_ros2_msgs/srv/SetIp "{value_ip: 3232238400, sensor_id: 100}"`
`ros2 service call /smart_radar/set_ip_address umrr_ros2_msgs/srv/SetIp "{value_ip: 3232238400, sensor_id: 100}"`

Note: For successfull execution of this call it is important that the sensor is restarted, the ip address in the
[`radar.template.yaml`](umrr_ros2_driver/param/radar.template.yaml) is updated and the driver is build again.

## Saving mode changes
In order to save the mode changes, an additional service if provided. This service offers different save options and also the possibility to
set the default values for the sensors. The list of all the options could be found in the [`sensor_commands.json`](umrr_ros2_driver/config/sensor_commands.json).

The call for such a service would be as follows:
`ros2 service call /smart_radar/send_command umrr_ros2_msgs/srv/SendCommand "{command: "comp_eeprom_ctrl_default_param_sec", sensor_id: 100}"`

## Sensor Service Responses

The sensor services respond with certain value codes. The following is a lookup table for the possible responses:
Expand Down
2 changes: 1 addition & 1 deletion smart_extract.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -e

smart_pack=SmartAccessAutomotive_2_2_3.tgz
smart_pack=SmartAccessAutomotive_3_0_0.tgz
URL_smartbinaries=https://www.smartmicro.com/fileadmin/media/Downloads/Automotive_Radar/Software/${smart_pack}

cat << EOF
Expand Down
7 changes: 7 additions & 0 deletions umrr_ros2_driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ install(FILES
"${PROJECT_SOURCE_DIR}/smartmicro/lib-linux-x86_64-gcc_9/libumrr11_t132_automotivev1.1.1_user_interface.so"
"${PROJECT_SOURCE_DIR}/smartmicro/lib-linux-x86_64-gcc_9/libumrr96_t153_automotivev1.2.1_user_interface.so"
"${PROJECT_SOURCE_DIR}/smartmicro/lib-linux-x86_64-gcc_9/libumrr9f_t169_automotivev1.1.1_user_interface.so"
"${PROJECT_SOURCE_DIR}/smartmicro/lib-linux-x86_64-gcc_9/libumrr9f_t169_automotivev2.0.0_user_interface.so"
"${PROJECT_SOURCE_DIR}/smartmicro/lib-linux-x86_64-gcc_9/libumrr9d_t152_automotivev1.0.2_user_interface.so"
DESTINATION lib)

Expand All @@ -65,6 +66,7 @@ set(CONFIG_FILE_PATH "${CONFIG_FOLDER_PATH}/smart_access_config.json")
set(HW_INVENTORY_FILE_PATH "${CONFIG_FOLDER_PATH}/hw_inventory.json")
set(ROUTING_TABLE_FILE_PATH "${CONFIG_FOLDER_PATH}/routing_table.json")
set(SENSOR_PARAM_FILE_PATH "${PROJECT_SOURCE_DIR}/config/sensor_params.json")
set(SENSOR_COMMAND_FILE_PATH "${PROJECT_SOURCE_DIR}/config/sensor_commands.json")
configure_file(
"${PROJECT_SOURCE_DIR}/cmake/smart_access_config.json.in" "${CONFIG_FILE_PATH}" @ONLY)
configure_file(
Expand All @@ -73,6 +75,9 @@ configure_file(
configure_file(
"${PROJECT_SOURCE_DIR}/cmake/sensor_params.hpp.in"
"${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/sensor_params.hpp" @ONLY)
configure_file(
"${PROJECT_SOURCE_DIR}/cmake/sensor_commands.hpp.in"
"${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/sensor_commands.hpp" @ONLY)

ament_auto_add_library(smartmicro_radar_node SHARED "src/smartmicro_radar_node.cpp")

Expand All @@ -81,6 +86,7 @@ smartmicro/include/
smartmicro/include/umrr11_t132_automotive_v1_1_1
smartmicro/include/umrr96_t153_automotive_v1_2_1
smartmicro/include/umrr9f_t169_automotive_v1_1_1
smartmicro/include/umrr9f_t169_automotive_v2_0_0
smartmicro/include/umrr9d_t152_automotive_v1_0_2)

# link smart_access_lib-linux-x86_64-gcc_9 to the node
Expand All @@ -92,6 +98,7 @@ target_link_libraries(smartmicro_radar_node
umrr11_t132_automotivev1.1.1_user_interface
umrr96_t153_automotivev1.2.1_user_interface
umrr9f_t169_automotivev1.1.1_user_interface
umrr9f_t169_automotivev2.0.0_user_interface
umrr9d_t152_automotivev1.0.2_user_interface)

rclcpp_components_register_node(smartmicro_radar_node
Expand Down
31 changes: 31 additions & 0 deletions umrr_ros2_driver/cmake/sensor_commands.hpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright 2021 Apex.AI, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef UMRR_ROS2_DRIVER__CMAKE_SENSOR_COMMAND_PATH_H_
#define UMRR_ROS2_DRIVER__CMAKE_SENSOR_COMMAND_PATH_H_

namespace smartmicro
{
namespace drivers
{
namespace radar
{

constexpr auto KSensorCommandFilePath ="@SENSOR_COMMAND_FILE_PATH@";

} // namespace radar
} // namespace drivers
} // namespace smartmicro

#endif // UMRR_ROS2_DRIVER__CMAKE_SENSOR_COMMAND_PATH_H_
17 changes: 17 additions & 0 deletions umrr_ros2_driver/config/sensor_commands.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"commands":
[
{
"name": "comp_eeprom_ctrl_save_param_sec",
"comment": "Save the parameter inside the EEPROM. (3102.3)"
},
{
"name": "comp_eeprom_ctrl_reset_param_sec",
"comment": "Restore default values in RAM. EEPROM content is not changed. (3102.2)"
},
{
"name": "comp_eeprom_ctrl_default_param_sec",
"comment": "Restore default values in RAM and EEPROM. (3102.1)"
}
]
}
6 changes: 6 additions & 0 deletions umrr_ros2_driver/config/sensor_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@
"min": 0,
"max": 2,
"default": 1
},
{
"model": "umrr9f_v2_0_0",
"min": 0,
"max": 2,
"default": 1
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <umrr11_t132_automotive_v1_1_1/DataStreamServiceIface.h>
#include <umrr96_t153_automotive_v1_2_1/DataStreamServiceIface.h>
#include <umrr9f_t169_automotive_v1_1_1/DataStreamServiceIface.h>
#include <umrr9f_t169_automotive_v2_0_0/DataStreamServiceIface.h>
#include <umrr9d_t152_automotive_v1_0_2/DataStreamServiceIface.h>

#include <array>
Expand All @@ -36,6 +37,7 @@

#include "umrr_ros2_msgs/srv/set_ip.hpp"
#include "umrr_ros2_msgs/srv/set_mode.hpp"
#include "umrr_ros2_msgs/srv/send_command.hpp"

namespace smartmicro
{
Expand Down Expand Up @@ -117,12 +119,27 @@ class UMRR_ROS2_DRIVER_PUBLIC SmartmicroRadarNode : public ::rclcpp::Node
/// @param[in] client_id The client_id of the sensor
///

void targetlist_callback_umrr9f(
void targetlist_callback_umrr9f_v1_1_1(
const std::uint32_t sensor_idx,
const std::shared_ptr<
com::master::umrr9f_t169_automotive_v1_1_1::comtargetlistport::ComTargetListPort> &
targetlist_port_umrr9f,
const com::types::ClientId client_id);
///
/// @brief A callback that is called when a new target list port for
/// umrr9f arrives.
///
/// @param[in] sensor_idx The sensor id for respective published topic.
/// @param[in] target_list_port The target list port
/// @param[in] client_id The client_id of the sensor
///

void targetlist_callback_umrr9f_v2_0_0(
const std::uint32_t sensor_idx,
const std::shared_ptr<
com::master::umrr9f_t169_automotive_v2_0_0::comtargetlistport::ComTargetListPort> &
targetlist_port_umrr9f_v2_0_0,
const com::types::ClientId client_id);

///
/// @brief A callback that is called when a new target list port for
Expand All @@ -147,13 +164,21 @@ class UMRR_ROS2_DRIVER_PUBLIC SmartmicroRadarNode : public ::rclcpp::Node
void update_config_files_from_params();

///
/// @brief Callaback for getting the instruction response.
/// @brief Callaback for getting the parameter response.
///
void sensor_response(
void mode_response(
const com::types::ClientId client_id,
const std::shared_ptr<com::master::ResponseBatch> & response,
const std::string instruction_name);

///
/// @brief Callaback for getting the command response.
///
void command_response(
const com::types::ClientId client_id,
const std::shared_ptr<com::master::ResponseBatch> & response,
const std::string command_name);

///
/// @brief Callback for changing IP address.
///
Expand All @@ -175,8 +200,16 @@ class UMRR_ROS2_DRIVER_PUBLIC SmartmicroRadarNode : public ::rclcpp::Node
const std::shared_ptr<umrr_ros2_msgs::srv::SetIp::Request> request,
std::shared_ptr<umrr_ros2_msgs::srv::SetIp::Response> response);

///
/// @brief Send command to the sensor.
///
void radar_command(
const std::shared_ptr<umrr_ros2_msgs::srv::SendCommand::Request> request,
std::shared_ptr<umrr_ros2_msgs::srv::SendCommand::Response> response);

rclcpp::Service<umrr_ros2_msgs::srv::SetMode>::SharedPtr mode_srv_;
rclcpp::Service<umrr_ros2_msgs::srv::SetIp>::SharedPtr ip_addr_srv_;
rclcpp::Service<umrr_ros2_msgs::srv::SendCommand>::SharedPtr command_srv_;

std::array<detail::SensorConfig, detail::kMaxSensorCount> m_sensors{};

Expand All @@ -197,7 +230,8 @@ bool check_signal = false;
std::shared_ptr<com::master::CommunicationServicesIface> m_services{};
std::shared_ptr<com::master::umrr11_t132_automotive_v1_1_1::DataStreamServiceIface> data_umrr11{};
std::shared_ptr<com::master::umrr96_t153_automotive_v1_2_1::DataStreamServiceIface> data_umrr96{};
std::shared_ptr<com::master::umrr9f_t169_automotive_v1_1_1::DataStreamServiceIface> data_umrr9f{};
std::shared_ptr<com::master::umrr9f_t169_automotive_v1_1_1::DataStreamServiceIface> data_umrr9f_v1_1_1{};
std::shared_ptr<com::master::umrr9f_t169_automotive_v2_0_0::DataStreamServiceIface> data_umrr9f_v2_0_0{};
std::shared_ptr<com::master::umrr9d_t152_automotive_v1_0_2::DataStreamServiceIface> data_umrr9d{};

} // namespace radar
Expand Down
6 changes: 4 additions & 2 deletions umrr_ros2_driver/launch/radar.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ def generate_launch_description():
radar_node = Node(
package=PACKAGE_NAME,
executable='smartmicro_radar_node_exe',
parameters=[LaunchConfiguration('radar_param_file')],
name='smartmicro_radar_node'
name='smart_radar',
parameters=[LaunchConfiguration('radar_param_file')]
)

return LaunchDescription([
radar_params,
radar_node
])


2 changes: 1 addition & 1 deletion umrr_ros2_driver/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>umrr_ros2_driver</name>
<version>3.2.1</version>
<version>4.0.0</version>
<description>A node to publish data from a smartmicro radar.</description>
<maintainer email="[email protected]">s.m.s, smart microwave sensors GmbH.</maintainer>
<license>Apache 2.0 License</license>
Expand Down
5 changes: 3 additions & 2 deletions umrr_ros2_driver/param/radar.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
# As many as 10 sensors all named as "sensor_<number>" in increasing order of numbers,
# e.g., sensor_0, sensor_1, etc. The list must start with sensor_0.
sensor_0:
# The model of the connected sensor.
# The model of the connected sensor. Available models umrr11, umrr9d, umrr96,
# umrr9f_v1_1_1, umrr9f_v2_0_0
model: "umrr11"
# The client_id of the sensor/source, must be a unique integer.
id: 100
Expand All @@ -41,7 +42,7 @@
history_size: 10
sensor_2:
# The model of the connected sensor.
model: "umrr9f"
model: "umrr9f_v1_1_1"
# The client_id of the sensor/source, must be a unique integer.
id: 300
# The ip address of the sensor or of the source acting as a sensor.
Expand Down
Loading