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

Needs document to create executable of rqt plugins #1

Closed
130s opened this issue Jan 4, 2013 · 8 comments
Closed

Needs document to create executable of rqt plugins #1

130s opened this issue Jan 4, 2013 · 8 comments

Comments

@130s
Copy link
Member

130s commented Jan 4, 2013

I see for only some packages listed below, their binaries are generated at /opt/ros/groovy/bin/.

rqt, rqt_bag, rqt_console, rqt_graph, rqt_logger_level, rqt_plot

How to create executable needs to be documented (unless the pkgs above are special ones that are permitted to have binary).


Following is what I've tried so far.

As far as I noticed, the difference between those with binary and those without is scripts line in setup.py.

Example

d = generate_distutils_setup(
    packages=['rqt_reconfigure'],
    package_dir={'': 'src'},
    scripts=['scripts/rqt_reconfigure']
)

I tried to add scripts line to rqt_reconfigure whose binary wasn't created yet (in 5330252) but so far I don't see what I wanted.

ros-groovy-rqt-reconfigure amd64 0.2.7-0precise-20130104-0035-+0000

@zklapow
Copy link
Contributor

zklapow commented Jan 4, 2013

did you add an install rule in the CMakeLists?

@130s
Copy link
Member Author

130s commented Jan 4, 2013

Comparing CMakeLists.txt I don't see anything missing. For example referring to the latest on both pkgs:

bag http://goo.gl/yInwU

cmake_minimum_required(VERSION 2.8.3)
project(rqt_bag)
find_package(catkin REQUIRED)
catkin_package()
catkin_python_setup()

install(FILES plugin.xml
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

install(DIRECTORY resource
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

install(PROGRAMS scripts/rqt_bag
  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

rqt_reconfigure http://goo.gl/dJMNO

cmake_minimum_required(VERSION 2.8.3)
project(rqt_reconfigure)
# Load catkin and all dependencies required for this package
find_package(catkin REQUIRED)
catkin_package()
catkin_python_setup()

install(FILES plugin.xml
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

install(DIRECTORY resource
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

install(PROGRAMS scripts/rqt_reconfigure
  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

@dirk-thomas
Copy link
Contributor

The install() macro in CMake will put the script into a location where it is rosrun-able. That should be done for every script.

Some "important" scripts for core utilities also specify the script in the setup.py file as mentioned above.

Why has your change not yet appeared in the Debian package? Because ros-groovy-rqt-reconfigure 0.2.7 was released on Dec. 31st. Your commit is from Jab 2nd so it can't be in the Debian. You can verify that it works locally by installing your package (to whatever location) and confirm that the script is in the bin folder.

@130s
Copy link
Member Author

130s commented Jan 5, 2013

Thank you for the explanation. I added a section to rqt python tutorial
http://ros.org/wiki/rqt/Tutorials/Writing%20a%20Python%20Plugin about how to create a relay to executable.

@dirk-thomas
Copy link
Contributor

We should not recommend installing the scripts via scripts in setup.py. This is only used for the core plugins which should be callable from the PATH. All common plugins (and therefore the tutorial) should only use the CMake based install which makes the scripts rosrun-able.

@130s
Copy link
Member Author

130s commented Jan 5, 2013

We should not recommend installing the scripts via scripts in setup.py.

Can I ask the reason?

This is only used for the core plugins which should be callable from the PATH. All common plugins (and therefore the tutorial) should only use the CMake based install which makes the scripts rosrun-able.

I'm confused. So I understand as follows. Is this correct?

  • Installing custom rqt plugins via scripts in setup.py should not be recommended to 3rd party developers
  • Non-3rd party rqt plugins (ie. those that are to be included currently either in rqt, rqt_common_plugins, rqt_robot_plugins, rqt_pr2_dashboard) can use scripts

If this is correct, I'll add to the tutorial that installing scripts is NOT recommended.

@dirk-thomas
Copy link
Contributor

Scripts installed via setup.py are put in the global bin and are therefore on the system path. This is only desired for rqt itself and some plugins which had rx equivalents before (which were also on the path). Not all plugins should install their script in order to not end up with hundreds of binaries on the path.

But all plugins should install their script via CMake which puts the script into a package specific folder which is not on the path. These scripts can be run using rosrun rqt_myplugin rqt_myscript.

@130s
Copy link
Member Author

130s commented Jan 6, 2013

I see. wiki is updated again as you see.
I still keep, though, the section for installing scripts into bin folder (with warning), to allow developers who might really want to do so for whatever reasons. I thought nice that rqt has that option.

ablasdel pushed a commit that referenced this issue Jul 8, 2015
Removed unneeded lines to enable merge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants