Skip to content

Commit

Permalink
Set callbacks
Browse files Browse the repository at this point in the history
Signed-off-by: Yadunund <[email protected]>
  • Loading branch information
Yadunund committed Jan 30, 2024
1 parent 2ad493d commit 7ea6a70
Show file tree
Hide file tree
Showing 8 changed files with 404 additions and 61 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: style
- name: uncrustify
run: /ros_entrypoint.sh ament_uncrustify rmw_zenoh_cpp/
- name: cpplint
run: /ros_entrypoint.sh ament_cpplint rmw_zenoh_cpp/
52 changes: 52 additions & 0 deletions rmw_zenoh_cpp/src/detail/event.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright 2024 Open Source Robotics Foundation, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef DETAIL__EVENT_HPP_
#define DETAIL__EVENT_HPP_

#include <unordered_map>

#include "rmw/event.h"

///=============================================================================
// RMW Event types that we support in rmw_zenoh.
enum rmw_zenoh_event_type_t
{
// sentinel value
ZENOH_EVENT_INVALID,

// subscription events
ZENOH_EVENT_REQUESTED_QOS_INCOMPATIBLE,
// RMW_EVENT_MESSAGE_LOST,
// RMW_EVENT_SUBSCRIPTION_INCOMPATIBLE_TYPE,
// RMW_EVENT_SUBSCRIPTION_MATCHED,

// publisher events
// RMW_EVENT_LIVELINESS_LOST,
// RMW_EVENT_OFFERED_DEADLINE_MISSED,
ZENOH_EVENT_OFFERED_QOS_INCOMPATIBLE
// RMW_EVENT_PUBLISHER_INCOMPATIBLE_TYPE,
// RMW_EVENT_PUBLICATION_MATCHED,
};

/// Helper value to indicate the maximum index of events supported.
#define ZENOH_EVENT_ID_MAX rmw_zenoh_event_type_t::ZENOH_EVENT_OFFERED_QOS_INCOMPATIBLE

static const std::unordered_map<rmw_event_type_t, rmw_zenoh_event_type_t> event_map{
{RMW_EVENT_REQUESTED_QOS_INCOMPATIBLE, ZENOH_EVENT_REQUESTED_QOS_INCOMPATIBLE},
{RMW_EVENT_OFFERED_QOS_INCOMPATIBLE, ZENOH_EVENT_OFFERED_QOS_INCOMPATIBLE},
// TODO(clalancette): Implement remaining events
};

#endif // DETAIL__EVENT_HPP_
1 change: 1 addition & 0 deletions rmw_zenoh_cpp/src/detail/graph_cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <unordered_set>
#include <vector>

#include "event.hpp"
#include "liveliness_utils.hpp"

#include "rcutils/allocator.h"
Expand Down
Loading

0 comments on commit 7ea6a70

Please sign in to comment.