Using Pico: Difference between revisions

From Control Systems Technology Group
Jump to navigation Jump to search
No edit summary
 
(28 intermediate revisions by 4 users not shown)
Line 2: Line 2:


Make sure to '''ALWAYS''' obey the following rules:
Make sure to '''ALWAYS''' obey the following rules:
* If Jazz is not connected to the power supply, '''always hold the emergency switch''' (PS3 controller) and keep an eye on the robot. If you only have the slightest idea that something may go wrong, press the button (right trigger). You can release the emergency switch with button 9 (left from the Logitech sign).
* If PICO is not connected to the power supply, '''always hold the emergency switch''' (Tyro remote) and '''keep an eye on the robot'''. If you only have the slightest idea that something may go wrong, press the red button. You can release the emergency switch by turning the red button clockwise.
* If Jazz is not driving around, always plug in the power supply. The batteries only last about 3.5 hours and we need at least 5 test hours per day.
* If PICO is not driving around, always:
** Plug in '''PICO's power supply'''. The batteries only last about 3.5 hours and we need at least 5 test hours per day.
** Plug then l'''aptop's power supply'''
* '''Fill in the log book!''' Make sure you at least write down your name, what you tested and if any problems occured during testing.
 
 
You should test on the MSL soccer field. Pico will be in the robotics test area (the room opposite of the MSL socces field). You can get the key by asking one of the students in the robotics lab.


= Setting up your software =
= Setting up your software =


Your software runs on the laptop. Jazz is connected to the laptop through a dedicated wireless network. To get your software up and running:
Your software runs on PICO's laptop. The computer inside PICO is connected to this laptop through a dedicated wired network. You will use an external laptop (dev-laptop) to connect to the PICO laptop through the wireless RoboEarth network. To get your software up and running, on the dev-laptop:


* Connect to the tue-wpa2 network (see the network icon in the upper-right corner) and make sure you '''disable''' the wired connection (which is used to communicate with Jazz).
* Connect to the RoboEarth network (see the network icon in the upper-right corner).
* Open a terminal, and ''cd'' to ''~/ros/emc/groups''
* Open a terminal, and type ''sshpicolaptop'', to connect to PICO's laptop via SSH.
* ''cd'' to ''~/ros/emc/groups/emc<your_group_number>''
* Do an ''svn up''. You will be prompted for your group's account name and password.
* Do an ''svn up''. You will be prompted for your group's account name and password.
* Build your package(s)
* Build your package(s)
Line 16: Line 23:
*** Build with the ''--pre-clean'' flag:<pre>rosmake --pre-clean</pre>, and
*** Build with the ''--pre-clean'' flag:<pre>rosmake --pre-clean</pre>, and
*** Remove the build folder from the SVN!
*** Remove the build folder from the SVN!
== Following your software from the dev-laptop ==
* Connect to the RoboEarth network (see the network icon in the upper-right corner).
* If you use your own visualisation:
** Open a terminal, and ''cd'' to ''~/ros/emc/groups/emc<your_group_number>''
** Do an ''svn up''. You will be prompted for your group's account name and password.
** Build your package(s)
* If you use Rviz:
** Open a terminal and run ''rviz''
== If you do not use the SVN ==
* '''Please start doing so!''' It is ''so'' useful once you are used to it (for managing your project, tracking changes, working on different computers, etc...), and setting up your software on the laptop will be a piece of cake!
* You will have to transfer your package to the laptop in another way, e.g. using webmail or a USB stick. When you do, '''make sure to put your package in the ~/ros/emc/groups folder'''.


= Test =
= Test =


# If Jazz is not on yet, turn it on (use the switch on its back)
# Switch on the robot (use the switch on its back). It is ready to use once you see its 'eyes' on the display.
# Disable the wireless connection (e.g. with the tue-wpa2 network) and enable the wired connection (Auto Eth0)
# On the dev-laptop (so ''not'' the laptop on PICO's back), run ''sshpicolaptop''
# Test if you have a working connection with Jazz:
# Run ''pstart''
#* <pre>rostopic list</pre> should give an overview of Jazz' ROS topics
# Test whether you have a working connection with PICO:
#* <pre>rostopic echo /robot_out</pre> should output Jazz' odometry information
#* Open a terminal and run ''sshpicolaptop''
#* <pre>rostopic list</pre> should give an overview of Pico's ROS topics
#* <pre>rostopic echo /pico/odom</pre> should output Pico's odometry information
# '''Hold the emergency switch, and keep an eye on the robot.'''
# '''Hold the emergency switch, and keep an eye on the robot.'''
# Unplug Jazz from the power supply
# Unplug Pico from the power supply
# Run your software
# Run your software
# '''NB if Pico is not driving:
## Press and release the emergency button to make sure it's off
## Check your topics: <pre>rostopic echo /pico/cmd_vel</pre> should output the commands you send to PICO
= Record Sensor Data =
You can use the tool ''rosbag'' to record a topic:


# Open a terminal
# ssh to the PICO laptop:<pre>sshpicolaptop</pre>
# To record a topic, use:<pre>rosbag record TOPIC_NAME</pre>For example:<pre>rosbag record /pico/laser</pre>This will start listening to the topic, and put all messages in a so-called ''bag-file''. This file can be found in the directory you ran your command in (with extension ''.bag'')


<!--
To debug and develop:
To debug and develop:


