Skip to content

Use new Blueberry v2.0.3 feature request-response and its discovery #84

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c9006a8
Implement create and destroy methods for service and client (#76)
mossmaurice-apexai Mar 31, 2022
57b5b7f
Implement wrapper classes for client and server and add type introspe…
mossmaurice-apexai Apr 5, 2022
d73422a
Update Readme (#76)
mossmaurice-apexai Jan 2, 2023
287a211
Implement 'rmw_send_request', 'rmw_take_request' and 'rmw_take_response'
mossmaurice-apexai Jan 3, 2023
64870a1
Add fixed-size path for 'rmw_send_response' and 'rmw_take_response' (…
mossmaurice-apexai Jan 4, 2023
146ada8
Create server and client abstraction (#76)
mossmaurice-apexai Jan 4, 2023
7db68cb
Fix 'is_fixed_size' for ROS 2 services (#76)
mossmaurice-apexai Jan 4, 2023
5f84993
Properly destroy services and clients and add serialization for services
mossmaurice-apexai Jan 4, 2023
60ea893
Fix typo leading to a segfault (#76)
mossmaurice-apexai Jan 4, 2023
998edd1
Attach servers and clients to waitset (#76)
mossmaurice-apexai Jan 4, 2023
1d4b469
Remove debug prints and add de-serialization to 'rmw_send_response' (…
mossmaurice-apexai Jan 4, 2023
1911d21
Add missing remove-from-waitset part (#76)
mossmaurice-apexai Jan 4, 2023
917da67
Do not send 'request_header' over user payload (#76)
mossmaurice-apexai Jan 5, 2023
56cc840
Properly save the sample in 'rwm_take_request' (#76)
mossmaurice-apexai Jan 5, 2023
57cc79a
Fix lost responses issue (#76)
mossmaurice-apexai Jan 5, 2023
ce02908
Implement 'rmw_get_service_names_and_types' (#76)
mossmaurice-apexai Jan 5, 2023
eebf11b
Format all the things (#76)
mossmaurice-apexai Jan 5, 2023
577ddce
Update CI and docs (#76)
mossmaurice-apexai Jan 5, 2023
3c278f1
Add copyright notice to all touched files (#76)
mossmaurice-apexai Jan 5, 2023
8cd3111
Fix cpplint warnings (#76)
mossmaurice-apexai Jan 5, 2023
18ab525
Update Ubuntu version to be able to build for humble (#76)
mossmaurice-apexai Jan 5, 2023
8b67b38
Check request pointer for 'nullptr' (#76)
mossmaurice-apexai Jan 9, 2023
bb005ce
Remove out-commented code and implement setting the GUID (#76)
mossmaurice-apexai Jan 11, 2023
b186509
Move the code to inside the happy-path lambda for client server commu…
mossmaurice-apexai Jan 11, 2023
6546111
Use default alignment when loaning for request/response (#76)
mossmaurice-apexai Jan 12, 2023
cbb145d
Remove sleeps in 'rmw_send_response' as fix will be in 'v2.0.3' relea…
mossmaurice-apexai Jan 24, 2023
78201e1
Update version number in package.xml (#76)
mossmaurice-apexai Jan 25, 2023
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/custom_repos.repos

This file was deleted.

11 changes: 5 additions & 6 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:
- master
- humble
pull_request:

jobs:
Expand All @@ -12,18 +12,17 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
os: [ubuntu-22.04]
steps:
- uses: actions/checkout@v2
- name: Setup ROS
uses: ros-tooling/setup-ros@master
with:
required-ros-distributions: humble
- 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
target-ros2-distro: rolling
vcs-repo-file-url: |
https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos
${{ github.workspace }}/.github/workflows/custom_repos.repos
target-ros2-distro: humble
21 changes: 4 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,13 @@ To install rmw_iceoryx in a ROS 2 workspace with the latest ROS version, just ex
```bash
mkdir -p ~/iceoryx_ws/src
cd $_
# LATEST_ROS_VERSION could be e.g. galactic
# LATEST_ROS_VERSION could be e.g. humble
git clone --branch LATEST_ROS_VERSION 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 starting with Eloquent release.

If you want to use ROS 2 rolling, you need to checkout the `master` branch of both rmw_iceoryx and iceoryx:

```bash
cd ~/iceoryx_ws/
wget https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos
# Change the line of Eclipse iceoryx to "version: master"
vcs import src < ros2.repos

cd ~/iceoryx_ws/src
git clone --branch master https://github.com/ros2/rmw_iceoryx.git
```

Assuming you have ROS 2 installed correctly, you can compile the iceoryx workspace with colcon:

```bash
Expand All @@ -47,7 +34,7 @@ colcon build
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF
```

That's it! You've installed rmw_iceoryx and are ready to rumble.
That's it! You've installed iceoryx and are ready to rumble.

Working with rmw_iceoryx_cpp
============================
Expand Down Expand Up @@ -154,8 +141,8 @@ Unfortunately, not all features are yet fully fleshed out.
| `ros2 node list` | :heavy_check_mark: |
| `ros2 node info` | :heavy_check_mark: |
| `ros2 interface *` | :heavy_check_mark: |
| `ros2 service *` | :x: (coming with iceoryx v2.0) |
| `ros2 param list` | :x: (coming with iceoryx v2.0) |
| `ros2 service *` | :heavy_check_mark: |
| `ros2 param list` | :x: |
| `rqt_graph` | :heavy_check_mark: |
| `rqt_top` | :heavy_check_mark: |
| `rqt_console` | :heavy_check_mark: |
Expand Down
12 changes: 12 additions & 0 deletions rmw_iceoryx_cpp/include/rmw_iceoryx_cpp/iceoryx_deserialize.hpp
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) 2023 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,6 +17,7 @@
#define RMW_ICEORYX_CPP__ICEORYX_DESERIALIZE_HPP_

struct rosidl_message_type_support_t;
struct rosidl_service_type_support_t;

namespace rmw_iceoryx_cpp
{
Expand All @@ -26,5 +28,15 @@ void deserialize(
const rosidl_message_type_support_t * type_supports,
void * ros_message);

void deserializeRequest(
const char * serialized_msg,
const rosidl_service_type_support_t * type_supports,
void * ros_message);

void deserializeResponse(
const char * serialized_msg,
const rosidl_service_type_support_t * type_supports,
void * ros_message);

} // namespace rmw_iceoryx_cpp
#endif // RMW_ICEORYX_CPP__ICEORYX_DESERIALIZE_HPP_
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved.
// Copyright (c) 2021 by ZhenshengLee. All rights reserved.
// Copyright (c) 2023 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 @@ -23,6 +24,7 @@
#include "iceoryx_hoofs/cxx/string.hpp"

struct rosidl_message_type_support_t;
struct rosidl_service_type_support_t;

namespace rmw_iceoryx_cpp
{
Expand Down Expand Up @@ -71,5 +73,10 @@ get_iceoryx_service_description(
const std::string & topic,
const rosidl_message_type_support_t * type_supports);

iox::capro::ServiceDescription
get_iceoryx_service_description(
const std::string & topic,
const rosidl_service_type_support_t * type_supports);

} // namespace rmw_iceoryx_cpp
#endif // RMW_ICEORYX_CPP__ICEORYX_NAME_CONVERSION_HPP_
12 changes: 12 additions & 0 deletions rmw_iceoryx_cpp/include/rmw_iceoryx_cpp/iceoryx_serialize.hpp
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) 2023 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 @@ -18,6 +19,7 @@
#include <vector>

struct rosidl_message_type_support_t;
struct rosidl_service_type_support_t;

namespace rmw_iceoryx_cpp
{
Expand All @@ -27,5 +29,15 @@ void serialize(
const rosidl_message_type_support_t * type_supports,
std::vector<char> & payload_vector);

void serializeRequest(
const void * ros_message,
const rosidl_service_type_support_t * type_supports,
std::vector<char> & payload_vector);

void serializeResponse(
const void * ros_message,
const rosidl_service_type_support_t * type_supports,
std::vector<char> & payload_vector);

} // namespace rmw_iceoryx_cpp
#endif // RMW_ICEORYX_CPP__ICEORYX_SERIALIZE_HPP_
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) 2023 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 @@ -35,6 +36,7 @@ void fill_topic_containers(
std::map<std::string, std::vector<std::string>> & topic_publishers_);

std::map<std::string, std::string> get_topic_names_and_types();
std::map<std::string, std::string> get_service_names_and_types();

std::map<std::string, std::vector<std::string>> get_nodes_and_publishers();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved.
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved.
// Copyright (c) 2021 - 2023 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,6 +20,7 @@
#include <utility>

struct rosidl_message_type_support_t;
struct rosidl_service_type_support_t;

namespace rmw_iceoryx_cpp
{
Expand All @@ -35,15 +36,26 @@ enum class TypeSupportLanguage
const std::pair<TypeSupportLanguage, const rosidl_message_type_support_t *> get_type_support(
const rosidl_message_type_support_t * type_supports);

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

bool iceoryx_is_fixed_size(const rosidl_message_type_support_t * type_supports);
bool iceoryx_is_fixed_size(const rosidl_service_type_support_t * type_supports);

bool iceoryx_is_valid_type_support(const rosidl_message_type_support_t * type_supports);
bool iceoryx_is_valid_type_support(const rosidl_service_type_support_t * type_supports);

size_t iceoryx_get_message_size(const rosidl_message_type_support_t * type_supports);
size_t iceoryx_get_request_size(const rosidl_service_type_support_t * type_supports);
size_t iceoryx_get_response_size(const rosidl_service_type_support_t * type_supports);

std::string iceoryx_get_message_name(const rosidl_message_type_support_t * type_supports);
std::string iceoryx_get_service_name(const rosidl_service_type_support_t * type_supports);

std::string iceoryx_get_message_namespace(const rosidl_message_type_support_t * type_supports);
std::string iceoryx_get_service_namespace(const rosidl_service_type_support_t * type_supports);

void iceoryx_init_message(
const rosidl_message_type_support_t * type_supports,
Expand Down
2 changes: 1 addition & 1 deletion rmw_iceoryx_cpp/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_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
<name>rmw_iceoryx_cpp</name>
<version>1.0.1</version>
<version>2.0.3</version>
<description>rmw implementation for Bosch's zero copy middleware iceoryx</description>
<maintainer email="[email protected]">Karsten Knese</maintainer>
<license>Apache License 2.0</license>
Expand Down
39 changes: 38 additions & 1 deletion rmw_iceoryx_cpp/src/internal/iceoryx_deserialize.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019 by Robert Bosch GmbH. All rights reserved.
// Copyright (c) 2021 by Apex.AI Inc. All rights reserved.
// Copyright (c) 2021 - 2023 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 @@ -17,6 +17,7 @@

#include "rosidl_typesupport_introspection_c/identifier.h"
#include "rosidl_typesupport_introspection_c/message_introspection.h"
#include "rosidl_typesupport_introspection_c/service_introspection.h"

#include "rosidl_typesupport_introspection_cpp/identifier.hpp"
#include "rosidl_typesupport_introspection_cpp/message_introspection.hpp"
Expand Down Expand Up @@ -50,4 +51,40 @@ void deserialize(
}
}

void deserializeRequest(
const char * serialized_msg,
const rosidl_service_type_support_t * type_supports,
void * ros_message)
{
auto ts = get_type_support(type_supports);

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

void deserializeResponse(
const char * serialized_msg,
const rosidl_service_type_support_t * type_supports,
void * ros_message)
{
auto ts = get_type_support(type_supports);

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

} // namespace rmw_iceoryx_cpp
18 changes: 18 additions & 0 deletions rmw_iceoryx_cpp/src/internal/iceoryx_deserialize_typesupport_c.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved.
// Copyright (c) 2023 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 @@ -27,6 +28,7 @@

#include "rosidl_typesupport_introspection_c/field_types.h"
#include "rosidl_typesupport_introspection_c/message_introspection.h"
#include "rosidl_typesupport_introspection_c/service_introspection.h"

#include "./iceoryx_serialization_common.hpp"

Expand Down Expand Up @@ -239,6 +241,22 @@ const char * deserialize(
return serialized_msg;
}

const char * deserializeResponse(
const char * serialized_msg,
const rosidl_typesupport_introspection_c__ServiceMembers * service_members,
void * ros_message)
{
return deserialize(serialized_msg, service_members->response_members_, ros_message);
}

const char * deserializeRequest(
const char * serialized_msg,
const rosidl_typesupport_introspection_c__ServiceMembers * service_members,
void * ros_message)
{
return deserialize(serialized_msg, service_members->request_members_, ros_message);
}

} // namespace details_c
} // namespace rmw_iceoryx_cpp
#endif // INTERNAL__ICEORYX_DESERIALIZE_TYPESUPPORT_C_HPP_
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved.
// Copyright (c) 2023 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 @@ -24,7 +25,7 @@
#include <vector>

#include "rosidl_typesupport_introspection_cpp/field_types.hpp"
#include "rosidl_typesupport_introspection_cpp/message_introspection.hpp"
#include "rosidl_typesupport_introspection_cpp/service_introspection.hpp"

#include "./iceoryx_serialization_common.hpp"

Expand Down Expand Up @@ -309,6 +310,22 @@ const char * deserialize(
return serialized_msg;
}

const char * deserializeResponse(
const char * serialized_msg,
const rosidl_typesupport_introspection_cpp::ServiceMembers * service_members,
void * ros_message)
{
return deserialize(serialized_msg, service_members->response_members_, ros_message);
}

const char * deserializeRequest(
const char * serialized_msg,
const rosidl_typesupport_introspection_cpp::ServiceMembers * service_members,
void * ros_message)
{
return deserialize(serialized_msg, service_members->request_members_, ros_message);
}

} // namespace details_cpp
} // namespace rmw_iceoryx_cpp
#endif // INTERNAL__ICEORYX_DESERIALIZE_TYPESUPPORT_CPP_HPP_
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2021 by ZhenshengLee. All rights reserved.
// Copyright (c) 2023 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 @@ -117,7 +118,7 @@ fill_rmw_publisher_end_info(

int i = 0;
// store all data in rmw_topic_endpoint_info_array_t
for (const auto node_full_name : full_name_array) {
for (const auto & node_full_name : full_name_array) {
auto name_n_space = get_name_n_space_from_node_full_name(node_full_name);
auto rmw_topic_endpoint_info = rmw_get_zero_initialized_topic_endpoint_info();
// duplicate and store the topic_name
Expand Down Expand Up @@ -204,7 +205,7 @@ fill_rmw_subscriber_end_info(

int i = 0;
// store all data in rmw_topic_endpoint_info_array_t
for (const auto node_full_name : full_name_array) {
for (const auto & node_full_name : full_name_array) {
auto name_n_space = get_name_n_space_from_node_full_name(node_full_name);
auto rmw_topic_endpoint_info = rmw_get_zero_initialized_topic_endpoint_info();
// duplicate and store the topic_name
Expand Down
Loading