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

Port zenoh_c to zenoh_cpp #327

Merged
merged 17 commits into from
Dec 17, 2024
Merged

Port zenoh_c to zenoh_cpp #327

merged 17 commits into from
Dec 17, 2024

Conversation

ahcorde
Copy link
Contributor

@ahcorde ahcorde commented Dec 4, 2024

For visibility reason I created a branch called dev/1.0.0 in this repository, otherwise I can't open the PR

The goal of this PR is to port the zenoh_c API to zenoh_cpp.

I added a hack in the zenoh_cpp API to be able to make the transition easier. Edit the following file:

nano +83 install/opt/zenoh_cpp_vendor/include/zenoh/api/base.hxx

And add this change:

public:
    OwnedType _0;
protected:

  • zenohd is ported to zenoh_cpp

@ahcorde ahcorde self-assigned this Dec 4, 2024
@ahcorde
Copy link
Contributor Author

ahcorde commented Dec 6, 2024

Pacakge Test Reason
rcl None
rcl_action None
rcl_lifecycle None
rcl_yaml None
rcl_yaml_param_parser None
rclcpp test_executors
rclcpp_components test_executors
rclcpp_action None
rclcpp_lifecycle None
rclcpp_components None

rclcpp

test_executors

95: /home/ahcorde/ros2_rolling/src/ros2/rclcpp/rclcpp/test/rclcpp/executors/test_executors.cpp:759: Failure
95: Expected equality of these values:
95:   sub2_msg_count
95:     Which is: 1
95:   1u
95:     Which is: 1

@ahcorde ahcorde changed the base branch from dev/1.0.0 to rolling December 7, 2024 04:13
@Yadunund
Copy link
Member

Yadunund commented Dec 9, 2024

@ahcorde would it be possible to rebase this branch such that it only includes the newly introduced commits?

@ahcorde
Copy link
Contributor Author

ahcorde commented Dec 9, 2024

@ahcorde would it be possible to rebase this branch such that it only includes the newly introduced commits?

@Yadunund It's already done

@ahcorde
Copy link
Contributor Author

ahcorde commented Dec 10, 2024

This last commit from #333 makes test_services__rmw_zenoh_cpp flaky

@clalancette
Copy link
Collaborator

This last commit from #333 makes test_services__rmw_zenoh_cpp flaky

I think we actually need a different fix for that. I'm going to finish reviewing #333 today, and then I'll open a follow-up PR which should fix that particular problem.

Copy link
Member

@Yadunund Yadunund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments to address from this first pass.

zenoh_cpp_vendor/CMakeLists.txt Show resolved Hide resolved
rmw_zenoh_cpp/src/zenohd/main.cpp Show resolved Hide resolved
rmw_zenoh_cpp/src/zenohd/main.cpp Show resolved Hide resolved
rmw_zenoh_cpp/src/detail/attachment_helpers.hpp Outdated Show resolved Hide resolved
rmw_zenoh_cpp/src/detail/attachment_helpers.hpp Outdated Show resolved Hide resolved
rmw_zenoh_cpp/src/detail/rmw_service_data.hpp Show resolved Hide resolved
rmw_zenoh_cpp/src/detail/rmw_context_impl_s.cpp Outdated Show resolved Hide resolved
rmw_zenoh_cpp/src/detail/rmw_context_impl_s.cpp Outdated Show resolved Hide resolved
rmw_zenoh_cpp/src/detail/rmw_client_data.cpp Show resolved Hide resolved
Signed-off-by: Alejandro Hernández Cordero <[email protected]>

Fixed CI

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

tokens

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

removed zenoh_router_check

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

removed rmw_init_options_impl.hpp

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

Publisher

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

Added subscribers

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

Removed zid_to_str

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

use zenoh::KeyExpr

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

service data

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

client data

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

Removed unused signature

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

cleanups and shm

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

make linters happy

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

make linters happy

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

make linters happy

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

make linters happy

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

make linters happy

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

make linters happy

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

more changes

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

Fixed segfault

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

make linters happy

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

make linters happy

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

removed zenohc from CMakeLists.txt and warning

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

Restored one method

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

wrap the zenoh session with a shared pointer

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

Changes missed

