ahros

ahros

ns http://www.ros.org/wiki/ROS/Tutorials/InstallingandConfiguringROSEnvironment
ns http://www.ros.org  -- wiki top page

CONTENTS

-------- TODO PR2 ACORN_SCRIPTS LAUNCH_PREFIX FILES_PACKAGES_STACKS CATKIN_WORKSPACE_CREATION CREATE_NEW_PACKAGE_FROM_SCRATCH RUNNING MESSAGES_AND_SERVICES INSTALLATION URDF NEW_MACHINE_SETUP

TODO

modify roslaunch with an option to show all rosparams (and docstrings?) create templates for various types of node/plugin: - rviz display, frame, view, tool, etc - tf listener/publisher - use of tf, eigen, Create Utility library - conversions: color, vec, quat, mtx, pose for Eigen, tf, qt, ogre, std::vector, msg - print various data types with STREAM<<x Add interactive_tf_marker and quat calculator Fix robot_interaction Add moveit_forward.h which fwd declares RobotState,Model,etc

PR2

See ahpr2

ACORN_SCRIPTS

rrrr <n> <d> source setup.bash script <n> (0-9); and cd to dir <d> (optional); set window title sr<n> source setup.bash script <n> srw source setup.bash for workspace containing current directory rrm make in current workspace rrf <file> find file (can use glob pattern as for find -name) rre <file> edit file rrg <regex> grep in ROS files rfp <file> find ROS package a file belongs to rrad <dep> add dep to current package as build and run dependency, and as required catkin comp. rrl OLD-DEPRECATED run roslaunch rrml rrm then rrl

LAUNCH_PREFIX

in node tag: launch-prefix="tw -ck -wGDB -s220x74 -e gdb --args" launch-prefix="/usr/bin/xterm -bg black -fg white -sb -geometry 250X70 -title GDB -xrm xterm.*.iconName:GDB -e gdb --args"

FILES_PACKAGES_STACKS

roscd pkg/path - cd to <path> within <pkg>. The /<path> part is optional. rosls pkg/path - as above, but ls roscp <pkg> <file> <dst> - copy <file> from <pkg> to <dst> rosed <pkg> <file> - edit <file> from <pkg> (uses $EDITOR) rospack find <pkg> rosstack find <stack> - OBSOLETE rospack profile - update database of packages and stacks rosdep resolve <dep> - discover how to install a dependency e.g. rviz boost eigen etc

CATKIN_WORKSPACE_CREATION

Create a catkin workspace: my_workspace=$HOME/my_workspace my_workspace=$HOME/l/ros2 my_workspace=$HOME/l/ros8 my_workspace2=$HOME/l/ros9 source /opt/ros/hydro/setup.bash mkdir -p $my_workspace/src cd $my_workspace catkin_make Create a layered workspace: cd $my_workspace source devel/setup.bash mkdir -p $my_workspace2/src cd $my_workspace2 catkin_make Build workspace using rrm: rrm # from anywhere in workspace rrm --reldeb rrm -? # show more options Build workspace using catkin_make: cd $my_workspace catkin_make Useful catkin_make options: --force-cmake - rerun cmake part (sometimes done automatically, sometimes required) -DCMAKE_BUILD_TYPE=Debug -- or Release Build workspace by hand: cd $my_workspace/build cmake ../src make # optional: make install To run stuff from devel (no 'make install' needed): source $my_workspace/devel/setup.bash rosrun <pkgname> <exename> To run stuff from install ('make install' needed): source $my_workspace/install/setup.bash rosrun <pkgname> <exename> Installing source from git: cd $my_workspace/src git clone git://github.com/ros/ros_tutorials.git rrm --reldeb Installing source from git using wstool (alternative to above): cd $my_workspace/src wstool init # creates ./.rosinstall if not already there wstool set ros_tutorials --git git://github.com/ros/ros_tutorials.git wstool update rrm

CREATE_NEW_PACKAGE_FROM_SCRATCH

Try the acorn_ros_pkg script (experimental) cd $my_workspace/src/repo catkin_create_pkg my_pkg_name std_msgs rospy roscpp tf cmake_modules message_runtime eigen_conversions ... # my_pkg_name is name of package and name of dir created # std_msgs rospy roscpp ... are packages this package depends on # other useful deps: pluginlib moveit_core moveit_ros_planning moveit_ros_perception # octomap fcl cd $my_workspace/src/repo/my_pkg_name # edit package.xml # - desceription # - maintainer # - license vi src/foo.cpp # add a ros node program # edit CMakeLists.txt # see http://www.ros.org/wiki/catkin/CMakeLists.txt # longer: http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries # add: add_executable(foo src/foo.cpp) target_link_libraries(foo ${catkin_LIBRARIES} ${Boost_LIBRARIES}) # if this pkg creates a library: edit catkin_package(...) and uncomment LIBRARIES line # dependency examples: find_package(catkin REQUIRED COMPONENTS moveit_core moveit_ros_planning pluginlib) find_package(PkgConfig REQUIRED) find_package(Eigen REQUIRED) find_package(Boost REQUIRED system filesystem date_time thread) # Note: some added by catkin_create_pkg automatically from deps on cmdline. # Others can be added as needed. PACKAGE_WITH_MESSAGES --------------------- Add to package.xml <build_depend>message_generation</build_depend> <build_depend>std_msgs</build_depend> <build_depend>moveit_msgs</build_depend> <build_depend>geometry_msgs</build_depend> <build_depend>sensor_msgs</build_depend> <run_depend>message_runtime</run_depend> <run_depend>std_msgs</run_depend> <run_depend>moveit_msgs</run_depend> <run_depend>geometry_msgs</run_depend> <run_depend>sensor_msgs</run_depend> *** ALSO: any other packages with messages you depend on Add to CMakeLists.txt add_message_files( FILES MyMessage1.msg MyMessage2.msg ) generate_messages( DEPENDENCIES std_msgs ) add_dependencies( my_library_or_executable_name ${PROJECT_NAME}_generate_messages_cpp )

