Skip to content

Commit

Permalink
refactor documentation: compatible with markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
ssardina committed Jun 4, 2024
1 parent 4225ebb commit 2ccfca3
Show file tree
Hide file tree
Showing 26 changed files with 285 additions and 475 deletions.
9 changes: 9 additions & 0 deletions Examples/GameExamples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Game Examples

This directory contains ERGO programs for game playing as described in Chapter 5 of the book. These games use BATs as usual, but no programming constructs. They call "`ergo-play-game`" instead of "`ergo-do`".

The directory contains the following:

- `ttt.scm`: The game of TicTacToe
- `pousse-main.scm`: The game of Pousse
- `pousse-bat.scm`: An auxiliary file for Pousse
10 changes: 0 additions & 10 deletions Examples/GameExamples/README.txt

This file was deleted.

22 changes: 22 additions & 0 deletions Examples/PlanningExamples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# PlanningExamples

This directory contains ERGO programs for planning as described first in Chapter 3 and then in a more general form in Chapter 12.

Instead of `ergo-do`, they call `ergo-simplan` for basic planning, and `ergo-genplan` or `ergo-gendo` for more advanced planning.

The directory contains the following:

- `farmer.scm`: Chapter 3 (`ergo-simplan`)
- `jealous-bat.scm`: Chapter 3
- `jealous-main.scm`:Chapter 3 (`ergo-simplan`)
- `3bars.scm`: Chapter 12 (`ergo-genplan`)
- `bars-bat.scm`: Chapter 12
- `hanoi.scm`: Chapter 12 (`ergo-genplan`)
- `red-blue-bat.scm`: Chapter 12
- `sort.scm`: Chapter 12 (`ergo-genplan`)
- `striped.scm`: Chapter 12 (`ergo-genplan`)
- `two-towers.scm`: Chapter 12 (`ergo-genplan`)
- `prog-12bars.scm`: Chapter 12 (`ergo-gendo`)
- `prog-hanoi.scm`: Chapter 12 (`ergo-gendo`)
- `prog-striped.scm`: Chapter 12 (`ergo-gendo`)
- `prog-two-towers.scm`: Chapter 12 (`ergo-gendo`)
22 changes: 0 additions & 22 deletions Examples/PlanningExamples/README.txt

This file was deleted.

20 changes: 20 additions & 0 deletions Examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Examples

This directory contains a number of small ERGO programs that appear as examples in the book mainly in Chapters 3, 4, 5, and 6, but also in Chapters 11 and 12.

The directory contains the following:

- `GameExamples/`: from Chapter 5
- `PlanningExamples/`: from Chapters 3 and 12
- `basic-elevator.scm`: Chapter 1 and 6
- `delivery-bot.scm`: Chapter 5
- `grocery-bat.scm`: Chapter 4
- `grocery-main.scm`:Chapter 4
- `house-bat.scm`: Chapter 3
- `lift-table.scm`: Chapter 5
- `reactive-elevator-bat.scm`: Chapter 6
- `reactive-elevator-run.scm`: Chapter 6
- `reactive-elevator-tcp1.scm`: Chapter 6
- `reactive-elevator-tcp2.scm`: Chapter 6
- `reactive-elevator-tcp3.scm`: Chapter 6
- `sonar-robot.scm`: Chapter 11
19 changes: 0 additions & 19 deletions Examples/README.txt

This file was deleted.

7 changes: 7 additions & 0 deletions Projects/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Projects

This directory contains subdirectories for three ERGO projects. It contains the following:

- `Squirrels/`: Files for the project in Chapter 7
- `LEGO/`: Files for the project in Chapter 8
- `Unity3D/`: Files for the project in Chapter 9
8 changes: 0 additions & 8 deletions Projects/README.txt

This file was deleted.

11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# ERGO

