Ask Your Question
0

ERROR: cannot launch node of type [ps3joy/ps3_joy_node]

asked 2014-09-25 06:07:49 -0500

astur gravatar image

updated 2014-09-26 08:44:10 -0500

First of all, I'm running Ubuntu 12.04.5 LTS (using catkin hydro) on my workstation and at the beginning, I have these packets: beginner_tutorials, ps3joy and CMakelist.txt file ( ~/catkin_ws_ruben/src )

Im trying to follow Writing a Teleoperation Node for the PS3 Joystick from

http://wiki.ros.org/ps3joy/Tutorials/...

I created my new package learning_ps3joy on ~/catkin_ws_ruben/src

chmod +x turtle_teleop_ps3joy.cpp (to execute turtle_teleop_ps3joy.cpp I've created)

I suppose that this line is wrong on wiki:

rosbuild_add_executable(turtle_teleop_ps3joy src/turtle_teleop_ps3joy.cpp)

so I change for this

rosbuild_add_executable(learning_ps3joy src/turtle_teleop_ps3joy.cpp)

So in CMakeList.txt I have the following ( I suppose is correct):

cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

# Set the build type.  Options are:
#  Coverage       : w/ debug symbols, w/o optimization, w/ code-coverage
#  Debug          : w/ debug symbols, w/o optimization
#  Release        : w/o debug symbols, w/ optimization
#  RelWithDebInfo : w/ debug symbols, w/ optimization
#  MinSizeRel     : w/o debug symbols, w/ optimization, stripped binaries
#set(ROS_BUILD_TYPE RelWithDebInfo)

rosbuild_init()

#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

#uncomment if you have defined messages
rosbuild_genmsg()
#uncomment if you have defined services
#rosbuild_gensrv()

#common commands for building c++ executables and libraries

rosbuild_add_executable(learning_ps3joy src/turtle_teleop_ps3joy.cpp)

#rosbuild_add_library(${PROJECT_NAME} src/example.cpp)
#target_link_libraries(${PROJECT_NAME} another_library)
#rosbuild_add_boost_directories()
#rosbuild_link_boost(${PROJECT_NAME} thread)
#rosbuild_add_executable(example examples/example.cpp)
#target_link_libraries(example ${PROJECT_NAME})

I type rosmake and then following Setting up the PS3 Joystick without problems

Then I create launch folder, create inside turtle_ps3joy.launch

<launch>

 <!-- Turtlesim Node-->
  <node pkg="turtlesim" type="turtlesim_node" name="sim"/>


 <!-- PS3 joy node -->
  <node respawn="true" pkg="ps3joy"
        type="ps3joy_node" name="PS3_turtle_joy" >
    <param name="dev" type="string" value="/dev/input/js0" />
    <param name="deadzone" value="0.12" />
  </node>

 <!-- Axes -->
  <param name="axis_linear" value="1" type="int"/>
  <param name="axis_angular" value="0" type="int"/>
  <param name="scale_linear" value="2" type="double"/>
  <param name="scale_angular" value="2" type="double"/>

  <node pkg="turtle_teleop" type="turtle_teleop_joy" name="teleop"/>

</launch>

and run on termimal roslaunch learning_ps3joy turtle_ps3joy.launch

Output:

   ... logging to /home/robin/.ros/log/ba129752-4582-11e4-b0c4-0024e808a46a/roslaunch-rchiesa-8582.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://rchiesa:33145/

SUMMARY
========

PARAMETERS
 * /PS3_turtle_joy/deadzone
 * /PS3_turtle_joy/dev
 * /axis_angular
 * /axis_linear
 * /rosdistro
 * /rosversion
 * /scale_angular
 * /scale_linear

NODES
  /
    PS3_turtle_joy (ps3joy/ps3joy_node)
    sim (turtlesim/turtlesim_node)
    teleop (turtle_teleop/turtle_teleop_joy)

auto-starting new master
process[master]: started with pid [8596]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to ba129752-4582-11e4-b0c4-0024e808a46a
process[rosout-1]: started with pid [8609]
started core service [/rosout]
process[sim-2]: started with pid [8621]
ERROR: cannot launch node of type [ps3joy/ps3joy_node]: can't locate node [ps3joy_node] in package [ps3joy]
ERROR: cannot launch node of type [turtle_teleop/turtle_teleop_joy]: can't locate node [turtle_teleop_joy] in package [turtle_teleop]

So , How can I solve this?

Thanks for your time

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2014-09-25 15:28:17 -0500

2ROS0 gravatar image

Can you share your launch file and a little more clarity on the packages you are using?

It is most likely a naming error. You need to take care with what you are naming your packages, your nodes and your executables. And the same should reflect in your launch file.

Another common error is - you might not have sourced the setup.bash of your catkin workspace. As a result ROS will not find your packages.

edit flag offensive delete link more

Comments

Packages that I am using: turtlesim, ps3joy and turtle_teleop on ~/catkin_ws_ruben/src/

Now, I think launch file is correct with the name of packages and nodes

I sourced the setup.bash at the beginning tutorials

astur gravatar imageastur ( 2014-09-25 16:58:31 -0500 )edit

hello, I have the same problem with you. Did you solve this problem? Could you tell me how?

dido_yf gravatar imagedido_yf ( 2014-12-18 04:41:07 -0500 )edit
1

I use package joy (I discard package ps3joy). Moreover, I use geometry_msgs.msg import Twist and publish with pub = rospy.Publisher('turtle1/cmd_vel', Twist) with this msg. Also, make sure you have the correct lines on package and CMakeList and the packages on /src.Then apply a catkin_make

astur gravatar imageastur ( 2014-12-18 05:48:24 -0500 )edit

robin@rchiesa:~/catkin_ws_ruben/src/<pakage you="" are="" working="">$ ls CMakeLists.txt include msg src launch package.xml scripts srv

~/catkin_ws_ruben/$ catkin_make

Can you write here what error is showing you?, i can try to help you.

astur gravatar imageastur ( 2014-12-18 06:13:05 -0500 )edit
1

answered 2015-01-26 06:34:06 -0500

sergioperezgt gravatar image

I also had this problem. What I basically did was a modification on the launching of the node ps3joy, changing it for the ps3.launch included in the launch folder of package ps3joy. Here is the launch file which worked for me:

> <launch>
> 
>  <!-- Turtlesim Node-->   <node
> pkg="turtlesim" type="turtlesim_node"
> name="sim"/>
> 
> 
>  <!-- PS3 joy node -->   <node
> pkg="joy" type="joy_node"
> name="ps3_joy" output="screen" >
>     <param name="dev" type="string" value="/dev/input/js0"
/>
>     <param name="deadzone" value="0.12" />   </node>
> 
>  <!-- Axes -->   <param
> name="axis_linear" value="1"
> type="int"/>   <param
> name="axis_angular" value="0"
> type="int"/>   <param
> name="scale_linear" value="2"
> type="double"/>   <param
> name="scale_angular" value="2"
> type="double"/>
> 
>   <node pkg="learning_ps3joy"
> type="turtle_teleop_ps3joy"
> name="teleop"/>
> 
> </launch>

If you are naming the files and folders as is shown in the tutorial it should work.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2014-09-25 06:07:49 -0500

Seen: 3,217 times

Last updated: Sep 26 '14