0
$\begingroup$

Rosanswers logo

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/WritingTeleopNode

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


Originally posted by astur on ROS Answers with karma: 31 on 2014-09-25

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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.


Originally posted by 2ROS0 with karma: 1133 on 2014-09-25

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by astur on 2014-09-25:
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

Comment by dido_yf on 2014-12-18:
hello, I have the same problem with you. Did you solve this problem? Could you tell me how?

Comment by astur on 2014-12-18:
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

Comment by astur on 2014-12-18:
robin@rchiesa:~/catkin_ws_ruben/src/$ 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.

$\endgroup$
0
$\begingroup$

Rosanswers logo

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.


Originally posted by sergioperezgt with karma: 11 on 2015-01-26

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.