# Turtlebot usage ###### tags: `Turtlebot` [TOC] ## SSH into turtlebot ssh turtle1 ## How to use the respository on the pc? * **The respository** already in turtlebot? Only need respository in turtlebot, don't need in main pc? * Main pc only runs **roscore**? * **WHich branch** to use? (dev/master) * How to **bring up the turtlebot** (turtlebot_igmr_bringup.launch) ``` roslaunch turtlebot_igmr_bringup turtlebot_igmr_bringup.launch namespace:=turtlebot_<NR> slam:=True joy:=True ``` * Turtlebot namespace? turtlebot_<NR> * How to manually operate the turtlebot? (teleop? ps4?) (does joy means using ps4 joystick?) * How to navigate the turtlebot? Since no lidar on the turtlebot, could not use slam? could not navigate by simply with the turtlebot_igmr_navigation.launch. * Need to create a new map? Or use the exsiting map (home/last_map.yaml)? How to create a new map based on aruco tags? Slam always false? * What planner do you normally use? ### (From dev branch) 2.6 Test the Turtlebot * Send goals to the MoveBase framework ``` rostopic pub /turtlebot_2/move_base_simple/goal geometry_msgs/PoseStamped "header: seq: 0 stamp: secs: 0 nsecs: 0 frame_id: '' pose: position: x: 0.0 y: 0.0 z: 0.0 orientation: x: 0.0 y: 0.0 z: 0.0 w: 1.0" ``` * If a new map of the environment should be taken: * Connect the PS4 controller with the turtlebot. For this, press and hold the *share* and *playstation icon* button simultaneously until the light of the controller starts to blink - two times fast. Then press the button with the playstation icon again. The light of the controller should stop blinking and turn blue when connected with the turtlebot * Start the launch file with the corresponding arguments ``` roslaunch turtlebot_igmr_bringup turtlebot_igmr_bringup.launch namespace:=turtlebot_<NR> slam:=True joy:=True ``` * Start rviz and add a *map* entry. You can also add a *RobotModel* and a *tf* entry * Navigate in the environment until the map is complete enough. When you are satisfied with the outcome, save the map on the turtlebot with ``` roslaunch turtlebot_igmr_localization save_map.launch ``` * The new map will be automatically be saved in *home* and loaded next time when the Mobile Manipulator is brought up. ### (From dev branch) 2.4. Bring Up the Mobile Manipulators #### Step 1 Start on the main PC a rosmaster. #### Step 2 (Option 1) * Log in over ssh to the turtlebot's NUC and turtlebot's raspberry and start the corresponding bringup files ``` roslaunch open_manipulator_on_turtlebot_igmr_bringup mobile_manipulator_bringup.launch turtlebot_namespace:=$TURTLEBOT_NAMESPACE open_manipulator_namespace:=$OPEN_MANIPULATOR_NAMESPACE mobile_manipulator_namespace:=$MOBILE_MANIPULATOR_NAMESPACE" roslaunch raspberrypi_bringup raspberrypi_bringup.launch open_manipulator_namespace:=$OPEN_MANIPULATOR_NAMESPACE mobile_manipulator_namespace:=$MOBILE_MANIPULATOR_NAMESPACE ``` * Pay attention to the namespace. *TURTLEBOT_NAMESPACE* is usually *turtlebot_<NR>*, *OPEN_MANIPULATOR_NAMESPACE* is usually *open_manipulator_<NR>*, and the *MOBILE_MANIPULATOR_NAMESPACE* is usually *mobile_manipulator_<NR>* #### Step 2 (Option 2) * Ssh on the turtlebot<NR> and comment out the four lines following `If not running interactively, don't do anything` the .bashrc file, if not already done * Ssh on the raspberrypi_turtlebot<NR> and comment out the four lines following `If not running interactively, don't do anything` the .bashrc file, if not already done * Copy the *open_manipulator_on_turtlebot_igmr* metapackage to the PC where the ROS master should run (usually the main PC) * Start the mobile manipulators with the bash scripts from the *open_manipulator_on_turtlebot_igmr_bringup/scripts* folder of the copied metapackage (`mobile_manipulator<NR>_start.sh`). ## How to connect my PC to the network? * Name of PC: $ hostname ### 2.4. Network Configurations rosmaster should run on a main PC, while the Mobile Manipulators will just connect to it. To be able to exchange all required data between the different PC, execute the following steps: * Add in the **etc/hosts file of all PCs** ***the IPs and the names of the other PCs*** (e.g. main PC, turtlebot NUC, turtlebot RaspberryPi) **So should I add my PCs name to the hosts file of all other PCS?** * Define in the .bashrc file of the main PC that it is the master * Define in the .bashrc file from the NUCs and the Raspberries that the main PC hosts the rosmaster. **How should I specify the rosmaster in my PC? Simply add name?** ## Run ROS Nodes in main PC * Is it allowed? * Could I clone packages from my respository and create a workspace here to run? Would the files be cleaned up daily? Where should I put my workspace at?