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

[WIP] IVIM Support #27

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
81 changes: 78 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"compounds": [
{
"name": "All (coding)",
"configurations": ["CAM (coding)", "CAM TS (coding)", "DENM (coding)", "CPM TS (coding)", "VAM TS (coding)", "MAPEM TS (coding)", "SPATEM TS (coding)"],
"configurations": ["CAM (coding)", "CAM TS (coding)", "DENM (coding)", "CPM TS (coding)", "VAM TS (coding)", "MAPEM TS (coding)", "SPATEM TS (coding), IVIM TS (coding)"],
"stopAll": false
},
{
"name": "All (msgs)",
"configurations": ["CAM (msgs)", "CAM TS (msgs)", "DENM (msgs)", "CPM TS (msgs)", "VAM TS (msgs)", "MAPEM TS (msgs)", "SPATEM TS (msgs)"],
"configurations": ["CAM (msgs)", "CAM TS (msgs)", "DENM (msgs)", "CPM TS (msgs)", "VAM TS (msgs)", "MAPEM TS (msgs)", "SPATEM TS (msgs), IVIM TS (msgs)"],
"stopAll": false
},
{
"name": "All (conversion)",
"configurations": ["CAM (conversion)", "CAM TS (conversion)", "DENM (conversion)", "CPM TS (conversion)", "VAM TS (conversion)", "MAPEM TS (conversion)", "SPATEM TS (conversion)"],
"configurations": ["CAM (conversion)", "CAM TS (conversion)", "DENM (conversion)", "CPM TS (conversion)", "VAM TS (conversion)", "MAPEM TS (conversion)", "SPATEM TS (conversion), IVIM TS (conversion)"],
"stopAll": false
}
],
Expand Down Expand Up @@ -285,6 +285,81 @@
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "IVIM TS (coding)",
"preLaunchTask": "Patch ASN.1 files",
"type": "debugpy",
"request": "launch",
"program": "utils/codegen/asn1ToC/asn1ToC.py",
"args": [
"asn1/raw/is_ts103301/IVIM-PDU-Descriptions.asn",
"asn1/raw/is_ts103301/cdd/ITS-Container.asn",
"asn1/raw/is_ts103301/iso-patched/ISO24534-3_ElectronicRegistrationIdentificationVehicleDataModule-patched.asn",
"asn1/raw/is_ts103301/iso-patched/ISO14823-missing.asn",
"asn1/raw/is_ts103301/build/asn1/TS17419_2014_CITSapplMgmtIDs.asn",
"asn1/raw/is_ts103301/iso-patched/ISO14906(2018)EfcDsrcGenericv7-patched.asn",
"asn1/raw/is_ts103301/iso-patched/ISO14906(2018)EfcDsrcApplicationv6-patched.asn",
"asn1/raw/is_ts103301/build/asn1/ISO-TS-19091-addgrp-C-2018-patched.asn",
"asn1/patched/is_ts103301/build/asn1/ISO14816_AVIAEINumberingAndDataStructures.asn",
"asn1/raw/is_ts103301/build/asn1/ISO19321IVIv2.asn",
"-t",
"ivim_ts",
"-o",
"etsi_its_coding/etsi_its_ivim_ts_coding"
],
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "IVIM TS (msgs)",
"preLaunchTask": "Patch ASN.1 files",
"type": "debugpy",
"request": "launch",
"program": "utils/codegen/codegen-py/asn1ToRosMsg.py",
"args": [
"asn1/raw/is_ts103301/IVIM-PDU-Descriptions.asn",
"asn1/raw/is_ts103301/cdd/ITS-Container.asn",
"asn1/raw/is_ts103301/iso-patched/ISO24534-3_ElectronicRegistrationIdentificationVehicleDataModule-patched.asn",
"asn1/raw/is_ts103301/iso-patched/ISO14823-missing.asn",
"asn1/raw/is_ts103301/build/asn1/TS17419_2014_CITSapplMgmtIDs.asn",
"asn1/raw/is_ts103301/iso-patched/ISO14906(2018)EfcDsrcGenericv7-patched.asn",
"asn1/raw/is_ts103301/iso-patched/ISO14906(2018)EfcDsrcApplicationv6-patched.asn",
"asn1/raw/is_ts103301/build/asn1/ISO-TS-19091-addgrp-C-2018-patched.asn",
"asn1/patched/is_ts103301/build/asn1/ISO14816_AVIAEINumberingAndDataStructures.asn",
"asn1/raw/is_ts103301/build/asn1/ISO19321IVIv2.asn",
"-t",
"ivim_ts",
"-o",
"etsi_its_msgs/etsi_its_ivim_ts_msgs/msg"
],
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "IVIM TS (conversion)",
"preLaunchTask": "Patch ASN.1 files",
"type": "debugpy",
"request": "launch",
"program": "utils/codegen/codegen-py/asn1ToConversionHeader.py",
"args": [
"asn1/raw/is_ts103301/IVIM-PDU-Descriptions.asn",
"asn1/raw/is_ts103301/cdd/ITS-Container.asn",
"asn1/raw/is_ts103301/iso-patched/ISO24534-3_ElectronicRegistrationIdentificationVehicleDataModule-patched.asn",
"asn1/raw/is_ts103301/iso-patched/ISO14823-missing.asn",
"asn1/raw/is_ts103301/build/asn1/TS17419_2014_CITSapplMgmtIDs.asn",
"asn1/raw/is_ts103301/iso-patched/ISO14906(2018)EfcDsrcGenericv7-patched.asn",
"asn1/raw/is_ts103301/iso-patched/ISO14906(2018)EfcDsrcApplicationv6-patched.asn",
"asn1/raw/is_ts103301/build/asn1/ISO-TS-19091-addgrp-C-2018-patched.asn",
"asn1/patched/is_ts103301/build/asn1/ISO14816_AVIAEINumberingAndDataStructures.asn",
"asn1/raw/is_ts103301/build/asn1/ISO19321IVIv2.asn",
"-t",
"ivim_ts",
"-o",
"etsi_its_conversion/etsi_its_ivim_ts_conversion/include/etsi_its_ivim_ts_conversion"
],
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "MAPEM TS (coding)",
"preLaunchTask": "Patch ASN.1 files",
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<a href="https://github.com/ika-rwth-aachen/etsi_its_messages/actions/workflows/doc.yml"><img src="https://github.com/ika-rwth-aachen/etsi_its_messages/actions/workflows/doc.yml/badge.svg"/></a>
<img src="https://img.shields.io/badge/ROS-noetic-blueviolet"/>
<img src="https://img.shields.io/badge/ROS 2-humble|iron|jazzy-blueviolet"/>
<img src="https://img.shields.io/badge/V2X-CAM|CPM|DENM|MAPEM|SPATEM|VAM-aqua"/>
<img src="https://img.shields.io/badge/V2X-CAM|CPM|DENM|IVIM|MAPEM|SPATEM|VAM-aqua"/>
</p>

