Skip to content

Commit

Permalink
Updated instructions: pkill demo and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
abatula committed Mar 20, 2014
1 parent 5659f91 commit 643b00d
Showing 1 changed file with 28 additions and 13 deletions.
41 changes: 28 additions & 13 deletions README.md
@@ -1,5 +1,5 @@
MotionController
================
======

Class for high-level control of the DARwIn-OP using the action editor/motion manager.

Expand All @@ -8,7 +8,7 @@ This code belongs in a subfolder of /darwin/Linux/project/MotionController on th
If you have permissions errors (either running in C++ or Python) you may need to run it with sudo for admin privileges.

System Requirements
-------------------
================
C++ Only
* None

Expand All @@ -19,35 +19,46 @@ Python wrapper
Note that at this time, DARwIn comes with Ubuntu and uses Python2 by default. So all dependencies refer to Python2-compatible versions where applicable.

Installation
------------
================
C++
------
To compile, run 'make' in the MotionController folder.

To test the installation, first kill the demo script that runs at startup:

$ pkill demo

###C++###
To compile, run 'make' in the MotionController folder. Then run the example code with:
then run the example code with:

./MotionController
$ ./MotionController

or, if you need admin privelidges:

sudo ./MotionController
$ sudo ./MotionController

Modify main.cpp to run your own program to control DARwIn.

###Python###
Python
------
To compile/install locally, run:

python setup.py build_ext --inplace
$ python setup.py build_ext --inplace

or to install system-wide:

python setup.py build_ext
$ python setup.py build_ext

To test the installation, run the main.py script:
To test the installation, first kill the demo script that runs at startup:

python main.py
$ pkill demo

Then run the main.py script:

$ python main.py

or

sudo python main.py
$ sudo python main.py

Modify the main.py file, or write your own to control DARwIn from Python. Just import MotionController and initialize a controller:

Expand All @@ -57,3 +68,7 @@ Modify the main.py file, or write your own to control DARwIn from Python. Just i
Then use the methods in the controller object to control the robot.

It should be relatively easy to update this code for Python3 if you choose to install it on your robot, or if future versions come with Python3 out-of-the-box.

Notes
================
If you do not kill the demo program using before running this script, it may cause segmentation faults. DARwIn's MotionManager (which is used by the MotionController class) is a [singleton](http://en.wikipedia.org/wiki/Singleton_pattern) and does not deal well with two programs trying to use it at once.

0 comments on commit 643b00d

Please sign in to comment.