ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Unable to run the tutorial server and client

asked 2014-02-18 04:01:36 -0500

Warrior gravatar image

updated 2014-02-18 04:02:40 -0500

Hi everyone. I have an issue running the server and client python scripts from the tutorials. Could you please help me resolve the issue? I am using the Hydro distribution and I have followed the steps 1 to 16 for the beginner tutorials. Now, when I execute the command line rosrun beginner_tutorials add_two_ints_server.py I get the following error messages:

Traceback (most recent call last):
File "/home/$MY_NAME/catkin_ws/src/beginner_tutorial/scripts/add_two_ints_server.py", line 3, in <module>
from beginner_tutorials.srv import *
ImportError: No module named beginner_tutorials.srv

Also, when I execute the command line rosrun beginner_tutorials add_two_ints_client.py I get the following error messages:

Traceback (most recent call last):
  File "/home/$MY_NAME/catkin_ws/src/beginner_tutorial/scripts/add_two_ints_client.py", line 2, in <module>
    import roslib; roslib.load_manifest('beginner_tutorials')
  File "/opt/ros/hydro/lib/python2.7/dist-packages/roslib/launcher.py", line 62, in load_manifest
    sys.path = _generate_python_path(package_name, _rospack) + sys.path
  File "/opt/ros/hydro/lib/python2.7/dist-packages/roslib/launcher.py", line 93, in _generate_python_path
    m = rospack.get_manifest(pkg)
  File "/usr/lib/pymodules/python2.7/rospkg/rospack.py", line 159, in get_manifest
    return self._load_manifest(name)
  File "/usr/lib/pymodules/python2.7/rospkg/rospack.py", line 198, in _load_manifest
    retval = self._manifests[name] = parse_manifest_file(self.get_path(name), self._manifest_name)
  File "/usr/lib/pymodules/python2.7/rospkg/rospack.py", line 190, in get_path
    raise ResourceNotFound(name, ros_paths=self._ros_paths)
rospkg.common.ResourceNotFound: beginner_tutorials
ROS path [0]=/opt/ros/hydro/share/ros
ROS path [1]=/home/$MY_NAME/catkin_ws/src
ROS path [2]=/opt/ros/hydro/share
ROS path [3]=/opt/ros/hydro/stacks

Here is the output for the command "export | grep ROS":

declare -x ROSLISP_PACKAGE_DIRECTORIES="/home/MY_NAME/catkin_ws/devel/share/common-lisp"
declare -x ROS_DISTRO="hydro"
declare -x ROS_ETC_DIR="/opt/ros/hydro/etc/ros"
declare -x ROS_MASTER_URI="localhost:11311"
declare -x ROS_PACKAGE_PATH="/home/MY_NAME/catkin_ws/src:/opt/ros/hydro/share:/opt/ros/hydro/stacks"
declare -x ROS_ROOT="/opt/ros/hydro/share/ros"
declare -x ROS_TEST_RESULTS_DIR="/home/MY_NAME/catkin_ws/build/test_results"

Here is my CMakeLists.txt file's content in the 'src' folder in the directory of catkin_ws:

# toplevel CMakeLists.txt for a catkin workspace
# catkin/cmake/toplevel.cmake

cmake_minimum_required(VERSION 2.8.3)

set(CATKIN_TOPLEVEL TRUE)

# search for catkin within the workspace
set(_cmd "catkin_find_pkg" "catkin" "${CMAKE_SOURCE_DIR}")
execute_process(COMMAND ${_cmd}
  RESULT_VARIABLE _res
  OUTPUT_VARIABLE _out
  ERROR_VARIABLE _err
  OUTPUT_STRIP_TRAILING_WHITESPACE
  ERROR_STRIP_TRAILING_WHITESPACE
)
if(NOT _res EQUAL 0 AND NOT _res EQUAL 2)
  # searching fot catkin resulted in an error
  string(REPLACE ";" " " _cmd_str "${_cmd}")
  message(FATAL_ERROR "Search for 'catkin' in workspace failed (${_cmd_str}): ${_err}")
endif()

# include catkin from workspace or via find_package()
if(_res EQUAL 0)
  set(catkin_EXTRAS_DIR "${CMAKE_SOURCE_DIR}/${_out}/cmake")
  # include all.cmake without add_subdirectory to let it operate in same scope
  include(${catkin_EXTRAS_DIR}/all.cmake NO_POLICY_SCOPE)
  add_subdirectory("${_out}")

else()
  # use either CMAKE_PREFIX_PATH explicitly passed to CMake as a command line argument
  # or CMAKE_PREFIX_PATH from the environment
  if(NOT DEFINED CMAKE_PREFIX_PATH)
    if(NOT "$ENV{CMAKE_PREFIX_PATH}" STREQUAL "")
      string(REPLACE ":" ";" CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
    endif()
  endif()

  # list of catkin workspaces
  set(catkin_search_path "")
  foreach(path ${CMAKE_PREFIX_PATH})
    if(EXISTS "${path}/.catkin ...
(more)
edit retag flag offensive close merge delete

Comments

Hi Warrior. Where did you save the beginner_tutorial package?

Kaplan gravatar image Kaplan  ( 2014-02-18 10:05:14 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2014-03-25 08:26:01 -0500

Warrior gravatar image

Hi. Actually there was a misspelling in the package name. Now it's working fine.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-02-18 04:01:36 -0500

Seen: 931 times

Last updated: Feb 18 '14