**ROS / ROS 2 Support for ETSI ITS Messages for V2X Communication**
Expand Down Expand Up @@ -56,6 +56,7 @@ During runtime, the `etsi_its_conversion` ROS node converts incoming UDP payload
| :white_check_mark: | CAM | Cooperative Awareness Message | [EN 302 637-2 V1.4.1](https://www.etsi.org/deliver/etsi_en/302600_302699/30263702/01.04.01_60/en_30263702v010401p.pdf) ([ASN.1](https://forge.etsi.org/rep/ITS/asn1/cam_en302637_2)) | [TS 103 900 V2.1.1](https://www.etsi.org/deliver/etsi_ts/103900_103999/103900/02.01.01_60/ts_103900v020101p.pdf) ([ASN.1](https://forge.etsi.org/rep/ITS/asn1/cam_ts103900)) |
| :white_check_mark: | CPM | Collective Perception Message | - | [TS 103 324 V2.1.1](https://www.etsi.org/deliver/etsi_ts/103300_103399/103324/02.01.01_60/ts_103324v020101p.pdf) ([ASN.1](https://forge.etsi.org/rep/ITS/asn1/cpm_ts103324)) |
| :white_check_mark: | DENM | Decentralized Environmental Notification Message | [EN 302 637-3 V1.3.1](https://www.etsi.org/deliver/etsi_en/302600_302699/30263703/01.03.01_60/en_30263703v010301p.pdf) ([ASN.1](https://forge.etsi.org/rep/ITS/asn1/denm_en302637_3)) | - |
| :white_check_mark: | IVIM | In-Vehicle Information Message | - | [TS 103 301 V2.1.1](https://cdn.standards.iteh.ai/samples/59277/21ee1e46b905419c84f44b40713f4bbc/ETSI-TS-103-301-V2-1-1-2021-03-.pdf) ([ASN.1](https://forge.etsi.org/rep/ITS/asn1/is_ts103301/-/tree/v2.1.1/)) |
| :white_check_mark: | MAPEM | Map Extended Message | - | [TS 103 301 V2.1.1](https://www.etsi.org/deliver/etsi_ts/103300_103399/103301/02.01.01_60/ts_103301v020101p.pdf) ([ASN.1](https://forge.etsi.org/rep/ITS/asn1/is_ts103301/-/tree/v2.1.1?ref_type=tags)) |
| :white_check_mark: | SPATEM | Signal Phase and Timing Extended Message | - | [TS 103 301 V2.1.1](https://www.etsi.org/deliver/etsi_ts/103300_103399/103301/02.01.01_60/ts_103301v020101p.pdf) ([ASN.1](https://forge.etsi.org/rep/ITS/asn1/is_ts103301/-/tree/v2.1.1?ref_type=tags)) |
| :white_check_mark: | VAM | VRU Awareness Message | - | [TS 103 300-3 V2.2.1](https://www.etsi.org/deliver/etsi_ts/103300_103399/10330003/02.02.01_60/ts_10330003v020201p.pdf) ([ASN.1](https://forge.etsi.org/rep/ITS/asn1/vam-ts103300_3)) |
Expand Down
1 change: 1 addition & 0 deletions etsi_its_coding/etsi_its_coding/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<depend>etsi_its_cam_ts_coding</depend>
<depend>etsi_its_cpm_ts_coding</depend>
<depend>etsi_its_denm_coding</depend>
<depend>etsi_its_ivim_ts_coding</depend>
<depend>etsi_its_mapem_ts_coding</depend>
<depend>etsi_its_spatem_ts_coding</depend>
<depend>etsi_its_vam_ts_coding</depend>
Expand Down
69 changes: 69 additions & 0 deletions etsi_its_coding/etsi_its_ivim_ts_coding/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
cmake_minimum_required(VERSION 3.5)
project(etsi_its_ivim_ts_coding)

find_package(ros_environment REQUIRED QUIET)
set(ROS_VERSION $ENV{ROS_VERSION})

AUX_SOURCE_DIRECTORY(src SRC_FILES)

# === ROS 2 (AMENT) ============================================================
if(${ROS_VERSION} EQUAL 2)

find_package(ament_cmake REQUIRED)

add_library(${PROJECT_NAME} SHARED
${SRC_FILES}
)

target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)

ament_export_targets(${PROJECT_NAME}Targets HAS_LIBRARY_TARGET)

install(DIRECTORY include/
DESTINATION include
)

install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}Targets
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib
INCLUDES DESTINATION include
)

ament_package()

# === ROS (CATKIN) =============================================================
elseif(${ROS_VERSION} EQUAL 1)

find_package(catkin REQUIRED)

catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
)

include_directories(
include
${catkin_INCLUDE_DIRS}
)

add_library(${PROJECT_NAME} SHARED
${SRC_FILES}
)

install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h"
)

endif()
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*-
* Copyright (c) 2004-2017 Lev Walkin <[email protected]>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#ifndef ASN_TYPE_ANY_H
#define ASN_TYPE_ANY_H

#include <etsi_its_ivim_ts_coding/OCTET_STRING.h> /* Implemented via OCTET STRING type */

#ifdef __cplusplus
extern "C" {
#endif

typedef struct ANY {
uint8_t *buf; /* BER-encoded ANY contents */
int size; /* Size of the above buffer */

asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */
} ANY_t;

extern asn_TYPE_descriptor_t asn_DEF_ANY;
extern asn_TYPE_operation_t asn_OP_ANY;
extern asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs;

#define ANY_free OCTET_STRING_free

#if !defined(ASN_DISABLE_PRINT_SUPPORT)
#define ANY_print OCTET_STRING_print
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */

#define ANY_compare OCTET_STRING_compare
#define ANY_copy OCTET_STRING_copy

#define ANY_constraint asn_generic_no_constraint

#if !defined(ASN_DISABLE_BER_SUPPORT)
#define ANY_decode_ber OCTET_STRING_decode_ber
#define ANY_encode_der OCTET_STRING_encode_der
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */

#if !defined(ASN_DISABLE_XER_SUPPORT)
#define ANY_decode_xer OCTET_STRING_decode_xer_hex
xer_type_encoder_f ANY_encode_xer;
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */

#if !defined(ASN_DISABLE_JER_SUPPORT)
jer_type_decoder_f ANY_decode_jer;
jer_type_encoder_f ANY_encode_jer;
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */

#if !defined(ASN_DISABLE_UPER_SUPPORT)
per_type_decoder_f ANY_decode_uper;
per_type_encoder_f ANY_encode_uper;
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
#if !defined(ASN_DISABLE_APER_SUPPORT)
per_type_decoder_f ANY_decode_aper;
per_type_encoder_f ANY_encode_aper;
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */

/******************************
* Handy conversion routines. *
******************************/

/* Convert another ASN.1 type into the ANY. This implies DER encoding. */
int ANY_fromType(ANY_t *, asn_TYPE_descriptor_t *td, void *struct_ptr);
ANY_t *ANY_new_fromType(asn_TYPE_descriptor_t *td, void *struct_ptr);
#if !defined(ASN_DISABLE_APER_SUPPORT)
int ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr);
ANY_t *ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr);
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */

/* Convert the contents of the ANY type into the specified type. */
int ANY_to_type(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
#if !defined(ASN_DISABLE_APER_SUPPORT)
int ANY_to_type_aper(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */

#define ANY_fromBuf(s, buf, size) OCTET_STRING_fromBuf((s), (buf), (size))
#define ANY_new_fromBuf(buf, size) OCTET_STRING_new_fromBuf( \
&asn_DEF_ANY, (buf), (size))

#ifdef __cplusplus
}
#endif

#endif /* ASN_TYPE_ANY_H */
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*-
* Copyright (c) 2003-2017 Lev Walkin <[email protected]>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#ifndef _BIT_STRING_H_
#define _BIT_STRING_H_

#include <etsi_its_ivim_ts_coding/OCTET_STRING.h> /* Some help from OCTET STRING */

#ifdef __cplusplus
extern "C" {
#endif

typedef struct BIT_STRING_s {
uint8_t *buf; /* BIT STRING body */
size_t size; /* Size of the above buffer */

int bits_unused;/* Unused trailing bits in the last octet (0..7) */

asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */
} BIT_STRING_t;

extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING;
extern asn_TYPE_operation_t asn_OP_BIT_STRING;
extern asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs;

#define BIT_STRING_free OCTET_STRING_free

#if !defined(ASN_DISABLE_PRINT_SUPPORT)
asn_struct_print_f BIT_STRING_print; /* Human-readable output */
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */

asn_struct_compare_f BIT_STRING_compare;
asn_struct_copy_f BIT_STRING_copy;

asn_constr_check_f BIT_STRING_constraint;

#if !defined(ASN_DISABLE_BER_SUPPORT)
#define BIT_STRING_decode_ber OCTET_STRING_decode_ber
#define BIT_STRING_encode_der OCTET_STRING_encode_der
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */

#if !defined(ASN_DISABLE_XER_SUPPORT)
#define BIT_STRING_decode_xer OCTET_STRING_decode_xer_binary
xer_type_encoder_f BIT_STRING_encode_xer;
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */

#if !defined(ASN_DISABLE_JER_SUPPORT)
jer_type_decoder_f BIT_STRING_decode_jer;
jer_type_encoder_f BIT_STRING_encode_jer;
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */

#if !defined(ASN_DISABLE_OER_SUPPORT)
oer_type_decoder_f BIT_STRING_decode_oer;
oer_type_encoder_f BIT_STRING_encode_oer;
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */

#if !defined(ASN_DISABLE_UPER_SUPPORT)
per_type_decoder_f BIT_STRING_decode_uper;
per_type_encoder_f BIT_STRING_encode_uper;
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
#if !defined(ASN_DISABLE_APER_SUPPORT)
#define BIT_STRING_decode_aper OCTET_STRING_decode_aper
#define BIT_STRING_encode_aper OCTET_STRING_encode_aper
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */

#if !defined(ASN_DISABLE_RFILL_SUPPORT)
asn_random_fill_f BIT_STRING_random_fill;
#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */

const BIT_STRING_t *BIT_STRING__compactify(const BIT_STRING_t *st, BIT_STRING_t *tmp);

#ifdef __cplusplus
}
#endif

#endif /* _BIT_STRING_H_ */
Loading
Loading