wiki:Projects/LabRPXLR2017/CLIPS-Executive-Hands-On
Last modified 20 months ago Last modified on 12/15/17 11:20:20

The goal of today is to visit all machines of your team.

First, familiarize yourself with the CLIPS Executive code. The files are in two directories:

  • The generic clips-executive implementation is in fawkes/src/plugins/clips-executive/clips.
  • The domain-specific files (the visitall scenario and the test scenario) are in src/clips-specs.

To run the simulation, do the following:

  1. Run the simulation, but without agent:
    ./gazsim.bash -x start -r -k -n 1 -t
    
  2. Go to the refbox, run setup, then switch to production
  3. Load the CLIPS executive:
    ./ffplugin -r localhost:1921 -l gazsim-meta-clips-exec
    
    You should see the robot moving to one of the machines.
  4. Modify the code so it drives to all machines. Do this step by step, i.e., first add one more machine.
  5. Optimize your approach so the driven path is minimal. Note that the positions of the machines is randomly generated during the setup phase, so you cannot hard-code an order.

Hints

  • To run rviz to visualize additional information about the robot, run:
    ROS_MASTER_URI=http://localhost:11321 rosrun rviz rviz 
    
  • Check the CLIPS web interface http://localhost:8081/clips to see the current working memory. You can also assert and retract facts in the web interface.
  • The web interface on http://localhost:8081 generally provides useful information.
  • To find a short path, check the web interface for navgraph facts. Also have a look at ./fawkes/src/plugins/clips-navgraph/clips/navgraph.clp for useful CLIPS functions.
  • Make sure that in both repositories (fawkes-robotino and the submodule in fawkes), you are using the latest current-labrpxlr branch
  • You can reload just the CLIPS executive with ./ffplugin -r localhost:1921 -R clips-executive. This will restart the CLIPS executive and reset its working memory, so the agent will start from the beginning again. It appears that there is a race condition that may cause the reloading to fail in some cases. In that case, you will need to restart the simulation.
  • If you have problems starting the simulation (Gazebo GUI does not finish loading), run the startup script with the additional option -l, e.g.,
    ./gazsim.bash -x start -r -k -n 1 -t -l
    
    Then, run the GUI separately:
    gzclient