Signed-off-by: Yadunund <[email protected]>
@Yadunund Yadunund force-pushed the ahcorde/dev/1.0.0-cpp branch from f8e85b1 to 196f30d Compare December 10, 2024 17:56
rmw_zenoh_cpp/src/detail/rmw_client_data.cpp Outdated Show resolved Hide resolved
rmw_zenoh_cpp/src/detail/rmw_client_data.cpp Outdated Show resolved Hide resolved
rmw_zenoh_cpp/src/detail/rmw_client_data.cpp Outdated Show resolved Hide resolved
rmw_zenoh_cpp/src/detail/rmw_client_data.cpp Outdated Show resolved Hide resolved
rmw_zenoh_cpp/src/detail/rmw_node_data.cpp Show resolved Hide resolved
rmw_zenoh_cpp/src/detail/rmw_service_data.cpp Outdated Show resolved Hide resolved
rmw_zenoh_cpp/src/detail/rmw_service_data.cpp Outdated Show resolved Hide resolved
rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp Outdated Show resolved Hide resolved
@ahcorde
Copy link
Contributor Author

ahcorde commented Dec 11, 2024

Pacakge Test Reason
rcl None
rcl_action None
rcl_lifecycle None
rcl_yaml None
rcl_yaml_param_parser None
rclcpp test_executors
rclcpp_components None
rclcpp_action None
rclcpp_lifecycle None
rclcpp_components None
test_rclcpp test_n_nodes__rmw_zenoh_cpp
test_quality_of_service test_deadline__rmw_zenoh_cpp
test_quality_of_service test_liveliness__rmw_zenoh_cpp
test_quality_of_service test_best_available__rmw_zenoh_cpp

test_rclcpp

104: [INFO] [node_with_name_9-10]: sending signal 'SIGINT' to process[node_with_name_9-10]
104: [INFO] [node_with_name_8-9]: sending signal 'SIGINT' to process[node_with_name_8-9]
104: [INFO] [node_with_name_7-8]: sending signal 'SIGINT' to process[node_with_name_7-8]
104: [INFO] [node_with_name_6-7]: sending signal 'SIGINT' to process[node_with_name_6-7]
104: [INFO] [node_with_name_5-6]: sending signal 'SIGINT' to process[node_with_name_5-6]
104: [INFO] [node_with_name_4-5]: sending signal 'SIGINT' to process[node_with_name_4-5]
104: [ERROR] [node_with_name_9-10]: process has died [pid 1107646, exit code -2, cmd '/home/ahcorde/ros2_rolling/build/test_rclcpp/node_with_name'].
104: [INFO] [node_with_name_3-4]: sending signal 'SIGINT' to process[node_with_name_3-4]
104: [ERROR] [node_with_name_7-8]: process has died [pid 1107529, exit code -2, cmd '/home/ahcorde/ros2_rolling/build/test_rclcpp/node_with_name'].
104: [ERROR] [node_with_name_8-9]: process has died [pid 1107531, exit code -2, cmd '/home/ahcorde/ros2_rolling/build/test_rclcpp/node_with_name'].
104: [INFO] [node_with_name_2-3]: sending signal 'SIGINT' to process[node_with_name_2-3]
104: [INFO] [node_with_name_1-2]: sending signal 'SIGINT' to process[node_with_name_1-2]
104: [ERROR] [node_with_name_4-5]: process has died [pid 1107523, exit code -2, cmd '/home/ahcorde/ros2_rolling/build/test_rclcpp/node_with_name'].
104: [INFO] [node_with_name_0-1]: sending signal 'SIGINT' to process[node_with_name_0-1]
104: [node_with_name_6-7] [INFO] [1733918455.912256023] [rclcpp]: signal_handler(signum=2)
104: [node_with_name_5-6] [INFO] [1733918455.912922935] [rclcpp]: signal_handler(signum=2)
104: [node_with_name_3-4] [INFO] [1733918455.916087796] [rclcpp]: signal_handler(signum=2)
104: [node_with_name_2-3] [INFO] [1733918455.917436101] [rclcpp]: signal_handler(signum=2)
104: [node_with_name_1-2] [INFO] [1733918455.918144495] [rclcpp]: signal_handler(signum=2)
104: [ERROR] [node_with_name_0-1]: process has died [pid 1107515, exit code -2, cmd '/home/ahcorde/ros2_rolling/build/test_rclcpp/node_with_name'].
104: [INFO] [node_with_name_5-6]: process has finished cleanly [pid 1107525]
104: [INFO] [node_with_name_2-3]: process has finished cleanly [pid 1107519]
104: [INFO] [node_with_name_3-4]: process has finished cleanly [pid 1107521]
104: [INFO] [node_with_name_6-7]: process has finished cleanly [pid 1107527]
104: [INFO] [node_with_name_1-2]: process has finished cleanly [pid 1107517]
104: test_10_nodes (test_rclcpp.TestNNodesAfterShutdown) ... FAIL

