mirror of
https://github.com/micro-ROS/micro-ROS-Agent.git
synced 2026-09-06 18:05:17 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0d3e01909 | ||
|
|
e2d5e6699e | ||
|
|
5c23d99726 | ||
|
|
2857b2e620 | ||
|
|
cb0e5e4ec9 | ||
|
|
096d54a5e9 | ||
|
|
70f9cf7ddb | ||
|
|
ccc177d276 | ||
|
|
648081f77f | ||
|
|
b317a906dc | ||
|
|
200f750a76 | ||
|
|
4dd8ffe63b | ||
|
|
375bf3e674 | ||
|
|
1325442eb5 | ||
|
|
b17a6ef959 |
+28
-28
@@ -3,36 +3,36 @@ name: CI micro-ROS Agent
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
- 'foxy'
|
||||
schedule:
|
||||
- cron: '33 6 * * *'
|
||||
|
||||
jobs:
|
||||
|
||||
microros_agent_ci:
|
||||
runs-on: ubuntu-20.04
|
||||
container: microros/base:foxy
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ ubuntu-20.04 ]
|
||||
ros_distribution: [ foxy ]
|
||||
include:
|
||||
- docker_image: ubuntu:20.04
|
||||
ros_distribution: foxy
|
||||
container:
|
||||
image: ubuntu:20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: ros-tooling/setup-ros@0.3.2
|
||||
with:
|
||||
use-ros2-testing: false
|
||||
required-ros-distributions: ${{ matrix.ros_distribution }}
|
||||
- name : Download and install dependencies
|
||||
run: |
|
||||
apt-get install ros-${{ matrix.ros_distribution }}-micro-ros-msgs
|
||||
apt-get install ros-${{ matrix.ros_distribution }}-rmw-fastrtps-cpp
|
||||
- uses : ros-tooling/action-ros-ci@0.2.5
|
||||
with:
|
||||
package-name: "micro_ros_agent"
|
||||
target-ros2-distro: ${{ matrix.ros_distribution }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
path: urosagent
|
||||
|
||||
- name: Download dependencies
|
||||
run: |
|
||||
apt update
|
||||
cd /uros_ws
|
||||
. /opt/ros/$ROS_DISTRO/setup.sh
|
||||
. install/local_setup.sh
|
||||
rosdep update --rosdistro=$ROS_DISTRO
|
||||
ros2 run micro_ros_setup create_agent_ws.sh
|
||||
|
||||
- name: Patch branch
|
||||
run: |
|
||||
rm -rf /uros_ws/src/uros/micro-ROS-Agent/*
|
||||
cp -R urosagent/* /uros_ws/src/uros/micro-ROS-Agent/
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cd /uros_ws
|
||||
. /opt/ros/$ROS_DISTRO/setup.sh
|
||||
. install/local_setup.sh
|
||||
ros2 run micro_ros_setup build_agent.sh
|
||||
@@ -0,0 +1,54 @@
|
||||
name: snap
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
branches:
|
||||
- foxy
|
||||
pull_request:
|
||||
branches:
|
||||
- foxy
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
snap-file: ${{ steps.build-snap.outputs.snap }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
# full history for latest tag name
|
||||
fetch-depth: 0
|
||||
- uses: snapcore/action-build@v1
|
||||
id: build-snap
|
||||
with:
|
||||
snapcraft-args: '--enable-experimental-extensions'
|
||||
|
||||
# Make sure the snap is installable
|
||||
- run: |
|
||||
sudo snap install --dangerous ${{ steps.build-snap.outputs.snap }}
|
||||
|
||||
# @todo Do some testing with the snap
|
||||
- run: |
|
||||
micro-ros-agent udp4
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: micro-ros-agent-snap
|
||||
path: ${{ steps.build-snap.outputs.snap }}
|
||||
|
||||
publish:
|
||||
if: github.ref == 'refs/heads/foxy' || startsWith(github.ref, 'refs/tags/')
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: micro-ros-agent-snap
|
||||
path: .
|
||||
- uses: snapcore/action-publish@v1
|
||||
env:
|
||||
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
|
||||
with:
|
||||
snap: ${{needs.build.outputs.snap-file}}
|
||||
release: ${{ startsWith(github.ref, 'refs/tags/') && 'candidate' || 'edge'}}
|
||||
@@ -33,3 +33,7 @@
|
||||
# End of https://www.gitignore.io/api/qtcreator
|
||||
|
||||
CMakeLists.txt.user
|
||||
|
||||
|
||||
# snaps
|
||||
*.snap
|
||||
|
||||
@@ -55,3 +55,4 @@ see the file [3rd-party-licenses.txt](3rd-party-licenses.txt).
|
||||
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.
|
||||
|
||||
|
||||
@@ -2,6 +2,18 @@
|
||||
Changelog for package micro-ros_agent
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
1.5.4 (2022-09-28)
|
||||
------------------
|
||||
* Fix Datawriter destruction (`#169 <https://github.com/micro-ROS/micro-ROS-Agent/issues/169>`_) (`#171 <https://github.com/micro-ROS/micro-ROS-Agent/issues/171>`_)
|
||||
* Synchronise predicate (`#160 <https://github.com/micro-ROS/micro-ROS-Agent/issues/160>`_) (`#167 <https://github.com/micro-ROS/micro-ROS-Agent/issues/167>`_)
|
||||
|
||||
1.5.3 (2022-06-13)
|
||||
------------------
|
||||
* Fix memory leak in graph manager (`#147 <https://github.com/micro-ROS/micro-ROS-Agent/issues/147>`_) (`#149 <https://github.com/micro-ROS/micro-ROS-Agent/issues/149>`_)
|
||||
|
||||
1.5.2 (2022-05-25)
|
||||
------------------
|
||||
|
||||
1.5.1 (2022-03-25)
|
||||
------------------
|
||||
* Add services to graph manager (backport `#127 <https://github.com/micro-ROS/micro-ROS-Agent/issues/127>`_) (`#128 <https://github.com/micro-ROS/micro-ROS-Agent/issues/128>`_)
|
||||
|
||||
@@ -111,6 +111,12 @@ public:
|
||||
const eprosima::fastdds::dds::DomainParticipant* participant,
|
||||
bool from_microros = true);
|
||||
|
||||
/**
|
||||
* @brief Getter for the graph cache.
|
||||
* @return Reference to inner graph cache
|
||||
*/
|
||||
rmw_dds_common::GraphCache& get_graph_cache() { return graphCache_; }
|
||||
|
||||
/**
|
||||
* @brief Adds a DDS datawriter to the graph tree.
|
||||
* @param datawriter_guid rtps::GUID_t of the datawriter to be added.
|
||||
@@ -329,7 +335,7 @@ private:
|
||||
// Store a auxiliary publishers and datawriter for each participant created in micro-ROS
|
||||
std::map<
|
||||
const eprosima::fastdds::dds::DomainParticipant*,
|
||||
std::unique_ptr<eprosima::fastdds::dds::DataWriter>
|
||||
eprosima::fastdds::dds::DataWriter*
|
||||
> micro_ros_graph_datawriters_;
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="3">
|
||||
<name>micro_ros_agent</name>
|
||||
<version>1.5.1</version>
|
||||
<version>1.5.4</version>
|
||||
<description>micro-ROS Agent package</description>
|
||||
<maintainer email="pablogarrido@eprosima.com">Pablo Garrido</maintainer>
|
||||
<maintainer email="antoniocuadros@eprosima.com">Antonio Cuadros</maintainer>
|
||||
|
||||
@@ -126,8 +126,10 @@ GraphManager::GraphManager(eprosima::fastdds::dds::DomainId_t domain_id)
|
||||
// Set graph cache on change callback function
|
||||
graphCache_.set_on_change_callback([this]()
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(this->mtx_);
|
||||
this->graph_changed_ = true;
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(this->mtx_);
|
||||
this->graph_changed_ = true;
|
||||
}
|
||||
this->cv_.notify_one();
|
||||
});
|
||||
|
||||
@@ -144,6 +146,7 @@ inline void GraphManager::publish_microros_graph()
|
||||
{
|
||||
return this->graph_changed_;
|
||||
});
|
||||
graph_changed_ = false;
|
||||
}
|
||||
|
||||
if (display_on_change_)
|
||||
@@ -151,7 +154,6 @@ inline void GraphManager::publish_microros_graph()
|
||||
std::cout << "Updated uros Graph: graph changed" << std::endl;
|
||||
std::cout << graphCache_ << std::endl;
|
||||
}
|
||||
graph_changed_ = false;
|
||||
|
||||
micro_ros_msgs::msg::Graph graph_message;
|
||||
|
||||
@@ -320,11 +322,10 @@ void GraphManager::add_participant(
|
||||
if (it == micro_ros_graph_datawriters_.end())
|
||||
{
|
||||
// Create datawriter
|
||||
std::unique_ptr<eprosima::fastdds::dds::DataWriter> datawriter;
|
||||
datawriter.reset(publisher_->create_datawriter(ros_discovery_topic_.get(), datawriter_qos_));
|
||||
eprosima::fastdds::dds::DataWriter * datawriter = publisher_->create_datawriter(ros_discovery_topic_.get(), datawriter_qos_);
|
||||
|
||||
it = micro_ros_graph_datawriters_.insert(
|
||||
std::make_pair(participant, std::move(datawriter))).first;
|
||||
std::make_pair(participant, datawriter)).first;
|
||||
}
|
||||
|
||||
it->second->write(static_cast<void *>(&info));
|
||||
@@ -344,8 +345,9 @@ void GraphManager::remove_participant(
|
||||
rmw_dds_common::convert_gid_to_msg(&gid, &info.gid);
|
||||
auto it = micro_ros_graph_datawriters_.find(participant);
|
||||
it->second->write(static_cast<void *>(&info));
|
||||
publisher_->delete_datawriter(it->second);
|
||||
micro_ros_graph_datawriters_.erase(participant);
|
||||
}
|
||||
micro_ros_graph_datawriters_.erase(participant);
|
||||
}
|
||||
|
||||
void GraphManager::add_datawriter(
|
||||
@@ -633,7 +635,7 @@ GraphManager::ParticipantListener::ParticipantListener(
|
||||
}
|
||||
|
||||
void GraphManager::ParticipantListener::on_participant_discovery(
|
||||
eprosima::fastdds::dds::DomainParticipant* participant,
|
||||
eprosima::fastdds::dds::DomainParticipant* /* participant */,
|
||||
eprosima::fastrtps::rtps::ParticipantDiscoveryInfo&& info)
|
||||
{
|
||||
switch (info.status)
|
||||
@@ -650,13 +652,15 @@ void GraphManager::ParticipantListener::on_participant_discovery(
|
||||
const std::string enclave =
|
||||
std::string(name_found->second.begin(), name_found->second.end());
|
||||
|
||||
graphManager_from_->add_participant(participant, false, enclave);
|
||||
const rmw_gid_t gid = rmw_fastrtps_shared_cpp::create_rmw_gid("rmw_fastrtps_cpp", info.info.m_guid);
|
||||
graphManager_from_->get_graph_cache().add_participant(gid, enclave);
|
||||
break;
|
||||
}
|
||||
case eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::REMOVED_PARTICIPANT:
|
||||
case eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::DROPPED_PARTICIPANT:
|
||||
{
|
||||
graphManager_from_->remove_participant(participant, false);
|
||||
const rmw_gid_t gid = rmw_fastrtps_shared_cpp::create_rmw_gid("rmw_fastrtps_cpp", info.info.m_guid);
|
||||
graphManager_from_->get_graph_cache().remove_participant(gid);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
Vendored
+1
-1
@@ -101,4 +101,4 @@ case "$daemon" in
|
||||
echo "'$daemon' is not a valid boolean for daemon" >&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles" >
|
||||
<transport_descriptors>
|
||||
<transport_descriptor>
|
||||
<transport_id>CustomUdpTransport</transport_id>
|
||||
<type>UDPv4</type>
|
||||
</transport_descriptor>
|
||||
</transport_descriptors>
|
||||
|
||||
<participant profile_name="participant_profile" is_default_profile="true">
|
||||
<rtps>
|
||||
<userTransports>
|
||||
<transport_id>CustomUdpTransport</transport_id>
|
||||
</userTransports>
|
||||
|
||||
<useBuiltinTransports>false</useBuiltinTransports>
|
||||
</rtps>
|
||||
</participant>
|
||||
</profiles>
|
||||
@@ -24,4 +24,4 @@ if [ -n "$p2p_port" ]; then
|
||||
set -- --p2p "$p2p_port" "$@"
|
||||
fi
|
||||
|
||||
exec "$SNAP/lib/micro_ros_agent/micro_ros_agent" "$transport" "$@"
|
||||
exec "$SNAP/opt/ros/snap/lib/micro_ros_agent/micro_ros_agent" "$transport" "$@"
|
||||
|
||||
+23
-41
@@ -1,12 +1,10 @@
|
||||
name: micro-ros-agent
|
||||
adopt-info: uros-agent # parse metadata from the uros-agent part
|
||||
base: core20
|
||||
version: git
|
||||
summary: Bridge between Micro ROS client applications and ROS 2
|
||||
description: |
|
||||
Micro-ROS, whose default implementation is based on eProsima's
|
||||
Micro XRCE-DDS middleware, is composed of client applications
|
||||
which interact with the ROS 2 world by means of an Agent.
|
||||
This agent keeps tracks of the entities created by means of
|
||||
Micro XRCE-DDS middleware, is composed of client applications which interact with the ROS 2 world by means of an Agent. This agent keeps tracks of the entities created by means of
|
||||
requests performed on the microcontroller side, and uses them
|
||||
to communicate with the ROS 2 dataspace.
|
||||
|
||||
@@ -71,16 +69,6 @@ description: |
|
||||
|
||||
$ snap set micro-ros-agent device="device path"
|
||||
|
||||
If connecting the micro-ROS Agent using an IP based connection mode,
|
||||
that is, `udp4`, `udp6`, `tcp4` or `tcp6`, care must be taken to
|
||||
connect first the `micro-ros-agent-shm-netplug` plug.
|
||||
This is due to the fact that ROS 2 Foxy is using Fast-DDS as the
|
||||
default DDS middleware, and Fast-DDS comes with *shared memory transport*.
|
||||
Thus, this plugin must be enabled, in order to gain access to the
|
||||
`/dev/shm` folder from the snap image, prior to running it:
|
||||
|
||||
$ sudo snap connect micro-ros-agent:micro-ros-agent-shm-netplug
|
||||
|
||||
When using the snap with a serial device, some steps need to be taken
|
||||
in order to establish a successful connection:
|
||||
|
||||
@@ -111,7 +99,6 @@ description: |
|
||||
After this, you can execute your snap as usual,
|
||||
using `sudo micro-ros-agent serial -d <serial-dev>`.
|
||||
|
||||
grade: stable
|
||||
confinement: strict
|
||||
|
||||
architectures:
|
||||
@@ -121,48 +108,43 @@ architectures:
|
||||
- build-on: ppc64el
|
||||
|
||||
parts:
|
||||
|
||||
uros-agent:
|
||||
plugin: colcon
|
||||
source: .
|
||||
override-build: |
|
||||
set +u
|
||||
git clone https://github.com/eProsima/Micro-XRCE-DDS-Agent.git -b $ROS_DISTRO
|
||||
git clone https://github.com/eProsima/Micro-CDR.git -b $ROS_DISTRO
|
||||
git clone https://github.com/micro-ROS/micro_ros_msgs.git -b $ROS_DISTRO
|
||||
git clone https://github.com/micro-ROS/rosidl_typesupport_microxrcedds.git -b $ROS_DISTRO
|
||||
git clone https://github.com/micro-ROS/rmw-microxrcedds.git -b $ROS_DISTRO
|
||||
git clone https://github.com/micro-ROS/micro-ROS-Agent.git -b $ROS_DISTRO
|
||||
. /opt/ros/$ROS_DISTRO/setup.sh
|
||||
colcon build --merge-install --install-base $SNAPCRAFT_PRIME --cmake-args "-DUAGENT_BUILD_EXECUTABLE=OFF -DUAGENT_USE_SYSTEM_FASTDDS=ON" --packages-up-to micro_ros_agent
|
||||
set -u
|
||||
build-packages: [make, gcc, g++]
|
||||
colcon-cmake-args:
|
||||
- -DMICROROSAGENT_SUPERBUILD=ON
|
||||
- --cmake-force-configure
|
||||
override-pull: |
|
||||
snapcraftctl pull
|
||||
|
||||
version="$(git describe --always --tags| sed -e 's/^v//;s/-/+git/;y/-/./')"
|
||||
[ -n "$(echo $version | grep "+git")" ] && grade=devel || grade=stable
|
||||
snapcraftctl set-version "$version"
|
||||
snapcraftctl set-grade "$grade"
|
||||
|
||||
build-packages: [make, gcc, g++, git]
|
||||
stage-packages: [ros-foxy-ros2launch]
|
||||
|
||||
runner:
|
||||
plugin: dump
|
||||
source: snap/local/
|
||||
organize:
|
||||
'*': usr/bin/
|
||||
|
||||
plugs:
|
||||
micro-ros-agent-shm-netplug:
|
||||
interface: system-files
|
||||
allow-auto-connection: true
|
||||
write:
|
||||
- /dev/shm
|
||||
'micro-ros-agent-daemon': usr/bin/
|
||||
'fastdds_no_shared_memory.xml': usr/share/
|
||||
|
||||
apps:
|
||||
micro-ros-agent:
|
||||
command: lib/micro_ros_agent/micro_ros_agent
|
||||
command: opt/ros/snap/lib/micro_ros_agent/micro_ros_agent
|
||||
environment:
|
||||
LD_LIBRARY_PATH: "$LD_LIBRARY_PATH:$SNAP/lib"
|
||||
plugs: [network, network-bind, serial-port, micro-ros-agent-shm-netplug]
|
||||
FASTRTPS_DEFAULT_PROFILES_FILE: ${SNAP}/usr/share/fastdds_no_shared_memory.xml
|
||||
plugs: [network, network-bind, serial-port]
|
||||
extensions: [ros2-foxy]
|
||||
|
||||
daemon:
|
||||
command: usr/bin/micro-ros-agent-daemon
|
||||
environment:
|
||||
LD_LIBRARY_PATH: "$LD_LIBRARY_PATH:$SNAP/lib"
|
||||
FASTRTPS_DEFAULT_PROFILES_FILE: ${SNAP}/usr/share/fastdds_no_shared_memory.xml
|
||||
daemon: simple
|
||||
plugs: [network, network-bind, serial-port, micro-ros-agent-shm-netplug]
|
||||
plugs: [network, network-bind, serial-port]
|
||||
extensions: [ros2-foxy]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user