mirror of
https://github.com/micro-ROS/micro-ROS-Agent.git
synced 2026-09-06 18:05:17 +02:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c248aea28 | ||
|
|
4a750220d2 | ||
|
|
b5a0d0b6ee | ||
|
|
114a043ee2 | ||
|
|
b0ebf5ab3f | ||
|
|
d91c98ab6e |
+28
-29
@@ -3,36 +3,35 @@ name: CI micro-ROS Agent
|
|||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- '**'
|
- 'humble'
|
||||||
|
schedule:
|
||||||
|
- cron: '33 6 * * *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
microros_agent_ci:
|
microros_agent_ci:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
container: microros/base:rolling
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
steps:
|
matrix:
|
||||||
- uses: actions/checkout@v2
|
os: [ ubuntu-20.04 ]
|
||||||
with:
|
ros_distribution: [ humble ]
|
||||||
path: urosagent
|
include:
|
||||||
|
- docker_image: ubuntu:jammy
|
||||||
- name: Download dependencies
|
ros_distribution: humble
|
||||||
run: |
|
container:
|
||||||
apt update
|
image: ubuntu:jammy
|
||||||
cd /uros_ws
|
steps:
|
||||||
. /opt/ros/$ROS_DISTRO/setup.sh
|
- uses: actions/checkout@v2
|
||||||
. install/local_setup.sh
|
- uses: ros-tooling/setup-ros@0.3.2
|
||||||
rosdep update --rosdistro=$ROS_DISTRO
|
with:
|
||||||
ros2 run micro_ros_setup create_agent_ws.sh
|
use-ros2-testing: false
|
||||||
|
required-ros-distributions: ${{ matrix.ros_distribution }}
|
||||||
- name: Patch branch
|
- name : Download and install dependencies
|
||||||
run: |
|
run: |
|
||||||
rm -rf /uros_ws/src/uros/micro-ROS-Agent/*
|
apt-get install ros-${{ matrix.ros_distribution }}-micro-ros-msgs
|
||||||
cp -R urosagent/* /uros_ws/src/uros/micro-ROS-Agent/
|
apt-get install ros-${{ matrix.ros_distribution }}-rmw-fastrtps-cpp
|
||||||
|
- uses : ros-tooling/action-ros-ci@0.2.5
|
||||||
- name: Build
|
with:
|
||||||
run: |
|
package-name: "micro_ros_agent"
|
||||||
cd /uros_ws
|
target-ros2-distro: ${{ matrix.ros_distribution }}
|
||||||
. /opt/ros/$ROS_DISTRO/setup.sh
|
|
||||||
. install/local_setup.sh
|
|
||||||
ros2 run micro_ros_setup build_agent.sh
|
|
||||||
|
|||||||
@@ -55,3 +55,4 @@ see the file [3rd-party-licenses.txt](3rd-party-licenses.txt).
|
|||||||
Please notice the following issues/limitations:
|
Please notice the following issues/limitations:
|
||||||
|
|
||||||
* There is an unknown issue when dealing with serial ports shared with the micro-ROS agent running inside a Docker. Sometimes it works with a remarkable packet loss.
|
* There is an unknown issue when dealing with serial ports shared with the micro-ROS agent running inside a Docker. Sometimes it works with a remarkable packet loss.
|
||||||
|
* There is an known issues with serial port communication on micro-ros-agent snap version. It is recommended to use the dockerized version or build it from source.
|
||||||
@@ -2,6 +2,9 @@
|
|||||||
Changelog for package micro-ros_agent
|
Changelog for package micro-ros_agent
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
3.0.2 (2022-05-25)
|
||||||
|
------------------
|
||||||
|
|
||||||
3.0.1 (2022-03-25)
|
3.0.1 (2022-03-25)
|
||||||
------------------
|
------------------
|
||||||
* Add services to graph manager (`#127 <https://github.com/micro-ROS/micro-ROS-Agent/issues/127>`_) (`#129 <https://github.com/micro-ROS/micro-ROS-Agent/issues/129>`_)
|
* Add services to graph manager (`#127 <https://github.com/micro-ROS/micro-ROS-Agent/issues/127>`_) (`#129 <https://github.com/micro-ROS/micro-ROS-Agent/issues/129>`_)
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ private:
|
|||||||
|
|
||||||
eprosima::uxr::AgentInstance& xrce_dds_agent_instance_;
|
eprosima::uxr::AgentInstance& xrce_dds_agent_instance_;
|
||||||
std::map<eprosima::fastdds::dds::DomainId_t, std::shared_ptr<graph_manager::GraphManager>> graph_manager_map_;
|
std::map<eprosima::fastdds::dds::DomainId_t, std::shared_ptr<graph_manager::GraphManager>> graph_manager_map_;
|
||||||
|
std::string namespace_remapping = "";
|
||||||
|
|
||||||
std::shared_ptr<graph_manager::GraphManager> find_or_create_graph_manager(eprosima::fastdds::dds::DomainId_t domain_id);
|
std::shared_ptr<graph_manager::GraphManager> find_or_create_graph_manager(eprosima::fastdds::dds::DomainId_t domain_id);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief Default constructor.
|
* @brief Default constructor.
|
||||||
*/
|
*/
|
||||||
GraphManager(eprosima::fastdds::dds::DomainId_t domain_id);
|
GraphManager(eprosima::fastdds::dds::DomainId_t domain_id, std::string namespace_remapping);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Default destructor.
|
* @brief Default destructor.
|
||||||
@@ -274,6 +274,7 @@ private:
|
|||||||
std::string& node_namespace);
|
std::string& node_namespace);
|
||||||
|
|
||||||
eprosima::fastdds::dds::DomainId_t domain_id_;
|
eprosima::fastdds::dds::DomainId_t domain_id_;
|
||||||
|
std::string namespace_remapping_;
|
||||||
bool graph_changed_;
|
bool graph_changed_;
|
||||||
bool display_on_change_;
|
bool display_on_change_;
|
||||||
std::thread microros_graph_publisher_;
|
std::thread microros_graph_publisher_;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||||
<package format="3">
|
<package format="3">
|
||||||
<name>micro_ros_agent</name>
|
<name>micro_ros_agent</name>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
<description>micro-ROS Agent package</description>
|
<description>micro-ROS Agent package</description>
|
||||||
<maintainer email="pablogarrido@eprosima.com">Pablo Garrido</maintainer>
|
<maintainer email="pablogarrido@eprosima.com">Pablo Garrido</maintainer>
|
||||||
<maintainer email="antoniocuadros@eprosima.com">Antonio Cuadros</maintainer>
|
<maintainer email="antoniocuadros@eprosima.com">Antonio Cuadros</maintainer>
|
||||||
|
|||||||
@@ -33,6 +33,17 @@ bool Agent::create(
|
|||||||
char** argv)
|
char** argv)
|
||||||
{
|
{
|
||||||
bool result = xrce_dds_agent_instance_.create(argc, argv);
|
bool result = xrce_dds_agent_instance_.create(argc, argv);
|
||||||
|
|
||||||
|
// Find namespace remapping
|
||||||
|
for (int i = 0; i < argc; i++)
|
||||||
|
{
|
||||||
|
if (strcmp(argv[i], "--namespace-remapping") == 0 && i + 1 < argc)
|
||||||
|
{
|
||||||
|
namespace_remapping = argv[i + 1];
|
||||||
|
std::cout << "Remapping all entities to namespace " << namespace_remapping << std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -293,8 +304,7 @@ void Agent::run()
|
|||||||
|
|
||||||
std::shared_ptr<graph_manager::GraphManager> Agent::find_or_create_graph_manager(eprosima::fastdds::dds::DomainId_t domain_id)
|
std::shared_ptr<graph_manager::GraphManager> Agent::find_or_create_graph_manager(eprosima::fastdds::dds::DomainId_t domain_id)
|
||||||
{
|
{
|
||||||
|
auto it = graph_manager_map_.find(domain_id);
|
||||||
auto it = graph_manager_map_.find(domain_id);
|
|
||||||
|
|
||||||
if (it != graph_manager_map_.end()) {
|
if (it != graph_manager_map_.end()) {
|
||||||
return it->second;
|
return it->second;
|
||||||
@@ -302,7 +312,7 @@ auto it = graph_manager_map_.find(domain_id);
|
|||||||
return graph_manager_map_.insert(
|
return graph_manager_map_.insert(
|
||||||
std::make_pair(
|
std::make_pair(
|
||||||
domain_id,
|
domain_id,
|
||||||
std::make_shared<graph_manager::GraphManager>(domain_id)
|
std::make_shared<graph_manager::GraphManager>(domain_id, namespace_remapping)
|
||||||
)
|
)
|
||||||
).first->second;
|
).first->second;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,8 +26,9 @@ namespace uros {
|
|||||||
namespace agent {
|
namespace agent {
|
||||||
namespace graph_manager {
|
namespace graph_manager {
|
||||||
|
|
||||||
GraphManager::GraphManager(eprosima::fastdds::dds::DomainId_t domain_id)
|
GraphManager::GraphManager(eprosima::fastdds::dds::DomainId_t domain_id, std::string namespace_remapping)
|
||||||
: domain_id_(domain_id)
|
: domain_id_(domain_id)
|
||||||
|
, namespace_remapping_(namespace_remapping)
|
||||||
, graph_changed_(false)
|
, graph_changed_(false)
|
||||||
, display_on_change_(false)
|
, display_on_change_(false)
|
||||||
, mtx_()
|
, mtx_()
|
||||||
@@ -313,6 +314,8 @@ void GraphManager::add_participant(
|
|||||||
std::string isolated_node_name, isolated_namespace;
|
std::string isolated_node_name, isolated_namespace;
|
||||||
get_name_and_namespace(qos.name().to_string(), isolated_node_name, isolated_namespace);
|
get_name_and_namespace(qos.name().to_string(), isolated_node_name, isolated_namespace);
|
||||||
|
|
||||||
|
isolated_namespace = namespace_remapping_ + isolated_namespace;
|
||||||
|
|
||||||
rmw_dds_common::msg::ParticipantEntitiesInfo info =
|
rmw_dds_common::msg::ParticipantEntitiesInfo info =
|
||||||
graphCache_.add_node(gid, isolated_node_name, isolated_namespace);
|
graphCache_.add_node(gid, isolated_node_name, isolated_namespace);
|
||||||
|
|
||||||
@@ -355,7 +358,10 @@ void GraphManager::add_datawriter(
|
|||||||
{
|
{
|
||||||
const std::string& topic_name = datawriter->get_topic()->get_name();
|
const std::string& topic_name = datawriter->get_topic()->get_name();
|
||||||
const std::string& type_name = datawriter->get_topic()->get_type_name();
|
const std::string& type_name = datawriter->get_topic()->get_type_name();
|
||||||
this->add_datawriter(datawriter_guid, topic_name, type_name,
|
|
||||||
|
auto remapped_topic_name = namespace_remapping_ + "/" + topic_name;
|
||||||
|
|
||||||
|
this->add_datawriter(datawriter_guid, remapped_topic_name, type_name,
|
||||||
participant->guid(), datawriter->get_qos());
|
participant->guid(), datawriter->get_qos());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -372,7 +378,9 @@ void GraphManager::add_datawriter(
|
|||||||
"rmw_fastrtps_cpp", participant_guid);
|
"rmw_fastrtps_cpp", participant_guid);
|
||||||
const rmw_qos_profile_t qos_profile = fastdds_qos_to_rmw_qos(writer_qos);
|
const rmw_qos_profile_t qos_profile = fastdds_qos_to_rmw_qos(writer_qos);
|
||||||
|
|
||||||
graphCache_.add_entity(datawriter_gid, topic_name,
|
auto remapped_topic_name = namespace_remapping_ + "/" + topic_name;
|
||||||
|
|
||||||
|
graphCache_.add_entity(datawriter_gid, remapped_topic_name,
|
||||||
type_name, participant_gid, qos_profile, false);
|
type_name, participant_gid, qos_profile, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -441,6 +449,7 @@ void GraphManager::associate_entity(
|
|||||||
{
|
{
|
||||||
std::string isolated_node_name, isolated_namespace;
|
std::string isolated_node_name, isolated_namespace;
|
||||||
get_name_and_namespace(qos.name().c_str(), isolated_node_name, isolated_namespace);
|
get_name_and_namespace(qos.name().c_str(), isolated_node_name, isolated_namespace);
|
||||||
|
isolated_namespace = namespace_remapping_ + isolated_namespace;
|
||||||
info = graphCache_.associate_writer(
|
info = graphCache_.associate_writer(
|
||||||
entity_gid, participant_gid, isolated_node_name, isolated_namespace);
|
entity_gid, participant_gid, isolated_node_name, isolated_namespace);
|
||||||
break;
|
break;
|
||||||
@@ -449,6 +458,7 @@ void GraphManager::associate_entity(
|
|||||||
{
|
{
|
||||||
std::string isolated_node_name, isolated_namespace;
|
std::string isolated_node_name, isolated_namespace;
|
||||||
get_name_and_namespace(qos.name().c_str(), isolated_node_name, isolated_namespace);
|
get_name_and_namespace(qos.name().c_str(), isolated_node_name, isolated_namespace);
|
||||||
|
isolated_namespace = namespace_remapping_ + isolated_namespace;
|
||||||
info = graphCache_.associate_reader(
|
info = graphCache_.associate_reader(
|
||||||
entity_gid, participant_gid, isolated_node_name, isolated_namespace);
|
entity_gid, participant_gid, isolated_node_name, isolated_namespace);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user