@ahcorde
Copy link
Contributor Author

ahcorde commented Dec 11, 2024

Fixed test_quality_of_service tests ros2/system_tests#555

@YuanYuYuan
Copy link
Contributor

YuanYuYuan commented Dec 11, 2024

test_executors

This matches what we have observed so far. I'm still investigating the flaky test_executors.
Note that if you encounter a failure on test_executors and you don't restart the zenohd, it could affect the other tests. That's one of the possible flakiness.

The test_n_nodes__rmw_zenoh_cpp has been identified #329.

@YuanYuYuan
Copy link
Contributor

YuanYuYuan commented Dec 11, 2024

@ahcorde I made a suggested change here.

diff --git a/rmw_zenoh_cpp/src/detail/rmw_client_data.cpp b/rmw_zenoh_cpp/src/detail/rmw_client_data.cpp
index bae0fe9..3cad22c 100644
--- a/rmw_zenoh_cpp/src/detail/rmw_client_data.cpp
+++ b/rmw_zenoh_cpp/src/detail/rmw_client_data.cpp
@@ -233,14 +233,13 @@ void ClientData::add_new_reply(std::unique_ptr<ZenohReply> reply)
     reply_queue_.size() >= adapted_qos_profile.depth)
   {
     // Log warning if message is discarded due to hitting the queue depth
-    std::string keystr = std::string(keyexpr_.value().as_string_view());
     RMW_ZENOH_LOG_ERROR_NAMED(
       "rmw_zenoh_cpp",
       "Query queue depth of %ld reached, discarding oldest Query "
-      "for client for %.*s",
+      "for client for %s",
       adapted_qos_profile.depth,
-      keystr.size(),
-      keystr.c_str());
+      keyexpr_.value().as_string_view());
     reply_queue_.pop_front();
   }
   reply_queue_.emplace_back(std::move(reply));
@@ -407,10 +406,11 @@ rmw_ret_t ClientData::send_request(
     parameters,
     [client_data](const zenoh::Reply & reply) {
       if (!reply.is_ok()) {
+        auto reply_err_str = reply.get_err().get_payload().as_string();
         RMW_ZENOH_LOG_ERROR_NAMED(
           "rmw_zenoh_cpp",
           "z_reply_is_ok returned False Reason: %s",
-          reply.get_err().get_payload().as_string())
+          reply_err_str.c_str())
         return;
       }
       const zenoh::Sample & sample = reply.get_ok();
@@ -420,7 +420,7 @@ rmw_ret_t ClientData::send_request(
         RMW_ZENOH_LOG_ERROR_NAMED(
           "rmw_zenoh_cpp",
           "Unable to obtain ClientData from data for %s.",
-          std::string(sample.get_keyexpr().as_string_view()));
+          sample.get_keyexpr().as_string_view());
         return;
       }
 
diff --git a/rmw_zenoh_cpp/src/detail/rmw_service_data.cpp b/rmw_zenoh_cpp/src/detail/rmw_service_data.cpp
index 5696e81..d24c965 100644
--- a/rmw_zenoh_cpp/src/detail/rmw_service_data.cpp
+++ b/rmw_zenoh_cpp/src/detail/rmw_service_data.cpp
@@ -156,7 +156,7 @@ std::shared_ptr<ServiceData> ServiceData::make(
         RMW_ZENOH_LOG_ERROR_NAMED(
           "rmw_zenoh_cpp",
           "Unable to obtain ServiceData from data for %s.",
-          std::string(query.get_keyexpr().as_string_view()));
+          query.get_keyexpr().as_string_view());
         return;
       }
 
diff --git a/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp b/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp
index 45ef1bf..a6d0114 100644
--- a/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp
+++ b/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp
@@ -212,7 +212,7 @@ bool SubscriptionData::init()
           RMW_ZENOH_LOG_ERROR_NAMED(
             "rmw_zenoh_cpp",
             "Unable to obtain SubscriptionData from data for %s.",
-            std::string(sample.get_keyexpr().as_string_view()));
+            sample.get_keyexpr().as_string_view());
           return;
         }
 