* You can use ''Rviz'' to visualize the laser data, camera images, etc.
* You can use ''Rviz'' to visualize the laser data, camera images, etc.
* It may be useful to record topics such that you can play and analyse them off-line, so be sure to check out the ''rosbag'' command on the ROS wiki.
* Eclipse is installed on the laptop and you are free to use it to improve / debug your package(s).
* Eclipse is installed on the laptop and you are free to use it to improve / debug your package(s).
 
* It may be useful to record topics such that you can play and analyse them off-line, so be sure to check out the ''rosbag'' command on the ROS wiki. You may encounter problems when replaying the data due to time differences between the recorded topics and current time. To also simulate the ROS time (setting it to the time of recording), set the ROS parameter ''use_sim_time'' to true:<pre>rosparam set use_sim_time true</pre>Furthermore when playing the data, make sure rosbag outputs the time of recording using the ''--clock'' option:<pre> rosbag play <BAG FILE> --clock</pre>
-->
= Clean-up =
= Clean-up =


When you stop testing:
When you stop testing:


# Switch off Jazz (simply use the switch at the back)
# Switch off Pico (simply use the switch at the back)
# Put Jazz back at the table
# Put Pico back at the table
# Plug in the the power supply
# Plug in the the power supply
# Remove your package from the laptop:<pre>cd ~/ros/emc/groups</pre><pre>rm emc<GROUP_NUMBER> -rf</pre>
# Remove your package from the laptop:<pre>cd ~/ros/emc/groups</pre><pre>rm emc<GROUP_NUMBER> -rf</pre>
# Switch off the laptop
# Switch off the laptop
# Lock the test area, and hand the key to one of the students in the lab
# Put Pico back in the robotics test area, lock it, and hand the key to one of the students in the lab

Latest revision as of 16:02, 18 September 2013

IMPORTANT

Make sure to ALWAYS obey the following rules:

  • If PICO is not connected to the power supply, always hold the emergency switch (Tyro remote) and keep an eye on the robot. If you only have the slightest idea that something may go wrong, press the red button. You can release the emergency switch by turning the red button clockwise.
  • If PICO is not driving around, always:
    • Plug in PICO's power supply. The batteries only last about 3.5 hours and we need at least 5 test hours per day.
    • Plug then laptop's power supply
  • Fill in the log book! Make sure you at least write down your name, what you tested and if any problems occured during testing.


You should test on the MSL soccer field. Pico will be in the robotics test area (the room opposite of the MSL socces field). You can get the key by asking one of the students in the robotics lab.

Setting up your software

Your software runs on PICO's laptop. The computer inside PICO is connected to this laptop through a dedicated wired network. You will use an external laptop (dev-laptop) to connect to the PICO laptop through the wireless RoboEarth network. To get your software up and running, on the dev-laptop:

  • Connect to the RoboEarth network (see the network icon in the upper-right corner).
  • Open a terminal, and type sshpicolaptop, to connect to PICO's laptop via SSH.
  • cd to ~/ros/emc/groups/emc<your_group_number>
  • Do an svn up. You will be prompted for your group's account name and password.
  • Build your package(s)
    • If you get a cmake error that your paths are incorrect, it might be the case that you also checked in the (auto-generated) build files (i.e., the build folder in the package). Then you should:
      • Build with the --pre-clean flag:
        rosmake --pre-clean
        , and
      • Remove the build folder from the SVN!

Following your software from the dev-laptop

  • Connect to the RoboEarth network (see the network icon in the upper-right corner).
  • If you use your own visualisation:
    • Open a terminal, and cd to ~/ros/emc/groups/emc<your_group_number>
    • Do an svn up. You will be prompted for your group's account name and password.
    • Build your package(s)
  • If you use Rviz:
    • Open a terminal and run rviz

If you do not use the SVN

  • Please start doing so! It is so useful once you are used to it (for managing your project, tracking changes, working on different computers, etc...), and setting up your software on the laptop will be a piece of cake!
  • You will have to transfer your package to the laptop in another way, e.g. using webmail or a USB stick. When you do, make sure to put your package in the ~/ros/emc/groups folder.

Test

  1. Switch on the robot (use the switch on its back). It is ready to use once you see its 'eyes' on the display.
  2. On the dev-laptop (so not the laptop on PICO's back), run sshpicolaptop
  3. Run pstart
  4. Test whether you have a working connection with PICO:
    • Open a terminal and run sshpicolaptop
    • rostopic list
      should give an overview of Pico's ROS topics
    • rostopic echo /pico/odom
      should output Pico's odometry information
  5. Hold the emergency switch, and keep an eye on the robot.
  6. Unplug Pico from the power supply
  7. Run your software
  8. NB if Pico is not driving:
    1. Press and release the emergency button to make sure it's off
    2. Check your topics:
      rostopic echo /pico/cmd_vel
      should output the commands you send to PICO

Record Sensor Data

You can use the tool rosbag to record a topic:

  1. Open a terminal
  2. ssh to the PICO laptop:
    sshpicolaptop
  3. To record a topic, use:
    rosbag record TOPIC_NAME
    For example:
    rosbag record /pico/laser
    This will start listening to the topic, and put all messages in a so-called bag-file. This file can be found in the directory you ran your command in (with extension .bag)

Clean-up

When you stop testing:

  1. Switch off Pico (simply use the switch at the back)
  2. Put Pico back at the table
  3. Plug in the the power supply
  4. Remove your package from the laptop:
    cd ~/ros/emc/groups
    rm emc<GROUP_NUMBER> -rf
  5. Switch off the laptop
  6. Put Pico back in the robotics test area, lock it, and hand the key to one of the students in the lab