Skip to content
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
5 changes: 0 additions & 5 deletions .github/workflows/additional_repos.repos

This file was deleted.

8 changes: 3 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Integration build rmw_iceoryx
on:
push:
branches:
- foxy
- galactic
pull_request:

jobs:
Expand All @@ -18,13 +18,11 @@ jobs:
- name: Setup ROS
uses: ros-tooling/setup-ros@master
with:
required-ros-distributions: foxy
required-ros-distributions: galactic
- name: Install Iceoryx Dependencies
run: sudo apt-get update && sudo apt-get install -y cmake libacl1-dev libncurses5-dev pkg-config
- name: Build & Test
uses: ros-tooling/action-ros-ci@master
with:
package-name: rmw_iceoryx_cpp iceoryx_ros2_bridge
target-ros2-distro: foxy
vcs-repo-file-url: |
./.github/workflows/additional_repos.repos
target-ros2-distro: galactic
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ git clone https://github.com/ros2/rmw_iceoryx.git
```
For alternative installation instructions and more details about iceoryx's internals, please see [iceoryx's GitHub repo](https://github.com/eclipse/iceoryx).

rmw_iceoryx is compatible with ROS 2 Foxy.
rmw_iceoryx is compatible with ROS 2 Galactic.
Assuming you have ROS2 installed correctly, you can compile the iceoryx workspace with colcon:

```
cd ~/iceoryx_ws/
source /opt/ros/foxy/setup.bash # alternatively source your own ROS 2 workspace
source /opt/ros/galactic/setup.bash # alternatively source your own ROS 2 workspace
colcon build
# or with more options
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF
Expand Down
9 changes: 9 additions & 0 deletions iceoryx_ros2_bridge/src/generic_subscription.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2018, Bosch Software Innovations GmbH.
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -88,6 +89,14 @@ void GenericSubscription::return_serialized_message(
message.reset();
}

void GenericSubscription::handle_serialized_message(
const std::shared_ptr<rclcpp::SerializedMessage> & serialized_message,
const rclcpp::MessageInfo & message_info)
{
(void) serialized_message;
(void) message_info;
}

void GenericSubscription::handle_loaned_message(
void * loaned_message,
const rclcpp::MessageInfo & message_info)
Expand Down
5 changes: 5 additions & 0 deletions iceoryx_ros2_bridge/src/generic_subscription.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2018, Bosch Software Innovations GmbH.
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -80,6 +81,10 @@ class GenericSubscription : public rclcpp::SubscriptionBase

void return_serialized_message(std::shared_ptr<rclcpp::SerializedMessage> & message) override;

void handle_serialized_message(
const std::shared_ptr<rclcpp::SerializedMessage> & serialized_message,
const rclcpp::MessageInfo & message_info);

void handle_loaned_message(
void * loaned_message, const rclcpp::MessageInfo & message_info) override;