diff --git a/rmw_zenoh_cpp/src/detail/zenoh_utils.cpp b/rmw_zenoh_cpp/src/detail/zenoh_utils.cpp
index 795c4dc..3e0f6a4 100644
--- a/rmw_zenoh_cpp/src/detail/zenoh_utils.cpp
+++ b/rmw_zenoh_cpp/src/detail/zenoh_utils.cpp
@@ -49,7 +49,7 @@ zenoh::Bytes create_map_and_set_sequence_num(
   int64_t source_timestamp = now_ns.count();
 
   rmw_zenoh_cpp::AttachmentData data(sequence_number, source_timestamp, gid);
-  return std::move(data.serialize_to_zbytes());
+  return data.serialize_to_zbytes();
 }
 
 ///=============================================================================

Signed-off-by: Alejandro Hernández Cordero <[email protected]>
@ahcorde
Copy link
Contributor Author

ahcorde commented Dec 11, 2024

Thank you @YuanYuYuan, included here 6877a48

Copy link
Collaborator

@clalancette clalancette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left quite a few changes inline here, but this is looking pretty good.

rmw_zenoh_cpp/src/detail/attachment_helpers.cpp Outdated Show resolved Hide resolved
rmw_zenoh_cpp/src/detail/liveliness_utils.cpp Outdated Show resolved Hide resolved
rmw_zenoh_cpp/src/detail/rmw_client_data.hpp Outdated Show resolved Hide resolved
rmw_zenoh_cpp/src/detail/rmw_client_data.cpp Show resolved Hide resolved
rmw_zenoh_cpp/src/detail/zenoh_utils.hpp Show resolved Hide resolved
@@ -2451,7 +2451,7 @@ rmw_get_gid_for_publisher(const rmw_publisher_t * publisher, rmw_gid_t * gid)
RMW_CHECK_ARGUMENT_FOR_NULL(pub_data, RMW_RET_INVALID_ARGUMENT);

gid->implementation_identifier = rmw_zenoh_cpp::rmw_zenoh_identifier;
pub_data->copy_gid(gid->data);
memcpy(gid->data, pub_data->copy_gid().data(), RMW_GID_STORAGE_SIZE);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change is OK, because copy_gid is now returning a copy.

rmw_zenoh_cpp/src/rmw_zenoh.cpp Show resolved Hide resolved
zenoh_cpp_vendor/CMakeLists.txt Show resolved Hide resolved
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
@ahcorde ahcorde force-pushed the ahcorde/dev/1.0.0-cpp branch from 0999f2d to 6128468 Compare December 12, 2024 16:58
@ahcorde
Copy link
Contributor Author

ahcorde commented Dec 12, 2024

@YuanYuYuan related to the string_view

I need to use in rmw_zenoh_cpp/src/detail/rmw_client_data.cpp:239

      std::string(keyexpr_.value().as_string_view()).c_str());

Otherwise I got a segfault in rclcpp/test_client_common. Any idea why ?

Copy link
Collaborator

@clalancette clalancette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All right, I did another pass on this. This is looking pretty close to me, with a few more relatively minor things to fix. The only remaining major issue is to see if we can reduce the latency with this vs. the rolling branch.

