Skip to content

Commit

Permalink
Merge pull request #29 from ika-rwth-aachen/cam-release2
Browse files Browse the repository at this point in the history
Add ETSI ITS CAM TS (release2)
  • Loading branch information
jpbusch authored Jul 29, 2024
2 parents 05767b6 + c5fe350 commit 62e54d0
Show file tree
Hide file tree
Showing 1,611 changed files with 117,422 additions and 1,236 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ jobs:
include:
- message: cam
script: ./utils/codegen/asn1ToC.py asn1/raw/cam_en302637_2/CAM-PDU-Descriptions.asn asn1/raw/cam_en302637_2/cdd/ITS-Container.asn -t cam -o etsi_its_coding/etsi_its_cam_coding -di asn1c:ci
- message: cam_ts
script: ./utils/codegen/asn1ToC.py asn1/raw/cam_ts103900/CAM-PDU-Descriptions.asn asn1/patched/cam_ts103900/cdd/ETSI-ITS-CDD.asn -t cam_ts -o etsi_its_coding/etsi_its_cam_ts_coding -di asn1c:ci
- message: denm
script: ./utils/codegen/asn1ToC.py asn1/raw/denm_en302637_3/DENM-PDU-Descriptions.asn asn1/raw/denm_en302637_3/cdd/ITS-Container.asn -t denm -o etsi_its_coding/etsi_its_denm_coding -di asn1c:ci
- message: cpm_ts
Expand Down Expand Up @@ -107,6 +109,8 @@ jobs:
include:
- message: cam
script: ./utils/codegen/codegen-rust/asn1ToRosMsg.py asn1/raw/cam_en302637_2/CAM-PDU-Descriptions.asn asn1/raw/cam_en302637_2/cdd/ITS-Container.asn -o etsi_its_msgs/etsi_its_cam_msgs/msg -di rgen:ci
- message: cam_ts
script: ./utils/codegen/codegen-rust/asn1ToRosMsg.py asn1/raw/cam_ts103900/CAM-PDU-Descriptions.asn asn1/patched/cam_ts103900/cdd/ETSI-ITS-CDD.asn -o etsi_its_msgs/etsi_its_cam_ts_msgs/msg -di rgen:ci
- message: denm
script: ./utils/codegen/codegen-rust/asn1ToRosMsg.py asn1/raw/denm_en302637_3/DENM-PDU-Descriptions.asn asn1/raw/denm_en302637_3/cdd/ITS-Container.asn -o etsi_its_msgs/etsi_its_denm_msgs/msg -di rgen:ci
- message: cpm_ts
Expand Down Expand Up @@ -147,6 +151,8 @@ jobs:
include:
- message: cam
script: ./utils/codegen/codegen-rust/asn1ToConversionHeader.py asn1/raw/cam_en302637_2/CAM-PDU-Descriptions.asn asn1/raw/cam_en302637_2/cdd/ITS-Container.asn -t cam -o etsi_its_conversion/etsi_its_cam_conversion/include/etsi_its_cam_conversion -di rgen:ci
- message: cam_ts
script: ./utils/codegen/codegen-rust/asn1ToConversionHeader.py asn1/raw/cam_ts103900/CAM-PDU-Descriptions.asn asn1/patched/cam_ts103900/cdd/ETSI-ITS-CDD.asn -t cam_ts -o etsi_its_conversion/etsi_its_cam_ts_conversion/include/etsi_its_cam_ts_conversion -di rgen:ci
- message: denm
script: ./utils/codegen/codegen-rust/asn1ToConversionHeader.py asn1/raw/denm_en302637_3/DENM-PDU-Descriptions.asn asn1/raw/denm_en302637_3/cdd/ITS-Container.asn -t denm -o etsi_its_conversion/etsi_its_denm_conversion/include/etsi_its_denm_conversion -di rgen:ci
- message: cpm_ts
Expand Down
44 changes: 44 additions & 0 deletions .gitlab-ci.codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,21 @@ etsi_its_cam_coding:
- rm -rf /builds/$CI_PROJECT_PATH/tmp
- if [[ ! -z "$(git status --porcelain)" ]]; then echo "Code generation script resulted in changes to the repository" && git diff; exit 1; fi

