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

Relocate sample scripts #44

Merged
merged 4 commits into from
Nov 14, 2024
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
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ All message definitions and conversion functions are automatically generated bas
- [Packages](#packages)
- [Installation](#installation)
- [Conversion Node](#conversion-node)
- [Sample Messages](#sample-messages)
- [Access Functions](#access-functions)
- [Code Generation](#code-generation)
- [V2AIX Dataset / Citation](#v2aix-dataset--citation)
Expand Down Expand Up @@ -192,6 +193,36 @@ rosrun nodelet nodelet standalone etsi_its_conversion/Converter _etsi_types:=[ca
| `check_constraints_before_encoding` | `bool` | whether an asn constraint check should be performed before encoding using asn1c's `asn_check_constraints` function (setting to `true` could lead to segmentation faults because of infinite recursion; [known asn1c issue](https://github.com/vlm/asn1c/issues/410)) |


## Sample Messages

The `etsi_its_msgs_utils` package contains simple ROS 2 nodes for publishing sample ROS 2 messages of the supported ETSI ITS message types, see [`./etsi_its_msgs_utils/samples/`](./etsi_its_msgs_utils/samples/). For example, publish a sample CPM by running the following.

```bash
# ROS 2 only
ros2 run etsi_its_msgs_utils publish_cpm_ts.py
```

You can then visualize the CPM in RViz with the provided demo configuration.

```bash
# ROS 2 only
ros2 launch etsi_its_rviz_plugins demo.launch.py
```

And finally, run the [Conversion Node](#conversion-node) to convert ROS 2 messages to binary payloads.

```bash
# ROS 2 only
ros2 run etsi_its_conversion etsi_its_conversion_node \
--ros-args \
-r __node:=etsi_its_conversion \
-r /etsi_its_conversion/udp/out:=/etsi_its_conversion/udp/in \
-p has_btp_destination_port:=true \
-p btp_destination_port_offset:=0 \
-p etsi_message_payload_offset:=4
```


## Access Functions

The `etsi_its_msgs_utils` package contains header-only libraries providing helpful access functions for modifying the deeply nested ROS messages equivalents of the ETSI ITS messages. All access functions are [documented here](https://ika-rwth-aachen.github.io/etsi_its_messages/).
Expand Down
11 changes: 11 additions & 0 deletions etsi_its_msgs_utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ if(${ROS_VERSION} EQUAL 2)
DESTINATION include/${PROJECT_NAME}
)

# install all sample python scripts
file(GLOB SAMPLE_SCRIPTS "samples/publish_*.py")
install(
FILES "samples/utils.py"
DESTINATION lib/${PROJECT_NAME}
)
install(
PROGRAMS ${SAMPLE_SCRIPTS}
DESTINATION lib/${PROJECT_NAME}
)

install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}Targets
ARCHIVE DESTINATION lib
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,13 @@ def publish(self):
perceived_object.position.y_coordinate.confidence.value = perceived_object.position.y_coordinate.confidence.UNAVAILABLE
perceived_object.object_dimension_x_is_present = True
perceived_object.object_dimension_x.value.value = int(3.5 * 1e1)
perceived_object.object_dimension_x.confidence.value = perceived_object.object_dimension_x.confidence.UNAVAILABLE
perceived_object.object_dimension_y_is_present = True
perceived_object.object_dimension_y.value.value = int(1.8 * 1e1)
perceived_object.object_dimension_y.confidence.value = perceived_object.object_dimension_y.confidence.UNAVAILABLE
perceived_object.object_dimension_z_is_present = True
perceived_object.object_dimension_z.value.value = int(1.6 * 1e1)
perceived_object.object_dimension_z.confidence.value = perceived_object.object_dimension_z.confidence.UNAVAILABLE
perceived_object_container.perceived_objects.array.append(perceived_object)

cpm_container.container_data.perceived_object_container = perceived_object_container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
# SOFTWARE.
# ==============================================================================

# Sample CPM from 4th ETSI C-V2X Plugtests, Malaga/ESP, Sep 2024

import rclpy
from rclpy.node import Node
from etsi_its_cpm_ts_msgs.msg import *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
# SOFTWARE.
# ==============================================================================

# Sample CPM from 4th ETSI C-V2X Plugtests, Malaga/ESP, Sep 2024

import rclpy
from rclpy.node import Node
from etsi_its_cpm_ts_msgs.msg import *
Expand Down
File renamed without changes.
31 changes: 0 additions & 31 deletions utils/scripts/README.md

This file was deleted.

Loading