This is a distribution of software that comes with the book [Programming Cognitive Robots](http://www.cs.toronto.edu/~hector/pcr.html) by Hector Levesque. It comes with absolutely no guaranties
or support. Also, do read the copyright notice.
This is a distribution of software that comes with the book [Programming Cognitive Robots](http://www.cs.toronto.edu/~hector/pcr.html) by Hector Levesque. It comes with absolutely no guaranties or support. It was first released March 2018 (version 1.5, which conforms with the book).


This directory contains all the files and directions for running the ERGO
system as well as a number of ERGO programs. It contains the following:

* `README.txt`: This file
* `history.txt`: A list of updates and fixes to the software
* `ergo-sheet.pdf`: A one page summary of the ERGO system
* `install.txt`: Instructions on installing ERGO
* `System/`: All the system files
* `Examples/`: Some example ERGO programs
* `Projects/`: Three larger ERGO programs
Expand All @@ -23,6 +20,8 @@ This describes how to setup and run the ERGO system.

## INSTALL

This describes how to setup and run the ERGO system.

### INSTALLATION OF RACKET

See http://racket-lang.org/. You can test that things are working with
Expand All @@ -36,7 +35,7 @@ See http://racket-lang.org/. You can test that things are working with

1. First, put all the files in the `Ergo/System/` directory somewhere convenient, away from user ERGO programs. On a Mac, a reasonable choice is to create `~/Library/Application Support/Ergo/` and put them there.

2. Then find out where Racket keeps user-defined collections. It's the first element of "`(current-library-collection-paths)`".
2. Then find out where Racket keeps user-defined collections. It's the first element of "`(current-library-collection-paths)`".

In Mac:

Expand Down
19 changes: 0 additions & 19 deletions README.txt

This file was deleted.

39 changes: 39 additions & 0 deletions Servers/BasicElevator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# AN ELEVATOR SIMULATION IN RACKET

This is a very simple elevator simulation written in Racket Scheme (independent of ERGO). There is an elevator located on a certain floor with a number of call buttons illuminated. On input from the user, the elevator moves up and down and can extinguish call button lights. That's about it.

See Chapter 6 on how to control this simulation from ERGO.

This directory contains the following:

- `elevator-server.scm`: The entire Scheme program
- `ele.png`: A graphics file used by the simulation
- `red.jpeg`: A graphics file used by the simulation

To run the simulation, you need Racket Scheme <http://racket-lang.org/>. I used version 5.2. Other versions may work too. What follows are instructions for using the program under Linux. Using it with Windows or a Mac is similar.

Confirm that Racket is installed properly:

```shell
Linux%> racket -e '(+ 3 4)'
7
```

If this works, then start the elevator (called "`elevator-server.scm`") by typing something like this at the command-line:

```shell
Linux%> echo "((up 10) (down 6))" | racket -fm elevator-server.scm
```

This should start the simulation window. You should see the elevator inching its way up to floor 10, down to floor 6, and then quitting. You can also abort the session before the end by typing "q" in the server window.

The elevator simulation expects to read a single list of actions to perform on standard input. The actions are

- `(up n)`: go up to floor `n`
- `(down n)`: go down to floor `n`
- `(turnoff n)`: turnoff call button `n`

No error checking is done.



44 changes: 0 additions & 44 deletions Servers/BasicElevator/README.txt

This file was deleted.

15 changes: 15 additions & 0 deletions Servers/EV3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# EV3 LEGO RObot

This directory contains Python code that can used to create a server that will manage a LEGO robot on instructions from an ERGO program. It assumes that the EV3dev operating system has already been installed on a micro-SD card for the [EV3 Brick](https://www.lego.com/en-us/product/lego-mindstorms-ev3-31313) of the LEGO robot. See https://www.ev3dev.org/ for instructions.

The use of this code with ERGO is described in Chapter 8 of the book.

This directory contains the following:

- `misc/`: Code to test motors/sensors (no TCP)
- `ergo_communications.py`: Code to read/write over TCP
- `test_server.py`: Code to confirm working TCP
- `manager1.py`: Code to confirm motor/sensor TCP control
- `delivery_manager0.py`: Code for delivery robot of Chapter 8

All these files should be copied to the EV3 Brick for execution there.
16 changes: 0 additions & 16 deletions Servers/EV3/README.txt

This file was deleted.

16 changes: 16 additions & 0 deletions Servers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Servers

Servers are programs that an ERGO program can interact with over TCP when it is run online. The idea is that ERGO produces endogenous actions as it running which a server will consume and do something reasonable with. Also, the server may produce its own exogenous actions which ERGO will consume and
do something reasonable with.

This directory contains the following:

- `generic-action-server.scm`: Code for building Scheme-based servers
- `sonar-robot-server.scm`: A simple robot server for Chapter 11
- `BasicElevator/`: An online elevator server for Chapter 6
- `Squirrels/`: A simulated world for Chapter 7
- `EV3/`: A LEGO robot server for Chapter 8
- `Unity3D/`: A Unity robot server for Chapter 9

Each subdirectory will contain its own explanatory README file.

18 changes: 0 additions & 18 deletions Servers/README.txt

This file was deleted.

Loading

0 comments on commit 2ccfca3

Please sign in to comment.