Robotics StackExchange | Archived questions

sros2 demo (no such file or directory)

I'm trying following demo https://github.com/ros2/sros2/blob/master/SROS2_Linux.md

Access control:

First, we will copy this sample policy file into our keystore:

svn checkout https://github.com/ros2/sros2/trunk/sros2/test/policies

And now we will use it to generate the XML permission files expected by the middleware:

ros2 security create_permission demo_keys /talker policies/sample_policy.xml
ros2 security create_permission demo_keys /listener policies/sample_policy.xml

When trying the code above, I get the following error:

[Errno 2] No such file or directory: 'demo_keys/talker/permissions.xml'   

I can find the policies folder in my keystore and the talker and listener folder both have the permissions.xml file.

What am I doing wrong here ?

Thanks in advance !

Asked by jlepers on 2019-10-25 03:00:26 UTC

Comments

Answers

When running the command the path to the keystore demo_keys is relative:

ros2 security create_permission demo_keys /talker policies/sample_policy.xml

My guess is that you changed directory and the relative path demo_keys/talker/permissions.xml is not valid anymore.

You should be in the same directory (~/sros2_demo in tutorial) when you run all the following commands

ros2 security create_keystore demo_keys
ros2 security create_key demo_keys /talker
svn checkout https://github.com/ros2/sros2/trunk/sros2/test/policies
ros2 security create_permission demo_keys /talker policies/sample_policy.xml

Asked by marguedas on 2019-10-25 14:50:08 UTC

Comments

To be completely correct, you should be in the ~/sros2_demo directory. But this worked for me !

Asked by jlepers on 2019-11-08 03:24:32 UTC

After building the permissions.p7s file I was able to find a list of topics were the talker/listener are able to subscribe/publish to:

 <topic>rt/chatter</topic>

However running a node with the correct name (talker/listener) and correct topic (chatter) failed with following exception:

 [INFO] [rcl]: Found security directory: /home/jens/sros2_demo/demo_keys/listener
 terminate called after throwing an instance of 'rclcpp::exceptions::RCLError'
 what():  could not create service: create_client() could not create subscriber, at /tmp/binarydeb/ros- 
 dashing-rmw-fastrtps-cpp-0.7.5/src/rmw_service.cpp:177, at /tmp/binarydeb/ros-dashing-rcl- 
 0.7.7/src/rcl/service.c:178

Asked by jlepers on 2019-11-08 03:31:31 UTC

I assume that SROS2 is working fine now, but it is blocking nodes I think should be able to publish/subscriber. What am I doing wrong ?

Asked by jlepers on 2019-11-08 03:34:16 UTC

To be completely correct, you should be in the ~/sros2_demo directory. But this worked for me !

My bad that's indeed the path I meant, I edited my answer above to reflect it. Documentation was updated accordingly the day the answer was posted: https://github.com/ros2/sros2/pull/167

I assume that SROS2 is working fine now, but it is blocking nodes I think should be able to publish/subscriber. What am I doing wrong ?

Yeah this should work indeed. Can you open a separate question for this?

Asked by marguedas on 2019-11-08 18:31:02 UTC