#################################### ##FILL ME IN #################################### ## links to any required tutorials ## note.0= [[wiimote/Tutorials/StartingWiimoteNode| Pairing and Using a Wiimote with ROS]] ## descriptive title for the tutorial ## title = Writing a Teleoperation Node for the Wiimote ## multi-line description to be displayed in search ## description = This tutorial covers how to write a teleoperation node and use it to drive the turtle in the [[turtlesim]]. ## the next tutorial description (optional) ## next = ## links to next tutorial (optional) ## next.0.link= ## next.1.link= ## what level user is this tutorial for ## level= BeginnerCategory ## keywords = teleoperation, joystick, Wiimote #################################### <> <> === Create a Scratch Package === Before starting this tutorial, take the time to create a scratch package to work in and manipulate the example code. See [[ROS/Tutorials/CreatingPackage|creating a ROS package]] to learn more about creating a package. In the sandbox folder, create a package called learning_wiimote, with dependencies on roscpp, turtlesim and wiimote: {{{ $ roscd sandbox $ roscreate-pkg learning_wiimote roscpp turtlesim wiimote }}} Uncomment the rosbuild_genmsg() line in the CMakeLists.txt file of the learning_wiimote package and run [[rosmake]]. === Writing a Simple Teleoperation Node === First, create learning_wiimote/src/turtle_teleop_wiimote.cpp in your favorite editor, and place the following inside it: <> === Compiling and Running Turtle Teleop === Add the following line to your CMakeLists.txt file: {{{ rosbuild_add_executable(turtle_teleop_wiimote src/turtle_teleop_wiimote.cpp) }}} Run [[rosmake]] on your package. === Writing a Launch File to Start all of the Nodes === Now let's make a launch file to start all of the nodes we need to start: create the file launch/turtle_wii.launch and paste the following into it: <> change the line before the last one to: Now you can start your nodes to drive your turtle around: {{{ roslaunch learning_wiimote turtle_wii.launch }}} Press the 1 & 2 buttons as directed. Now use the move the wiimote controller to drive. ## AUTOGENERATED DO NOT DELETE ## TutorialCategory ## TutorialTurtlesim ## JoyStickDriverCategory