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

Add a simple roswtf plugin that checks the number of connected devices #80

Merged

Conversation

130s
Copy link
Member

@130s 130s commented Jun 6, 2018

In some applications specific number of sensors are required to run as expected. This PR adds roswtf plugin to check the number of the sensors plugged in to the computer your application runs on.

Example: by plugging 2 sensors, the check fail if openni2_num_sensors is not changed (default=1).

$ lsusb
:
Bus 005 Device 002: ID 1d27:0601 ASUS 
Bus 003 Device 002: ID 1d27:0601 ASUS 

term-1$ roscore

term-2$ roswtf

Loaded plugin tf.tfwtf
Loaded plugin openni2_launch.wtf_plugin
No package or stack in context
================================================================================
Static checks summary:

Found 1 error(s).

ERROR One or more openni2 sensors not found.
 * 2 openni2 sensors found while 1 expected.

================================================================================
Beginning tests of your ROS graph. These may take awhile...
analyzing graph...
... done analyzing graph
running graph rules...
... done running graph rules

Online checks summary:

Found 1 warning(s).
Warnings are things that may be just fine, but are sometimes at fault

WARNING The following node subscriptions are unconnected:
 * /rosout:
   * /rosout

After setting openni2_num_sensors param with 2, no error occurs.

term-2$ rosparam set openni2_num_sensors 2

$ roswtf                                                                                                                                                                    
Loaded plugin tf.tfwtf
Loaded plugin openni2_launch.wtf_plugin
No package or stack in context
================================================================================
Static checks summary:

No errors or warnings
================================================================================
Beginning tests of your ROS graph. These may take awhile...
analyzing graph...
... done analyzing graph
running graph rules...
... done running graph rules

Online checks summary:

Found 1 warning(s).
Warnings are things that may be just fine, but are sometimes at fault

WARNING The following node subscriptions are unconnected:
 * /rosout:
   * /rosout

130s added a commit to plusone-robotics/openni2_camera that referenced this pull request Jun 6, 2018
130s added a commit to plusone-robotics/openni2_camera that referenced this pull request Jun 6, 2018
@130s 130s force-pushed the add_roswtf/indigo_devel branch from 572cefc to d3f7e15 Compare June 7, 2018 18:34
130s added a commit to plusone-robotics/openni2_camera that referenced this pull request Jun 7, 2018
@130s 130s force-pushed the add_roswtf/indigo_devel branch 2 times, most recently from 286364f to 3de8ff9 Compare June 7, 2018 19:38
130s added a commit to plusone-robotics/openni2_camera that referenced this pull request Jun 7, 2018
@130s 130s force-pushed the add_roswtf/indigo_devel branch 3 times, most recently from 6b19b45 to 9f21af9 Compare June 7, 2018 19:50
130s added a commit to plusone-robotics/openni2_camera that referenced this pull request Jun 7, 2018
@130s
Copy link
Member Author

130s commented Jun 7, 2018

#80 (comment)

I'm tempted to create kinetic-devel and re-open this PR against that

I scratch that. Because I need to have this working on Indigo as well, I just replaced the code with what works on Trusty without depending on a special library. Just tested on Trusty with 2 Xtions plugged in.

$ rosparam get openni2_num_sensors_expected
ERROR: Parameter [/openni2_num_sensors_expected] is not set

$ roswtf
Loaded plugin tf.tfwtf
Loaded plugin openni2_launch.wtf_plugin
No package or stack in context
================================================================================
Static checks summary:

Found 1 error(s).

ERROR Different number of openni2 sensors found.
 * 2 openni2 sensors found (expected: 1).

================================================================================
Beginning tests of your ROS graph. These may take awhile...
analyzing graph...
... done analyzing graph
running graph rules...
... done running graph rules

Online checks summary:

Found 1 warning(s).
Warnings are things that may be just fine, but are sometimes at fault

WARNING The following node subscriptions are unconnected:
 * /rosout:
   * /rosout

$ rosparam set openni2_num_sensors_expected 2
$ roswtf                                                                                                                                                             
Loaded plugin tf.tfwtf
Loaded plugin openni2_launch.wtf_plugin
No package or stack in context
================================================================================
Static checks summary:

No errors or warnings
================================================================================
Beginning tests of your ROS graph. These may take awhile...
analyzing graph...
... done analyzing graph
running graph rules...
... done running graph rules

Online checks summary:

Found 1 warning(s).
Warnings are things that may be just fine, but are sometimes at fault

WARNING The following node subscriptions are unconnected:
 * /rosout:
   * /rosout


$ rosparam set openni2_num_sensors_expected 3
$ roswtf
Loaded plugin tf.tfwtf
Loaded plugin openni2_launch.wtf_plugin
No package or stack in context
================================================================================
Static checks summary:

Found 1 error(s).

ERROR Different number of openni2 sensors found.
 * 2 openni2 sensors found (expected: 3).

================================================================================
Beginning tests of your ROS graph. These may take awhile...
analyzing graph...
... done analyzing graph
running graph rules...
... done running graph rules

Online checks summary:

Found 1 warning(s).
Warnings are things that may be just fine, but are sometimes at fault

WARNING The following node subscriptions are unconnected:
 * /rosout:
   * /rosout

ROS buildfarm CI fails same as #57 (comment), which is ignorable (we'll have to disable it on the next release to rosdistro).

@130s 130s force-pushed the add_roswtf/indigo_devel branch from 3774de7 to e4fc557 Compare June 7, 2018 20:07
@130s
Copy link
Member Author

130s commented Jun 8, 2018

@mikeferguson Since you left a comment, which was very helpful, can you give another look? I summarized the result in #80 (comment)

@mikeferguson
Copy link
Member

Packaging aspects LGTM -- I know nothing about the roswtf stuff.

@130s
Copy link
Member Author

130s commented Jul 18, 2018

ROS buildfarm CI fails but can be ignored same as #55. On the next release I'll disable it.

This has been tested on our weekly test and works fine. Merging once Travis CI passes but please open tickets for any issues.

@130s
Copy link
Member Author

130s commented Jul 18, 2018

ABI check failed only for Melodic https://travis-ci.org/ros-drivers/openni2_camera/jobs/405168671#L1587

Preparing, please wait ...
ERROR: no symbols info in the ABI dump
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Function abi_check_libopenni2_camera_nodelet returned with code '7' after 0 min 0 sec 

Not sure what's the error in the output.

Merging, but this needs a closer look before making a new release to Melodic.

@130s 130s merged commit 9851f78 into ros-drivers:indigo-devel Jul 18, 2018
@130s 130s deleted the add_roswtf/indigo_devel branch July 18, 2018 02:37
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.

None yet

2 participants