rmw_zenoh_cpp/src/detail/liveliness_utils.cpp Outdated Show resolved Hide resolved
rmw_zenoh_cpp/src/detail/rmw_client_data.cpp Show resolved Hide resolved
rmw_zenoh_cpp/src/detail/rmw_client_data.hpp Outdated Show resolved Hide resolved
RMW_SET_ERROR_MSG("Failed to get source_timestamp from client call attachment");
// Object that manages the raw buffer
auto payload = sample.get_payload().as_vector();
if (payload.size() > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can save an indentation level here by doing:

if (payload.size() == 0) {
    RMW_ZENOH_LOG_DEBUG_NAMED(
      "rmw_zenoh_cpp",
      "ClientData not able to get slice data");
    return RMW_RET_ERROR;
}

(and then unindenting the rest of the code)

rmw_zenoh_cpp/src/detail/zenoh_utils.hpp Show resolved Hide resolved
rmw_zenoh_cpp/src/detail/zenoh_utils.hpp Show resolved Hide resolved
@@ -2451,7 +2451,7 @@ rmw_get_gid_for_publisher(const rmw_publisher_t * publisher, rmw_gid_t * gid)
RMW_CHECK_ARGUMENT_FOR_NULL(pub_data, RMW_RET_INVALID_ARGUMENT);

gid->implementation_identifier = rmw_zenoh_cpp::rmw_zenoh_identifier;
pub_data->copy_gid(gid->data);
memcpy(gid->data, pub_data->copy_gid().data(), RMW_GID_STORAGE_SIZE);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's a good point.

I'm actually not in favor of having both overloads for copy_gid; I think that is just confusing. I'll add a comment in the rmw_publisher_data.cpp class.

rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp Outdated Show resolved Hide resolved
zenoh_cpp_vendor/CMakeLists.txt Show resolved Hide resolved
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
@YuanYuYuan
Copy link
Contributor

test_client_common

I see. I observed similar issues before. Maybe the macro doesn't work well with the lifetime of the keyexpr. In this case, we need to store the string additionally.

Fix the high latency on the subscriber due to zenoh bytes conversion
@ahcorde ahcorde requested a review from clalancette December 16, 2024 10:58
@ahcorde
Copy link
Contributor Author

ahcorde commented Dec 16, 2024

When compiling on Windows I'm getting this error just include the zenoh.hxx header

Windows compile error C:\ros2_ws\install\opt\zenoh_cpp_vendor\include\zenoh\api\shm\protocol_implementations\posix\../../provider/shm_provider.hxx(36,1): error C2236: token inesperado 'struct'. Compruebe si olvid� un ';' [C:\ros2_ws\build\rmw_zenoh_cpp\rmw_zenohd.vcxproj] C:\ros2_ws\install\opt\zenoh_cpp_vendor\include\zenoh\api\shm\protocol_implementations\posix\../../provider/shm_provider.hxx(36,1): error C2332: 'struct': falta el nombre de etiqueta [C:\ros2_ws\build\rmw_zenoh_cpp\rmw_zenohd.vcxproj] C:\ros2_ws\install\opt\zenoh_cpp_vendor\include\zenoh\api\shm\protocol_implementations\posix\../../provider/shm_provider.hxx(36,24): error C2513: '': no hay ninguna variable declarada antes de '=' [C:\ros2_ws\build\rmw_zenoh_cpp\rmw_zenohd.vcxproj] C:\ros2_ws\install\opt\zenoh_cpp_vendor\include\zenoh\api\shm\protocol_implementations\posix\../../provider/shm_provider.hxx(37,1): error C2332: 'struct': falta el nombre de etiqueta [C:\ros2_ws\build\rmw_zenoh_cpp\rmw_zenohd.vcxproj] C:\ros2_ws\install\opt\zenoh_cpp_vendor\include\zenoh\api\shm\protocol_implementations\posix\../../provider/shm_provider.hxx(37,25): error C2226: error de sintaxis: tipo 'zenoh::ShmProviderAsyncInterface::drop::' inesperado [C:\ros2_ws\build\rmw_zenoh_cpp\rmw_zenohd.vcxproj] C:\ros2_ws\install\opt\zenoh_cpp_vendor\include\zenoh\api\shm\protocol_implementations\posix\../../provider/shm_provider.hxx(41,1): error C2236: token inesperado 'struct'. Compruebe si olvid� un ';' [C:\ros2_ws\build\rmw_zenoh_cpp\rmw_zenohd.vcxproj] C:\ros2_ws\install\opt\zenoh_cpp_vendor\include\zenoh\api\shm\protocol_implementations\posix\../../provider/shm_provider.hxx(41,1): error C2332: 'struct': falta el nombre de etiqueta [C:\ros2_ws\build\rmw_zenoh_cpp\rmw_zenohd.vcxproj] C:\ros2_ws\install\opt\zenoh_cpp_vendor\include\zenoh\api\shm\protocol_implementations\posix\../../provider/shm_provider.hxx(41,24): error C2513: '': no hay ninguna variable declarada antes de '=' [C:\ros2_ws\build\rmw_zenoh_cpp\rmw_zenohd.vcxproj] C:\ros2_ws\install\opt\zenoh_cpp_vendor\include\zenoh\api\shm\protocol_implementations\posix\../../provider/shm_provider.hxx(42,1): error C2332: 'struct': falta el nombre de etiqueta [C:\ros2_ws\build\rmw_zenoh_cpp\rmw_zenohd.vcxproj] C:\ros2_ws\install\opt\zenoh_cpp_vendor\include\zenoh\api\shm\protocol_implementations\posix\../../provider/shm_provider.hxx(42,18): error C2059: error de sintaxis: '->' [C:\ros2_ws\build\rmw_zenoh_cpp\rmw_zenohd.vcxproj] C:\ros2_ws\install\opt\zenoh_cpp_vendor\include\zenoh\api\shm\provider\alloc_layout.hxx(38,10): error C2236: token inesperado 'struct'. Compruebe si olvid� un ';' [C:\ros2_ws\build\rmw_zenoh_cpp\rmw_zenohd.vcxproj] C:\ros2_ws\install\opt\zenoh_cpp_vendor\include\zenoh\api\shm\provider\alloc_layout.hxx(38,20): error C2332: 'struct': falta el nombre de etiqueta [C:\ros2_ws\build\rmw_zenoh_cpp\rmw_zenohd.vcxproj] C:\ros2_ws\install\opt\zenoh_cpp_vendor\include\zenoh\api\shm\provider\alloc_layout.hxx(38,20): error C2513: '': no hay ninguna variable declarada antes de '=' [C:\ros2_ws\build\rmw_zenoh_cpp\rmw_zenohd.vcxproj] C:\ros2_ws\install\opt\zenoh_cpp_vendor\include\zenoh\api\shm\provider\alloc_layout.hxx(39,14): error C2332: 'struct': falta el nombre de etiqueta [C:\ros2_ws\build\rmw_zenoh_cpp\rmw_zenohd.vcxproj] C:\ros2_ws\install\opt\zenoh_cpp_vendor\include\zenoh\api\shm\provider\alloc_layout.hxx(39,14): error C2059: error de sintaxis: '->' [C:\ros2_ws\build\rmw_zenoh_cpp\rmw_zenohd.vcxproj] C:\ros2_ws\install\opt\zenoh_cpp_vendor\include\zenoh\api\shm\provider\alloc_layout.hxx(43,10): error C2236: token inesperado 'struct'. Compruebe si olvid� un ';' [C:\ros2_ws\build\rmw_zenoh_cpp\rmw_zenohd.vcxproj] C:\ros2_ws\install\opt\zenoh_cpp_vendor\include\zenoh\api\shm\provider\alloc_layout.hxx(43,20): error C2332: 'struct': falta el nombre de etiqueta [C:\ros2_ws\build\rmw_zenoh_cpp\rmw_zenohd.vcxproj] C:\ros2_ws\install\opt\zenoh_cpp_vendor\include\zenoh\api\shm\provider\alloc_layout.hxx(43,20): error C2513: '': no hay ninguna variable declarada antes de '=' [C:\ros2_ws\build\rmw_zenoh_cpp\rmw_zenohd.vcxproj] C:\ros2_ws\install\opt\zenoh_cpp_vendor\include\zenoh\api\shm\provider\alloc_layout.hxx(44,21): error C2332: 'struct': falta el nombre de etiqueta [C:\ros2_ws\build\rmw_zenoh_cpp\rmw_zenohd.vcxproj] C:\ros2_ws\install\opt\zenoh_cpp_vendor\include\zenoh\api\shm\provider\alloc_layout.hxx(44,21): error C2226: error de sintaxis: tipo 'zenoh::shm::provider::closures::_z_alloc_layout_async_interface_drop_fn::' inesperado [C:\ros2_ws\build\rmw_zenoh_cpp\rmw_zenohd.vcxproj] Failed <<< rmw_zenoh_cpp [4.02s, exited with code 1]

Signed-off-by: Alejandro Hernandez Cordero <[email protected]>
@ahcorde
Copy link
Contributor Author

ahcorde commented Dec 17, 2024

@clalancette windows issue fixed here ec42c81

They are a fixed size, so should use the fixed-size data
structure.

Signed-off-by: Chris Lalancette <[email protected]>
Since we aren't calling shared_from_this() in it anymore,
we can do all of the work in the constructor.

Signed-off-by: Chris Lalancette <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
This simplifies the code, and makes it less noisy.

Signed-off-by: Chris Lalancette <[email protected]>
Copy link
Collaborator

@clalancette clalancette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now looks good to me, so I'm going to go ahead and merge it. Thanks for all of the hard work here @ahcorde

@clalancette clalancette merged commit 271da8d into rolling Dec 17, 2024
6 checks passed
@clalancette clalancette deleted the ahcorde/dev/1.0.0-cpp branch December 17, 2024 21:36
@ahcorde ahcorde mentioned this pull request Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants