Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linux tutorial: cloning example policies and set of default policies for a node #295

Merged
merged 8 commits into from
May 6, 2024

Conversation

mikaelarguedas
Copy link
Member

@mikaelarguedas mikaelarguedas commented May 4, 2024

(Tested only on Linux)

  • clone the sros2 repo in a temporary directory to retrieve test policies from it
    • the subversion hack doesnt work anymore..
  • add get_type_description service to a standard node policy
    • otherwise the node won't start as this service and associated topics are created by default
  • minor fixups to README and tutorials

Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>
Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>
@mikaelarguedas
Copy link
Member Author

Potentially the same svn issue happens on the Windows tutorial and switching to git would solve the issue

Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>
Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>
Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>
Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small additional fixes, but overall looks good to me.

SROS2_Linux.md Outdated Show resolved Hide resolved
SROS2_MacOS.md Outdated Show resolved Hide resolved
SROS2_Windows.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
mikaelarguedas and others added 2 commits May 6, 2024 14:46
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for the improvement!

@clalancette
Copy link
Contributor

Since this change is just to the README.md, going ahead and merging without any additional CI.

@clalancette clalancette merged commit ca6bb12 into rolling May 6, 2024
3 checks passed
@clalancette clalancette deleted the fix_examples branch May 6, 2024 13:17
@clalancette
Copy link
Contributor

@Mergifyio backport jazzy

Copy link

mergify bot commented May 6, 2024