etsi_its_cam_ts_coding:
stage: asn1c
needs: ["asn1c-docker"]
script:
- >
./utils/codegen/asn1ToC.py
asn1/raw/cam_ts103900/CAM-PDU-Descriptions.asn
asn1/patched/cam_ts103900/cdd/ETSI-ITS-CDD.asn
-t cam_ts
-o etsi_its_coding/etsi_its_cam_ts_coding
-td /builds/$CI_PROJECT_PATH/tmp
-di ${_ASN1C_CI_IMAGE}
- rm -rf /builds/$CI_PROJECT_PATH/tmp
- if [[ ! -z "$(git status --porcelain)" ]]; then echo "Code generation script resulted in changes to the repository" && git diff; exit 1; fi

etsi_its_denm_coding:
stage: asn1c
needs: ["asn1c-docker"]
Expand Down Expand Up @@ -114,6 +129,20 @@ etsi_its_cam_msgs:
- rm -rf /builds/$CI_PROJECT_PATH/tmp
- if [[ ! -z "$(git status --porcelain)" ]]; then echo "Code generation script resulted in changes to the repository" && git diff; exit 1; fi

etsi_its_cam_ts_msgs:
stage: ROS Messages
needs: ["rgen-docker"]
script:
- >
./utils/codegen/codegen-rust/asn1ToRosMsg.py
asn1/raw/cam_ts103900/CAM-PDU-Descriptions.asn
asn1/patched/cam_ts103900/cdd/ETSI-ITS-CDD.asn
-o etsi_its_msgs/etsi_its_cam_ts_msgs/msg
-td /builds/$CI_PROJECT_PATH/tmp
-di ${_RGEN_CI_IMAGE}
- rm -rf /builds/$CI_PROJECT_PATH/tmp
- if [[ ! -z "$(git status --porcelain)" ]]; then echo "Code generation script resulted in changes to the repository" && git diff; exit 1; fi

etsi_its_denm_msgs:
stage: ROS Messages
needs: ["rgen-docker"]
Expand Down Expand Up @@ -161,6 +190,21 @@ etsi_its_cam_conversion:
- rm -rf /builds/$CI_PROJECT_PATH/tmp
- if [[ ! -z "$(git status --porcelain)" ]]; then echo "Code generation script resulted in changes to the repository" && git diff; exit 1; fi

etsi_its_cam_ts_conversion:
stage: Conversion Headers
needs: ["rgen-docker"]
script:
- >
./utils/codegen/codegen-rust/asn1ToConversionHeader.py
asn1/raw/cam_ts103900/CAM-PDU-Descriptions.asn
asn1/patched/cam_ts103900/cdd/ETSI-ITS-CDD.asn
-t cam_ts
-o etsi_its_conversion/etsi_its_cam_ts_conversion/include/etsi_its_cam_ts_conversion
-td /builds/$CI_PROJECT_PATH/tmp
-di ${_RGEN_CI_IMAGE}
- rm -rf /builds/$CI_PROJECT_PATH/tmp
- if [[ ! -z "$(git status --porcelain)" ]]; then echo "Code generation script resulted in changes to the repository" && git diff; exit 1; fi

