ros2

How to gracefully stop a Dockerized Python ROS2 node when run with docker-compose up?

和自甴很熟 提交于 2021-02-07 09:40:33
问题 I have a Python-based ROS2 node running inside a Docker container and I am trying to handle the graceful shutdown of the node by capturing the SIGTERM / SIGINT signals and/or by catching the KeyboardInterrupt exception. The problem is when I run the node in a container using docker-compose . I cannot seem to catch the "moment" when the container is being stopped/killed. I've explicitly added the STOPSIGNAL in the Dockerfile and the stop_signal in the docker-compose file. Here is a sample of

How to launch a node with a parameter in ROS2?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-16 08:57:31
问题 Migrating ros1 package to ros2 and couldn't figure how to launch with a paramter in ros2. With ros1 I have a launch file that refers to a config file and from cpp code I use node.getParam launch file: <launch> <arg name="node_name" default="collector" /> <arg name="config_file" default="" /> <node name="$(arg node_name)" pkg="collector" type="collector" respawn="true"> <rosparam if="$(eval config_file!='')" command="load" file="$(arg config_file)"/> </node> </launch> config file: my_param: 5

DDS configuration with multicast and unicast

拟墨画扇 提交于 2020-01-04 15:15:54
问题 I am still trying to understand DDS and its concepts. I have a configuration where 2 laptops run dds based application. My environment does not permit multicast so I decided to go for peer to peer connection(unicast). To bring both the laptops in the same network, I connected them using ethernet cable (Not sure if it was necessary or not). Now I did not change anything in the QoS i.e. i did not do any settings for unicasting. But now my applications are communicating with each other. Question

Interfacing a native DDS system with ROS2

痴心易碎 提交于 2019-12-11 02:51:44
问题 To communicate to a ROS2 based publisher and a RTI Connext based subscriber, both of them need to have a compatible QoS settings. I am using RTI Connector for python and using the XML Application Creation to run the subscriber. I run a talker_py in ROS2 which has a default QoS and subscribe to these messages in RTI Connext Pro. The ROS2 IDL is looks like this : { module msg { module dds_ { struct String_ { String data_; }; }; }; }; I use the rtiddsgen utility tool to convert it into a XML