Expand Down
2 changes: 2 additions & 0 deletions rmw_iceoryx_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,13 @@ add_library(rmw_iceoryx_cpp SHARED
src/rmw_guard_condition.cpp
src/rmw_init.cpp
src/rmw_logging.cpp
src/rmw_network_flow_endpoint.cpp
src/rmw_node.cpp
src/rmw_node_info_and_types.cpp
src/rmw_node_names.cpp
src/rmw_publish.cpp
src/rmw_publisher.cpp
src/rmw_qos.cpp
src/rmw_request.cpp
src/rmw_response.cpp
src/rmw_serialize.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved.
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -16,12 +17,24 @@
#define RMW_ICEORYX_CPP__ICEORYX_TYPE_INFO_INTROSPECTION_HPP_

#include <string>
#include <utility>

struct rosidl_message_type_support_t;

namespace rmw_iceoryx_cpp
{

enum class TypeSupportLanguage
{
CPP,
C
};

/// @brief Wraps get_message_typesupport_handle() and does error handling
/// @return std::pair containing enum TypeSupportLanguage and handle to the type support
const std::pair<TypeSupportLanguage, const rosidl_message_type_support_t *> get_type_support(
const rosidl_message_type_support_t * type_supports);

bool iceoryx_is_fixed_size(const rosidl_message_type_support_t * type_supports);

bool iceoryx_is_valid_type_support(const rosidl_message_type_support_t * type_supports);
Expand Down
32 changes: 14 additions & 18 deletions rmw_iceoryx_cpp/src/internal/iceoryx_deserialize.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved.
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -20,7 +21,10 @@
#include "rosidl_typesupport_introspection_cpp/identifier.hpp"
#include "rosidl_typesupport_introspection_cpp/message_introspection.hpp"

#include "rcutils/error_handling.h"

#include "rmw_iceoryx_cpp/iceoryx_deserialize.hpp"
#include "rmw_iceoryx_cpp/iceoryx_type_info_introspection.hpp"

#include "./iceoryx_deserialize_typesupport_c.hpp"
#include "./iceoryx_deserialize_typesupport_cpp.hpp"
Expand All @@ -33,24 +37,16 @@ void deserialize(
const rosidl_message_type_support_t * type_supports,
void * ros_message)
{
// serialize with cpp typesupport
auto ts_cpp = get_message_typesupport_handle(
type_supports,
rosidl_typesupport_introspection_cpp::typesupport_identifier);
if (ts_cpp != nullptr) {
auto members =
static_cast<const rosidl_typesupport_introspection_cpp::MessageMembers *>(ts_cpp->data);
rmw_iceoryx_cpp::details_cpp::deserialize(serialized_msg, members, ros_message);
}

// serialize with c typesupport
auto ts_c = get_message_typesupport_handle(
type_supports,
rosidl_typesupport_introspection_c__identifier);
if (ts_c != nullptr) {
auto members =
static_cast<const rosidl_typesupport_introspection_c__MessageMembers *>(ts_c->data);
rmw_iceoryx_cpp::details_c::deserialize(serialized_msg, members, ros_message);
auto ts = get_type_support(type_supports);

if (ts.first == TypeSupportLanguage::CPP) {
auto members_cpp =
static_cast<const rosidl_typesupport_introspection_cpp::MessageMembers *>(ts.second->data);
rmw_iceoryx_cpp::details_cpp::deserialize(serialized_msg, members_cpp, ros_message);
} else if (ts.first == TypeSupportLanguage::C) {
auto members_c =
static_cast<const rosidl_typesupport_introspection_c__MessageMembers *>(ts.second->data);
rmw_iceoryx_cpp::details_c::deserialize(serialized_msg, members_c, ros_message);
}
}

Expand Down
24 changes: 10 additions & 14 deletions rmw_iceoryx_cpp/src/internal/iceoryx_serialize.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved.
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -22,7 +23,10 @@
#include "rosidl_typesupport_introspection_cpp/identifier.hpp"
#include "rosidl_typesupport_introspection_cpp/message_introspection.hpp"

#include "rcutils/error_handling.h"

#include "rmw_iceoryx_cpp/iceoryx_serialize.hpp"
#include "rmw_iceoryx_cpp/iceoryx_type_info_introspection.hpp"

#include "./iceoryx_serialize_typesupport_c.hpp"
#include "./iceoryx_serialize_typesupport_cpp.hpp"
Expand All @@ -35,23 +39,15 @@ void serialize(
const rosidl_message_type_support_t * type_supports,
std::vector<char> & payload_vector)
{
// serialize with cpp typesupport
auto ts_cpp = get_message_typesupport_handle(
type_supports,
rosidl_typesupport_introspection_cpp::typesupport_identifier);
if (ts_cpp != nullptr) {
auto ts = get_type_support(type_supports);

if (ts.first == TypeSupportLanguage::CPP) {
auto members =
static_cast<const rosidl_typesupport_introspection_cpp::MessageMembers *>(ts_cpp->data);
static_cast<const rosidl_typesupport_introspection_cpp::MessageMembers *>(ts.second->data);
rmw_iceoryx_cpp::details_cpp::serialize(ros_message, members, payload_vector);
}

// serialize with c typesupport
auto ts_c = get_message_typesupport_handle(
type_supports,
rosidl_typesupport_introspection_c__identifier);
if (ts_c != nullptr) {
} else if (ts.first == TypeSupportLanguage::C) {
auto members =
static_cast<const rosidl_typesupport_introspection_c__MessageMembers *>(ts_c->data);
static_cast<const rosidl_typesupport_introspection_c__MessageMembers *>(ts.second->data);
rmw_iceoryx_cpp::details_c::serialize(ros_message, members, payload_vector);
}
}
Expand Down
Loading