rosmake my own teleop package and launch keyboard teleoperation -- no response

876 views
Skip to first unread message

Yuan-Hung (Kevin) Ma

unread,
Aug 14, 2013, 11:17:57 PM8/14/13
to ros-sig-...@googlegroups.com
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: http://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):
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.

started roslaunch server http://192.168.15.48:51907/

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

Daniel Stonier

unread,
Aug 15, 2013, 7:36:35 PM8/15/13
to ros-sig-...@googlegroups.com
The cpp I believe was the first implementation, the python came later and is what we currently use, so you might want to build from that.

From memory, I do not believe we've ever actually run the cpp version and subsequently its remappings are probably all incorrect for turtlebot 2. We just kept it around for those who might want to have a look. Probably it's better if we delete it - it's in the repo history anyway.

Cheers,
Daniel.


--
You received this message because you are subscribed to the Google Groups "ROS TurtleBot Special Interest Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ros-sig-turtle...@googlegroups.com.
To post to this group, send email to ros-sig-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ros-sig-turtlebot/34657aed-3605-415d-a3d3-7f548a8f029a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Yuan-Hung (Kevin) Ma

unread,
Aug 22, 2013, 12:05:32 AM8/22/13
to ros-sig-...@googlegroups.com
Thank you for your reply, Daniel. I have C++ experience but I have no idea about Python. Actually, what I am really interested in is the follower demo. I would like to have some interaction with turtlebot 2 through Kinect. Although Python may be an easier way for scripting, I guess I would save time to work on the follower in C++ directly. Hopefully the follower.cpp is still active (I checked that there is no "scripts" folder and it seemed that no Python code is in the "src" of "turtlebot_follower"). I will try to follow the ROS tutorial using catkin to create my package.

Kevin Ma

Daniel Stonier

unread,
Aug 22, 2013, 4:37:32 AM8/22/13
to ros-sig-...@googlegroups.com
On Thu, Aug 22, 2013 at 1:05 PM, Yuan-Hung (Kevin) Ma <yuanh...@gmail.com> wrote:
Thank you for your reply, Daniel. I have C++ experience but I have no idea about Python. Actually, what I am really interested in is the follower demo. I would like to have some interaction with turtlebot 2 through Kinect. Although Python may be an easier way for scripting, I guess I would save time to work on the follower in C++ directly. Hopefully the follower.cpp is still active (I checked that there is no "scripts" folder and it seemed that no Python code is in the "src" of "turtlebot_follower"). I will try to follow the ROS tutorial using catkin to create my package.

I started with C++ as well. Python is good to learn and easy to pick up in small chunks and is very complementary to know in addition to c++. I use c++ for control and vision processing now, python for everything else - it's especially easy for string/file manipulation or networking code.

follower.cpp is the real deal. It's only a very crude algorithm - there are really many ways it could be usefully improved, but its a starting point.

Cheers,
Daniel.

aditya mandalapu

unread,
Apr 13, 2016, 2:15:54 PM4/13/16
to ROS TurtleBot Special Interest Group
hi Daniel i am working on turtlebot 2 and i want to write a custom code to control the movemet of the turlebot using the bump sensors, i was hoping that you can help me to go forward

Thank you,
Reply all
Reply to author
Forward
0 new messages