Skip to content

Commit 23bcea8

Browse files
jamoralppablogs9
andauthored
Feature/graph manager (#38)
* Initial changes * Working state * Working state * Working state * Working state * Working state * Working state * Added graph listener * Updates * Testing name demangling * Graph manager: reworked * Remove debug trace * Treat errors when freeing rcutils resources * Improve logics for discovering entities * Working state: Micro-ROS graph manager * Fix micro_ros_graph_info typesupport type name * Remove double CMakeLists comment * Remove package.xml commented block * Add missing include * Added CI * Remove GUID_t param from callbacks signature * Add services names and types to micro-ROS graph topic * Differenciate between service server and clients * remove debug traces Co-authored-by: Pablo Garrido <pablogs9@gmail.com>
1 parent dce3c25 commit 23bcea8

File tree

18 files changed

+2090
-15
lines changed

18 files changed

+2090
-15
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behaviour:
15+
1. Clone repo '...'
16+
2. Add these lines '...'
17+
3. Run the script '....'
18+
4. See error
19+
Code or shell commands ready to be copy-pasted are welcome.
20+
21+
**Expected behaviour**
22+
A clear and concise description of what you expected to happen.
23+
24+
**System information (please complete the following information):**
25+
- OS: [e.g. WIndows 10, Ubuntu 16.04, ...]
26+
- ROS 2 [e.g. Dashing, Foxy, ...]
27+
- Version [e.g. commit hash, tag, ...]
28+
29+
**Additional context**
30+
Add any other context about the problem here.

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CI micro-ROS Agent
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '**'
7+
8+
jobs:
9+
10+
microros_agent_ci:
11+
runs-on: ubuntu-20.04
12+
container: ros:foxy
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
path: src/micro_ros_agent
18+
19+
- name: Download dependencies
20+
run: |
21+
git clone -b foxy https://github.com/eProsima/Micro-XRCE-DDS-Agent src/microxrcedds_agent
22+
23+
- name: Build
24+
run: |
25+
. /opt/ros/foxy/setup.sh
26+
colcon build

micro_ros_agent/CMakeLists.txt

Lines changed: 60 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,74 @@ project(micro_ros_agent LANGUAGES CXX)
2323

2424
find_package(ament_cmake REQUIRED)
2525
find_package(microxrcedds_agent REQUIRED)
26+
find_package(rosidl_cmake REQUIRED)
27+
find_package(fastcdr REQUIRED)
28+
find_package(fastrtps REQUIRED)
29+
find_package(fastrtps_cmake_module REQUIRED)
30+
find_package(rmw_dds_common REQUIRED)
31+
find_package(rmw REQUIRED)
32+
find_package(rcutils REQUIRED)
33+
find_package(rmw_fastrtps_shared_cpp REQUIRED)
34+
35+
find_package(ament_lint_auto REQUIRED)
36+
37+
find_package(rosidl_typesupport_fastrtps_cpp REQUIRED)
38+
find_package(rosidl_runtime_cpp REQUIRED)
39+
find_package(rosidl_typesupport_cpp REQUIRED)
40+
find_package(ament_cmake_gtest REQUIRED)
41+
42+
find_package(micro_ros_msgs REQUIRED)
43+
44+
add_executable(${PROJECT_NAME}
45+
src/main.cpp
46+
src/agent/Agent.cpp
47+
src/agent/graph_manager/graph_manager.cpp
48+
src/agent/graph_manager/graph_typesupport.cpp
49+
src/agent/utils/demangle.cpp
50+
)
2651

27-
add_executable(${PROJECT_NAME} src/main.cpp)
52+
target_include_directories(${PROJECT_NAME}
53+
PRIVATE
54+
include
55+
)
56+
57+
ament_target_dependencies(${PROJECT_NAME}
58+
rosidl_typesupport_fastrtps_cpp
59+
rosidl_runtime_cpp
60+
rosidl_typesupport_cpp
61+
fastcdr
62+
fastrtps
63+
rmw_dds_common
64+
rmw
65+
rmw_fastrtps_shared_cpp
66+
micro_ros_msgs
67+
)
2868

2969
target_link_libraries(${PROJECT_NAME}
70+
microxrcedds_agent
71+
fastcdr
72+
fastrtps
73+
$<$<BOOL:$<PLATFORM_ID:Linux>>:rt>
74+
$<$<BOOL:$<PLATFORM_ID:Linux>>:dl>
75+
)
76+
77+
target_compile_options(${PROJECT_NAME}
3078
PRIVATE
31-
microxrcedds_agent
32-
$<$<BOOL:$<PLATFORM_ID:Linux>>:rt>
33-
$<$<BOOL:$<PLATFORM_ID:Linux>>:dl>
79+
$<$<C_COMPILER_ID:GNU>:-Wall>
80+
$<$<C_COMPILER_ID:GNU>:-Wextra>
81+
$<$<C_COMPILER_ID:GNU>:-pedantic>
82+
)
83+
84+
set_target_properties(${PROJECT_NAME} PROPERTIES
85+
CXX_STANDARD
86+
14
87+
CXX_STANDARD_REQUIRED
88+
YES
3489
)
3590

3691
set_target_properties(${PROJECT_NAME} PROPERTIES
3792
CXX_STANDARD
38-
11
93+
14
3994
CXX_STANDARD_REQUIRED
4095
YES
4196
)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Copyright 2020 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef _UROS_AGENT_AGENT_HPP
16+
#define _UROS_AGENT_AGENT_HPP
17+
18+
#include <uxr/agent/AgentInstance.hpp>
19+
#include <uxr/agent/middleware/Middleware.hpp>
20+
#include <uxr/agent/middleware/utils/Callbacks.hpp>
21+
22+
#include <agent/graph_manager/graph_manager.hpp>
23+
// TODO(jamoralp): class Documentation
24+
namespace uros {
25+
namespace agent {
26+
27+
class Agent
28+
{
29+
public:
30+
31+
Agent();
32+
33+
~Agent() = default;
34+
35+
bool create(
36+
int argc,
37+
char** argv);
38+
39+
void run();
40+
41+
private:
42+
43+
eprosima::uxr::AgentInstance& xrce_dds_agent_instance_;
44+
std::unique_ptr<graph_manager::GraphManager> graph_manager_;
45+
};
46+
47+
} // namespace agent
48+
} // namespace uros
49+
#endif // _UROS_AGENT_AGENT_HPP

0 commit comments

Comments
 (0)