If you want to write scripts for ROS using Eclipse editor and project settings, you can do so by following some ordered steps.
For roscpp, your project needs to follow the standard package template, where the
If you don't wish to use the cmake.mk file, then you can grab the necessary Makefile rule from mk/cmake.mk and adapt it to your needs.
Enjoy your project in eclipse now :)- Create a ROS package # Create a ros package in your ros-workspace
- roscd package_name # Goto the directory where you created your package
- make eclipse-project # This is an important step to tell eclipse that we will be using our package in eclipse as a project
- Goto Import ->package_directory->apply
- Add the executable name to CMakelists.txt file
- rosmake package_name
- Goto Run Configurations {give path to your binary} -> Apply
- Run
For roscpp, your project needs to follow the standard package template, where the
Makefile
looks like: include $(shell rospack find mk)/cmake.mk
And
nothing more (i.e. the rest of your bulid is configured via CMake).
The above cmake.mk file declares the eclipse-project target. If you don't wish to use the cmake.mk file, then you can grab the necessary Makefile rule from mk/cmake.mk and adapt it to your needs.
Creating new python project
Make sure you first create a source folder in the project by right clicking on your project name and then New-> Source folder.
The source folder created by the rospkg does not work.
Then go on to add the new file {pydev module}.
By default the project name will be weird like containing '@' symbols so make sure to renaming your project to something nice before you try running it.
Passing Runtime arguments in Eclipse-Python
import sys
sys.argv = raw_input('Enter command line arguments: ').split()
No comments:
Post a Comment