etsi_its_denm_conversion:
stage: Conversion Headers
needs: ["rgen-docker"]
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[submodule "cam_en302637_2"]
path = asn1/raw/cam_en302637_2
url = https://forge.etsi.org/rep/ITS/asn1/cam_en302637_2
[submodule "asn1/raw/cam_ts103900"]
path = asn1/raw/cam_ts103900
url = https://forge.etsi.org/rep/ITS/asn1/cam_ts103900.git
[submodule "denm_en302637_3"]
path = asn1/raw/denm_en302637_3
url = https://forge.etsi.org/rep/ITS/asn1/denm_en302637_3.git
Expand Down
49 changes: 49 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,55 @@
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "CAM TS (coding)",
"preLaunchTask": "Patch ASN.1 files",
"type": "debugpy",
"request": "launch",
"program": "utils/codegen/asn1ToC.py",
"args": [
"asn1/raw/cam_ts103900/CAM-PDU-Descriptions.asn",
"asn1/patched/cam_ts103900/cdd/ETSI-ITS-CDD.asn",
"-t",
"cam_ts",
"-o",
"etsi_its_coding/etsi_its_cam_ts_coding"
],
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "CAM TS (msgs)",
"preLaunchTask": "Patch ASN.1 files",
"type": "debugpy",
"request": "launch",
"program": "utils/codegen/codegen-rust/asn1ToRosMsg.py",
"args": [
"asn1/raw/cam_ts103900/CAM-PDU-Descriptions.asn",
"asn1/patched/cam_ts103900/cdd/ETSI-ITS-CDD.asn",
"-o",
"etsi_its_msgs/etsi_its_cam_ts_msgs/msg"
],
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "CAM TS (conversion)",
"preLaunchTask": "Patch ASN.1 files",
"type": "debugpy",
"request": "launch",
"program": "utils/codegen/codegen-rust/asn1ToConversionHeader.py",
"args": [
"asn1/raw/cam_ts103900/CAM-PDU-Descriptions.asn",
"asn1/patched/cam_ts103900/cdd/ETSI-ITS-CDD.asn",
"-t",
"cam_ts",
"-o",
"etsi_its_conversion/etsi_its_cam_ts_conversion/include/etsi_its_cam_ts_conversion"
],
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "DENM (coding)",
"preLaunchTask": "Patch ASN.1 files",
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ During runtime, the `etsi_its_conversion` ROS node converts incoming UDP payload

| Status | Acronym | Name | EN Specification | TS Specification |
| --- | --- | --- | --- | --- |
| :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)) | - |
| :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)) | [ETSI 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: | 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: | 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)) |
| :soon: | MAPEM | Map Extended Message | - | - | - |
Expand All @@ -69,18 +69,21 @@ etsi_its_messages
├── etsi_its_coding
│ ├── etsi_its_coding # metapackage including all coding packages
│ ├── etsi_its_cam_coding
│ ├── etsi_its_cam_ts_coding
│ ├── etsi_its_cpm_ts_coding
│ └── etsi_its_denm_coding
├── etsi_its_conversion
│ ├── etsi_its_conversion # conversion node depending on all conversion packages
│ ├── etsi_its_cam_conversion
│ ├── etsi_its_cam_ts_conversion
│ ├── etsi_its_cpm_ts_conversion
│ ├── etsi_its_denm_conversion
│ └── etsi_its_primitives_conversion
├── etsi_its_messages # metapackage including all others
├── etsi_its_msgs
│ ├── etsi_its_msgs # metapackage including all msg packages
│ ├── etsi_its_cam_msgs
│ ├── etsi_its_cam_ts_msgs
│ ├── etsi_its_cpm_ts_msgs
│ └── etsi_its_denm_msgs
├── etsi_its_msgs_utils
Expand Down Expand Up @@ -155,6 +158,7 @@ rosrun nodelet nodelet standalone etsi_its_conversion/Converter _etsi_types:=[ca
| --- | --- | --- |
| `~/udp/in` | `udp_msgs/msg/UdpPacket` | UDP payload for conversion to ROS |
| `~/cam/in` | `etsi_its_cam_msgs/msg/CAM` | CAM for conversion to UDP |
| `~/cam_ts/in` | `etsi_its_cam_ts_msgs/msg/CAM` | CAM (TS) for conversion to UDP |
| `~/cpm_ts/in` | `etsi_its_cpm_ts_msgs/msg/CollectivePerceptionMessage` | CPM for conversion to UDP |
| `~/denm/in` | `etsi_its_denm_msgs/msg/DENM` | DENM for conversion to UDP |

Expand All @@ -164,6 +168,7 @@ rosrun nodelet nodelet standalone etsi_its_conversion/Converter _etsi_types:=[ca
| --- | --- | --- |
| `~/udp/out` | `udp_msgs/msg/UdpPacket` | UDP payload converted from ROS message |
| `~/cam/out` | `etsi_its_cam_msgs/msg/CAM` | CAM converted from UDP payload |
| `~/cam_ts/out` | `etsi_its_cam_ts_msgs/msg/CAM` | CAM (TS) converted from UDP payload |
| `~/cpm_ts/out` | `etsi_its_cpm_ts_msgs/msg/CollectivePerceptionMessage` | CPM converted from UDP payload |
| `~/denm/out` | `etsi_its_denm_msgs/msg/DENM` | DENM converted from UDP payload |

Expand All @@ -174,7 +179,8 @@ rosrun nodelet nodelet standalone etsi_its_conversion/Converter _etsi_types:=[ca
| `has_btp_destination_port` | `bool` | whether incoming/outgoing UDP messages include a [2-byte BTP destination port](https://www.etsi.org/deliver/etsi_en/302600_302699/3026360501/02.01.00_20/en_3026360501v020100a.pdf) |
| `btp_destination_port_offset` | `int` | number of bytes before an optional 2-byte BTP destination port, see `has_btp_destination_port` (always `0` in outgoing UDP payload) |
| `etsi_message_payload_offset` | `int` | number of bytes before actual ETSI message payload (always `0` or `4` (if `has_btp_destination_port`) in outgoing UDP payload) |
| `etsi_types` | `string[]` | list of ETSI types to convert | `cam`, `cpm_ts`, `denm` |
| `ros2udp_etsi_types` | `string[]` | list of ETSI types to convert from `etsi_its_msgs` to `udp_msgs` (defaults to all norms and specifications of all possible ETSI types) | `cam`, `cam_ts`, `cpm_ts`, `denm` |
| `udp2ros_etsi_types` | `string[]` | list of ETSI types to convert from `udp_msgs` to `etsi_its_msgs` (defaults only to the norm or specification of all possible ETSI types) | `cam`, `cam_ts`, `cpm_ts`, `denm` |
| `subscriber_queue_size` | `int` | queue size for incoming ROS messages |
| `publisher_queue_size` | `int` | queue size for outgoing ROS messages |

Expand Down
46 changes: 46 additions & 0 deletions asn1/patches/cam_ts103900/cdd/ETSI-ITS-CDD.asn.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
diff --git a/ETSI-ITS-CDD.asn b/ETSI-ITS-CDD.asn
index d6f5faa..14f963f 100755
--- a/ETSI-ITS-CDD.asn
+++ b/ETSI-ITS-CDD.asn
@@ -3058,16 +3058,6 @@ StationaryVehicleSubCauseCode ::= INTEGER {
*/
StationId ::= INTEGER(0..4294967295)

-/**
- * This DE represents the identifier of an ITS-S.
- * The ITS-S ID may be a pseudonym. It may change over space and/or over time.
- *
- * @note: this DE is kept for backwards compatibility reasons only. It is recommended to use the @ref StationId instead.
- * @category: Basic information
- * @revision: V1.3.1
- */
-StationID ::= INTEGER(0..4294967295)
-
/**
* This DE represents the type of technical context the ITS-S is integrated in.
* The station type depends on the integration environment of ITS-S into vehicle, mobile devices or at infrastructure.
@@ -4182,24 +4172,6 @@ ActionId ::= SEQUENCE {
sequenceNumber SequenceNumber
}

-/**
- * This DF represents an identifier used to describe a protocol action taken by an ITS-S.
- *
- * It shall include the following components:
- *
- * @field originatingStationId: Id of the ITS-S that takes the action.
- *
- * @field sequenceNumber: a sequence number.
- *
- * @note: this DF is kept for backwards compatibility reasons only. It is recommended to use the @ref ActionId instead.
- * @category: Communication information
- * @revision: V1.3.1
- */
-ActionID ::= SEQUENCE {
- originatingStationId StationID,
- sequenceNumber SequenceNumber
-}
-
/**
* This DF shall contain a list of @ref ActionId.

1 change: 1 addition & 0 deletions asn1/raw/cam_ts103900
Submodule cam_ts103900 added at b96bfe
69 changes: 69 additions & 0 deletions etsi_its_coding/etsi_its_cam_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_cam_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()
Loading

0 comments on commit 62e54d0

Please sign in to comment.