Closed aditya2592 closed 2 years ago
Hello @aditya2592
In order to help you with your issue, we will need more information regarding your scenario and the nodes running.
Configuration file seems fine, and it looks like it is being loaded correctly.
So, I would say the problem here is about reaching the Server (Discovery Server).
The node that works as Discovery Server needs to be running in order for a Super Client to connect with the network (and get discovery information). Do you have a Discovery Server running? If so, are you sure it is listening in the locator you have set 127.0.0.1::11811 and it is recheable from the ros2 daemon (the node in charge of executing ros2 topic list
.
Please, check this tutorial and make sure you are running a Discovery Server and that your ros2 daemon is configured as a super client : https://github.com/micro-ROS/docker/issues/84 (or else, you can configure your ros2 daemon as the Discovery Server if you do not have one in your scenario). If you have further questions, please let us know and retrieve more information about your specific use case.
Hi @jparisu, yes the discovery server is running through another docker container using the IP address and port in above config. We use the discovery server for all other services, subscribers and publishers that are present on the host PC itself and it works as expected in code and on the daemon. Regarding configuring the daemon as super client, is_default_profile="true"
flag should take care of that right?
Is the DomainParticipant
in the agent code compatible with using a participant
profile that points to discovery server as the discovery
protocol? Or does it mess up its discovery of information coming from the nucleo board running microros?
Adding some more info, discovery server is launched using docker-compose
below:
discovery_server:
image: <custom image built off ros-galactic-ros-base>
container_name: discovery_server
network_mode: host
ipc: host
volumes:
- /dev:/dev
stop_signal: SIGINT
privileged: true
command: fastdds discovery --server-id 0 --ip-address 127.0.0.1 --port 11811
And then the agent + ROS daemon commands are in another docker instance launched through compose:
moveit:
image: <same image as above>
depends_on:
- discovery_server
logging:
driver: "json-file"
options:
max-size: "20m"
max-file: "10"
privileged: true
container_name: moveit
network_mode: host
ipc: host
init: true
environment:
- DISPLAY=$DISPLAY
- QT_X11_NO_MITSHM=1
- PYTHONFAULTHANDLER=1
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
command: ros2 launch micro_ros_agent micro_ros_agent_launch.py
stop_signal: SIGINT
Both the above instances are using the same super client config that I posed in my earlier message. Then I docker exec
into the moveit
container from above list and try to do ros2 topic list
. In another experiment, I tried to do everything in the same docker instance and I am able to list and echo the topic. However it doesn't work across docker instances.
We have tested the scenario with the expected results:
Docker 1:
FASTRTPS_DEFAULT_PROFILES_FILE
to a file containing your XML fileros2 run micro_ros_agent ...
Docker 2:
FASTRTPS_DEFAULT_PROFILES_FILE
to a file containing your XML filefastdds discovery --server-id 0 --ip-address 127.0.0.1 --port 11811
ros2 topic list
Both docker has been intantiated using:
docker run \
-it \
--net=host \
- v /dev:/dev \
--privileged \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
[image]
Could you provide precise steps for creating a scenario where we can reproduce your issue?
This works now! I had to build the agent package as part of our ROS image and launch the agent through that image using docker-compose
Issue template
Steps to reproduce the issue
Start microros agent docker agent with fastdds and below config for
FASTRTPS_DEFAULT_PROFILES_FILE
docker exec -it <container_id> bash
ros2 topic list
Expected behavior
Actual behavior
ros2 topic list
doesn't show any topics that are being published on the nucleoIf discovery server is removed from the XML, then the topics are visible:
Additional information