Hi @kazimciit,
in that Open Class we see that Alberto used Docker to launch the ROS2 nodes in the robot.
Could you tell us if you are using Docker, or running ROS2 directly on the host computer?
If you run the command below:
env |egrep 'RMW|CYC'
Do you have the output below?
CYCLONEDDS_URI=file:///var/lib/theconstruct.rrl/cyclonedds.xml
RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
If you are using docker, the command I mentioned above should be executed inside the Docker Container.
If using Docker, can you check the content of the file below?
cat /var/lib/theconstruct.rrl/cyclonedds.xml
Also, many times we cannot see the topics because we may be using different DOMAIN IDs.
If you check the ROS_DOMAIN_ID variable where ROS is running, what do you have in the output?
echo $ROS_DOMAIN_ID
If you see nothing, then it means the robot is running with ROS_DOMAIN_ID=0, because “0” is the default.
If you have any number different from zero, then this is the reason. If that is the case, you would have to export the same domain ID in the rosject terminal, kill the ros2 daemon and list the topics again, something like this:
export ROS_DOMAIN_ID=SAME_DOMAIN_AS_IN_THE_ROBOT
ros2 daemon stop
ros2 topic list
ros2 topic list
ros2 topic list
Also, if you had the nodes running in the robot before setting up the robot connection to The Construct, you may also have to stop the ros2 daemon in the robot.
I suppose you have sourced “source ~/.bashrc
” before running the ROS2 nodes in the robot, right?
A simple test that I do is the following, after installing the script provided by The Construct:
- source ~/.bashrc
- Publish a simple message in the robot:
ros2 topic pub /my_test_topic std_msgs/msg/String data:\ \'Alive\'\
- THen, in the rosject terminal I list the topics:
ros2 topic list
If it fails, I just try ros2 topic list
again.
- If I can see the topic, I do a ‘ros2 topic echo’ on the rosject terminal:
ros2 topic echo /my_test_topic
If this simple test does not work, it means you may have a different ROS_DOMAIN_ID set or something else.
If this simple test does not work, then you have to solve whatever is pending to be solved.
Please let us know how your tests go.