Hi,
It's my first time to use rosmake to build a new package. I met a problem and hope someone could help me:
Here are the steps I followed (on workstation):
1. Create my own package "mytele":
roscreate-pkg mytele geometry_msgs rospy roscpp
2. Add this line to the end of ~/.bashrc to let ROS know my new package:
export ROS_PACKAGE_PATH=~/mytele:${ROS_PACKAGE_PATH}
3. Check if mytele can be recognized:
rospack find mytele
4. Compile the package (no source file yet):
rosmake mytele mytele
5. Copy turtlebot_key.cpp to the src folder
6. At the end of CMakeLists.txt, add:
rosbuild_add_executable(mytele_keyboard src/turtlebot_key.cpp)
7. Compile the package again (the binary file "mytele_keyboard" is generated):
rosmake mytele mytele
8. 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>
9. 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.
SUMMARY
========
PARAMETERS
* /rosdistro
* /rosversion
NODES
/
mytele_keyboard (mytele/mytele_keyboard)
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