backport jazzy

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request May 6, 2024
…ies for a node (#295)

* clone policies to temporary dir as subversion hack doesnt work anymore

* add get_type_description service to policies

* update MacOS similarly

* update all permissions with new topics

* dont rule out cycloneDDS

* example of enclave override

Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
(cherry picked from commit ca6bb12)
clalancette pushed a commit that referenced this pull request May 6, 2024
…ies for a node (#295) (#296)

* clone policies to temporary dir as subversion hack doesnt work anymore

* add get_type_description service to policies

* update MacOS similarly

* update all permissions with new topics

* dont rule out cycloneDDS

* example of enclave override

Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
(cherry picked from commit ca6bb12)

Co-authored-by: Mikael Arguedas <mikael.arguedas@gmail.com>
Copy link
Contributor

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikaelarguedas @clalancette i think some of these documents are not precise or not working as expected as far as i checked. i will try with rolling to make sure if this is happening with mainline 1st, and will create another issue to track them. (probably each rmw implementation repository with the issue.)

```bash
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp # or
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with rmw_fastrtps_cpp, this procedure does not work. (i tested with jazzy test environment.)

root@51cdd59e1f3e:~# export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
root@51cdd59e1f3e:~# export ROS_SECURITY_KEYSTORE=~/sros2_demo/demo_keystore
root@51cdd59e1f3e:~# export ROS_SECURITY_ENABLE=true
root@51cdd59e1f3e:~# export ROS_SECURITY_STRATEGY=Enforce
root@51cdd59e1f3e:~# ros2 run demo_nodes_cpp talker --ros-args --enclave /talker_listener/talker
[INFO] [1715030073.646233306] [rcl]: Found security directory: /root/sros2_demo/demo_keystore/enclaves/talker_listener/talker
[INFO] [1715030074.656773123] [talker]: Publishing: 'Hello World: 1'
...<snip>

root@51cdd59e1f3e:~# export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
root@51cdd59e1f3e:~# export ROS_SECURITY_KEYSTORE=~/sros2_demo/demo_keystore
root@51cdd59e1f3e:~# export ROS_SECURITY_ENABLE=true
root@51cdd59e1f3e:~# export ROS_SECURITY_STRATEGY=Enforce
root@51cdd59e1f3e:~# ros2 run demo_nodes_py listener --ros-args --enclave /talker_listener/listener
[INFO] [1715030123.004486867] [rcl]: Found security directory: /root/sros2_demo/demo_keystore/enclaves/talker_listener/listener
[INFO] [1715030125.668635649] [listener]: I heard: [Hello World: 52]
[INFO] [1715030126.659144765] [listener]: I heard: [Hello World: 53]

root@51cdd59e1f3e:~# export ROS_SECURITY_ENCLAVE_OVERRIDE=/talker_listener/listener
root@51cdd59e1f3e:~# ros2 daemon stop
root@51cdd59e1f3e:~# ros2 daemon status
root@51cdd59e1f3e:~# ros2 node list --no-daemon
[INFO] [1715030178.386225737] [rcl]: Found security directory: /root/sros2_demo/demo_keystore/enclaves/talker_listener/listener
root@51cdd59e1f3e:~# ros2 topic list --no-daemon
[INFO] [1715030183.341342733] [rcl]: Found security directory: /root/sros2_demo/demo_keystore/enclaves/talker_listener/listener
/parameter_events
/rosout
root@51cdd59e1f3e:~# ros2 topic echo /chatter
[INFO] [1715030189.509482358] [rcl]: Found security directory: /root/sros2_demo/demo_keystore/enclaves/talker_listener/listener
WARNING: topic [/chatter] does not appear to be published yet
Could not determine the type for the passed topic

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh weird I dont have the same behavior. But it may be part of the daemon issue you point out.

On my end the topic does appear in the topic list and the echo works

(but ros2 node list returns an empty list which is weird)

$ ros2 daemon stop
The daemon has been stopped

$ ros2 node list
[INFO] [1715031598.709184801] [rcl]: Found security directory: /home/mikael/sros2_demo/demo_keystore/enclaves/talker_listener/listener

$ ros2 topic list
/chatter
/parameter_events
/rosout

$ ros2 topic echo /chatter
[INFO] [1715031753.543324314] [rcl]: Found security directory: /home/mikael/sros2_demo/demo_keystore/enclaves/talker_listener/listener
data: 'Hello World: 193'
---
data: 'Hello World: 194'
---
data: 'Hello World: 195'
---

```bash
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp # or
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp # or
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with rmw_cyclonedds_cpp, no problem observed.

root@51cdd59e1f3e:~# export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
root@51cdd59e1f3e:~# export ROS_SECURITY_KEYSTORE=~/sros2_demo/demo_keystore
root@51cdd59e1f3e:~# export ROS_SECURITY_ENABLE=true
root@51cdd59e1f3e:~# export ROS_SECURITY_STRATEGY=Enforce
root@51cdd59e1f3e:~# ros2 run demo_nodes_cpp talker --ros-args --enclave /talker_listener/talker
[INFO] [1715030073.646233306] [rcl]: Found security directory: /root/sros2_demo/demo_keystore/enclaves/talker_listener/talker
[INFO] [1715030074.656773123] [talker]: Publishing: 'Hello World: 1'
...<snip>

root@51cdd59e1f3e:~# export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
root@51cdd59e1f3e:~# export ROS_SECURITY_KEYSTORE=~/sros2_demo/demo_keystore
root@51cdd59e1f3e:~# export ROS_SECURITY_ENABLE=true
root@51cdd59e1f3e:~# export ROS_SECURITY_STRATEGY=Enforce
root@51cdd59e1f3e:~# ros2 run demo_nodes_py listener --ros-args --enclave /talker_listener/listener
[INFO] [1715030308.304379343] [rcl]: Found security directory: /root/sros2_demo/demo_keystore/enclaves/talker_listener/listener
[INFO] [1715030308.870311399] [listener]: I heard: [Hello World: 29]

root@51cdd59e1f3e:~# export ROS_SECURITY_ENCLAVE_OVERRIDE=/talker_listener/listener
root@51cdd59e1f3e:~# ros2 daemon stop
root@51cdd59e1f3e:~# ros2 daemon status
root@51cdd59e1f3e:~# ros2 node list --no-daemon
[INFO] [1715030359.385181616] [rcl]: Found security directory: /root/sros2_demo/demo_keystore/enclaves/talker_listener/listener
/talker
root@51cdd59e1f3e:~# ros2 topic list --no-daemon
[INFO] [1715030366.263345203] [rcl]: Found security directory: /root/sros2_demo/demo_keystore/enclaves/talker_listener/listener
/chatter
/parameter_events
/rosout
root@51cdd59e1f3e:~# ros2 topic echo /chatter
[INFO] [1715030372.966397551] [rcl]: Found security directory: /root/sros2_demo/demo_keystore/enclaves/talker_listener/listener
data: 'Hello World: 94'
---
data: 'Hello World: 95'
---

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good as that's the only one I tested end-to-end from osrf/ros2_test_cases#1307

```bash
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp # or
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp # or
export RMW_IMPLEMENTATION=rmw_connextdds
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security does not even work...

root@51cdd59e1f3e:~# export RMW_IMPLEMENTATION=rmw_connextdds
root@51cdd59e1f3e:~# export ROS_SECURITY_KEYSTORE=~/sros2_demo/demo_keystore
root@51cdd59e1f3e:~# export ROS_SECURITY_ENABLE=true
root@51cdd59e1f3e:~# export ROS_SECURITY_STRATEGY=Enforce
root@51cdd59e1f3e:~# ros2 run demo_nodes_cpp talker --ros-args --enclave /talker_listener/talker
[INFO] [1715030503.075598598] [rcl]: Found security directory: /root/sros2_demo/demo_keystore/enclaves/talker_listener/talker
RTI Connext DDS Non-commercial license is for academic, research, evaluation and personal use only. USE FOR COMMERCIAL PURPOSES IS PROHIBITED. See RTI_LICENSE.TXT for terms. Download free tools at rti.com/ncl. License issued to Non-Commercial User license@rti.com For non-production use only.
Expires on 00-jan-00 See www.rti.com for more information.
[CREATE Participant] RTIOsapiLibrary_openEx:!open library=libnddssecurityd.so: libnddssecurityd.so: cannot open shared object file: No such file or directory
[CREATE Participant] DDS_DomainParticipantTrustPlugins_initialize:!failed to load library
[CREATE Participant] DDS_DomainParticipant_createI:!create builtin trust plugins support
[CREATE Participant] DDS_DomainParticipantFactory_create_participant_disabledI:!create participant
[ERROR] [1715030503.205463802] [rmw_connextdds]: failed to create DDS participant
[ERROR] [1715030503.205703150] [rmw_connextdds]: failed to initialize DomainParticipant
[ERROR] [1715030503.205735098] [rmw_connextdds]: failed to initialize node in context
terminate called after throwing an instance of 'rclcpp::exceptions::RCLError'
  what():  failed to initialize rcl node: failed to create DDS participant, at ./src/common/rmw_context.cpp:557, at ./src/rcl/node.c:252
[ros2run]: Aborted

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm wondering for how long this doesnt work 🤔 I don't have a license ATM but will give it a shot sometimes this week

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libnddssecurityd.so: cannot open shared object file: No such file or directory

@fujitatomoya are you sure you installed the Connext Security plugins on your system ?
It looks like the relevant libraries are missing

Could you successfully complete this section of the tutorial? https://github.com/ros2/sros2/blob/rolling/SROS2_Linux.md#additional-configuration-for-rti-connext

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah that is i did not do, sorry. i need to take this back.

Then use the CLI as usual:

```bash
ros2 node list
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be accessing the ros2 daemon, and return empty list? i think we should recommend here to use --no-daemon option to get the node graph via underlying rmw implementation directly. (and else where.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bind security enclaves to ros2cli commands for debug purpose Support for cyclonedds on ROS2 Humble
3 participants