RUNNING

rrm - run catkin make rrl - launch a .launch file in current dir or below (or above) rrml - rrm && rrml roscore - run the core ross executable - do this before running other nodes rosnode list - list running nodes (rosnode -h for other subcommands) rosrun <pkg> <node> - run <node> from <pkg> rosrun rqt_graph rqt_graph - see currently running ROS node graph rostopic -h - see topic info (-h to list subcommands) rostopic pub ... - send a message from command line rosservice -h - see and call services rosparam -h - manipulate parameters stored on server rosparam get / - see all values roslaunch <file> - run launch file - an xml file with ros commands roswtf - show warnings and errors about potential problems

MESSAGES_AND_SERVICES

how to create: http://www.ros.org/wiki/ROS/Tutorials/CreatingMsgAndSrv rosmsg -h - view message info rossrv -h - view service info rosbag record -a - record all messages to current dir (filename is <date>.bag)

INSTALLATION

ROS was installed with sudo apt-get install ros-fuerte-desktop-full python-rosinstall python-rosdep or sudo apt-get install ros-hydro-desktop-full python-wstool or sudo apt-get install ros-indigo-desktop-full python-wstool which creates /opt/ros/fuerte/... which creates /opt/ros/hydro/... which creates /opt/ros/indigo/... workspace was setup with mkdir ~/Projects/ros_fuerte_workspace rosws init ~/Projects/ros_fuerte_workspace /opt/ros/fuerte The setros (aka sr) alias just sources my ros_setup script which sources source /home/acorn/Projects/ros_fuerte_workspace/setup.bash sandbox was setup with setros cd ~/Projects/ros_fuerte_workspace mkdir sandbox rosws set $PWD/sandbox setros This sets up a sandbox area for tutorial projects etc (see http://www.ros.org/wiki/fuerte/Installation/Overlays) For the tutorials I also installed sudo apt-get install ros-fuerte-ros-tutorials sudo apt-get install ros-fuerte-rqt sudo apt-get install ros-fuerte-rx

URDF

To test a URDF: sudo apt-get install ros-hydro-urdf-tutorial cd <dir containing urdf file> roslaunch urdf_tutorial display.launch model:=<filename>.urdf gui:=true

NEW_MACHINE_SETUP

Install ROS: goto ros.org click on install follow instructions Extra installs (needed for moveit) sudo apt-get install python-wstool libglew1.6-dev ros-hydro-pr2-mechanism ros-hydro-razer-hydra Use this to set up a new workspace (replace "2" in ros2 with any digit) mkdir -p l/ros2/src ln -s l/ros2 .ros2 cd l/ros2/src wstool init . Setup workspace as described here: http://moveit.ros.org/wiki/Installation Moveit extra src stuff: add your key to github in settings. cat ~/.ssh/id_rsa.pub copy paste key to https://github.com/settings/ssh Add these lines to ~/l/ros2/src/.rosinstall - git: {local-name: geometric_shapes, uri: 'https://github.com/ros-planning/geometric_shapes.git', version: hydro-devel} - git: {local-name: interaction_cursor_3d, uri: 'https://github.com/aleeper/interaction_cursor_3d.git', version: groovy-devel} - git: {local-name: rviz_animated_view_controller, uri: 'https://github.com/ros-visualization/rviz_animated_view_controller.git', version: hydro-devel} - git: {local-name: view_controller_msgs, uri: 'https://github.com/ros-visualization/view_controller_msgs.git', version: hydro-devel} - git: {local-name: razer_hydra, uri: 'https://github.com/ros-drivers/razer_hydra.git', version: hydro-devel} - git: {local-name: necessity, uri: 'git@github.com:Ravenswood14/necessity.git', version: master} wstool update cd ~/l/ros2 catkin_make roslaunch pr2_moveit_config demo.launch roslaunch baxter_moveit_config demo_baxter.launch OpenGL TIP: To use software renderer in rviz set export LIBGL_ALWAYS_SOFTWARE=1 see http://wiki.ros.org/rviz/Troubleshooting OLD CRAP -- IGNORE THIS Setup workspace (replace "hydro" with your ros version, and "2" in ros2 to any digit): source /opt/ros/hydro/setup.bash sudo apt-get update sudo apt-get install python-wstool ros-hydro-pr2-mechanism libglew1.6-dev sudo apt-get install ros-groovy-moveit-source-build-deps ros-hydro-pr2-apps ros-hydro-rqt-pr2-dashboards wstool merge https://raw.github.com/ros-planning/moveit_docs/hydro-devel/moveit.rosinstall wstool update cd .. catkin_make