rosmake my own teleop package and launch keyboard teleoperation -- no response
Hi,
It's my first time to use rosmake to build a new package. I met a problem and hope someone could help me:
Basically I followed the tutorial: h t t p://www.youtube.com/playlist?list=PLDC89965A56E6A8D6 (for turtlebot 1, making a package is in part 3). I just want to use the original turtlebot_key.cpp (no modified) to build my own package and compile and run a keyboard teleoperation
Here are the steps I followed (on workstation, using turtlebot 2):
- Create my own package "mytele":
roscreate-pkg mytele geometry_msgs rospy roscpp
- Add this line to the end of ~/.bashrc to let ROS know my new package:
export ROS_PACKAGE_PATH=~/mytele:${ROS_PACKAGE_PATH}
- Check if mytele can be recognized:
rospack find mytele
- Compile the package (no source file yet):
rosmake mytele mytele
- Copy turtlebot_key.cpp to the src folder
- At the end of CMakeLists.txt, add:
rosbuild_add_executable(mytele_keyboard src/turtlebot_key.cpp)
- Compile the package again (the binary file "mytele_keyboard" is generated):
rosmake mytele mytele
- Create a launch file "mytele_keyboard.launch" and add the following lines to execute the node:
< launch>
<node pkg=“mytele” type=“mytele_keyboard” name=“mytele_keyboard” output=“screen”>
</node>
</launch> - Launch the launch file:
roslaunch mytele mytele_keyboard.launch
With the turtlebot bringup having been initialized, I launched mytele and got no error message:
... logging to /home/kevinma/.ros/log/918f92d0-0555-11e3-8d5f-2cd05a67dbef/roslaunch-kevinma-TAICHI31-3963.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 h t t p://192.168.15.48:51907/
SUMMARY
========
PARAMETERS
* /rosdistro
* /rosversion
NODES
/
mytele_keyboard (mytele/mytele_keyboard)
ROS_MASTER_URI=h t t p://192.168.15.68:11311
core service [/rosout] found
process[mytele_keyboard-1]: started with pid [3972]
Reading from keyboard
---------------------------
Use arrow keys to move the turtlebot.
However, there was no response no matter what key I pressed (arrow or "i" or "j"). I tried to use
rostopic echo /mobile_base/commands/velocity
to look at the command and it seemed that no commands were send out.
Nevertheless, I tried to use the original teleop
roslaunch turtlebot_teleop keyboard_teleop.launch
and the turtlebot moved as expected and I could also see the velocity command changing.
I noticed that the original turtlebot_teleop is written in Python and mytele is built from the .cpp file, because the keys for operating the turtlebot are different, but I expect the c++ version should work too. In the tutorial video the turtlebot 1 in gazebo works well.
Are the steps I followed for turtlebot 1 only? Did I miss something when building the package? I am a beginner in compiling a ROS package. Please help and I would appreciate it.
Kevin Ma
Run `rqt_graph` (groovy) or `rxgraph` (fuerte) and `roswtf` and check if everything is connected correct.