Ask Your Question
0

sros2 demo (no such file or directory)

asked 2019-10-25 03:00:26 -0600

jlepers gravatar image

updated 2019-10-25 04:02:53 -0600

gvdhoorn gravatar image

I'm trying following demo https://github.com/ros2/sros2/blob/ma...

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 !

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-10-25 14:50:08 -0600

marguedas gravatar image

updated 2019-11-10 07:09:12 -0600

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
edit flag offensive delete link more

Comments

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

jlepers gravatar imagejlepers ( 2019-11-08 02:24:32 -0600 )edit

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
jlepers gravatar imagejlepers ( 2019-11-08 02:31:31 -0600 )edit

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 ?

jlepers gravatar imagejlepers ( 2019-11-08 02:34:16 -0600 )edit

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?

marguedas gravatar imagemarguedas ( 2019-11-08 17:31:02 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-10-25 03:00:26 -0600

Seen: 27 times

Last updated: Nov 10