Skip to content
Elliot Whiley edited this page Aug 27, 2015 · 3 revisions

We decided to use Catkin rather than Rosbuild
These notes are taken from Cecil - TA notes for ROS


Setup Workspace

*source /opt/ros/indigo/setup.bash
*mkdir -p rosws/src
*cd rosws/src
*catkin_init_workspace (CmakeLists.txt created)
*cd ..
*catkin_make (like cmake+make any red?- if not congratulations)
*ls
*echo $ROS_PACKAGE_PATH
*source devel/setup.bash (overlay this workspace on top of the ROS environment, if not things like ROS commands, package names not recognised for this workspace)
*echo $ROS_PACKAGE_PATH


Create ROS Package

*cd src
*catkin_create_pkg se306project std_msgs rospy roscpp (name + dependencies)
*cd se306project
*ls (package with meta information)
*gedit package.xml (note dependencies)
*gedit CmakeLists.txt (what is used for the build, what is built and how it is installed)


Add git repo from github

*git init (in se306project folder)

*git remote add origin https://github.com/gdsl/SOFTENG-306-PROJECT-1

*git fetch

NOTE these are added to se306project/CMakeList.txt (At bottom of file)

add_executable(test_robot src/test_robot.cpp)
target_link_libraries(test_robot ${catkin_LIBRARIES})
add_dependencies(test_robot test_robot_generate_messages_cpp)  

*catkin_make (needs to be run from ~/rosws)
*source devel/setup.bash (overlay everything new or changed)
*roscore (in new terminal)
*rosrun stage_ros stageros src/se306project/world/myworld.world
*rosrun se306project test_robot
(*source devel/setup.bash - if errors)

-If the catkin_make doesn't work, check the environment variable $ROS_PACKAGE_PATH. If it does not include your workspace directory do:
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:[full_path_to_your_workspace]


Using Eclipse

Note: Only tested loading the src files onto Eclipse. Have not tested building it from Eclipse. If you know how, write below
Go to your catkin workspace folder. E.g. ~/catkin_ws
Enter on terminal:

catkin_make --force-cmake -G"Eclipse CDT4 - Unix Makefiles"

This generates the .project files and is placed inside your build folder. Note: The .project file is a hidden file
Then run

awk -f $(rospack find mk)/eclipse.awk build/.project > build/.project_with_env && mv build/.project_with_env build/.project

Import project to Eclipse

Start Eclipse and run File --> Import --> Existing projects into workspace
On the Select Root Directory, browse to the package folder inside your build folder. E.g. ~/catkin_ws/build/se306project

Project should now be loaded!