This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
projects:surface_classifier [2011/12/22 19:31] – humalvarez | projects:surface_classifier [2012/07/17 14:53] (current) – humalvarez | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== fingerpub and surfaceClassifier ===== | ||
+ | |||
+ | In order to do surface classification these two nodes should be running. Start the fingerpub node (./ | ||
+ | |||
+ | **fingerpub** | ||
+ | |||
+ | **surfaceClassifier** | ||
+ | |||
+ | ==== Command list ==== | ||
+ | |||
+ | You can send commands to the **surfaceClassifier** using the following instruction: | ||
+ | |||
+ | < | ||
+ | rostopic pub -1 / | ||
+ | rostopic pub -1 / | ||
+ | </ | ||
+ | |||
+ | This is the list of commands that you can send: | ||
+ | |||
+ | ^ Command ^ Function ^ | ||
+ | | normal | Sets normal mode, this means no image is sent in the adns message and data from all connected sensors is sent. This mode is used for other purposes but not for surface recognition. | | ||
+ | | frame0 | Chooses sensor 0 as active sensor. The fingerpub node will send adns messages (including images) belonging only to this sensor. If sensor is not connected a message will be displayed. When adding a class to the model or predicting, the selected sensor can be changed "on the fly", before stoptraining or stoppredict. | | ||
+ | | frame1 | Same as frame0 but selects sensor 1. | | ||
+ | | frame2 | Same as frame0 but selects sensor 2. | | ||
+ | | frame3 | Same as frame0 but selects sensor 3. | | ||
+ | | addclass: | ||
+ | | removeclass: | ||
+ | | listclasses | List the classes in the current loaded model. | | ||
+ | | clearmodel | Clears all the classes in the current loaded model. The model file is not affected if you don't savemodel. | | ||
+ | | stoptraining | To stop adding frames to a class. | | ||
+ | | pausetraining | To pause adding frames to a class. | | ||
+ | | resumetraining | To resume adding frames to a class. | | ||
+ | | buildsvm | To build the SVM (Support Vector Machine). A model must be created or loaded first. | | ||
+ | | predict | To start recognizing surfaces. An SVM must be built first. The recognized surfaces are published in the // | ||
+ | | stoppredict | To stop prediction (surface recognition) and stop publishing the recognized surfaces. | | ||
+ | | savemodel | Saves changes made to the current loaded model permanently into the model file for later use. IMPORTANT: it always writes to // | ||
+ | | loadmodel | It adds classes in // | ||
+ | |||
+ | ==== command sequence example ==== | ||
+ | |||
+ | Assuming sensor 0 is connected. | ||
+ | |||
+ | < | ||
+ | rostopic pub -1 / | ||
+ | |||
+ | rostopic pub -1 / | ||
+ | rostopic pub -1 / | ||
+ | |||
+ | rostopic pub -1 / | ||
+ | rostopic pub -1 / | ||
+ | |||
+ | rostopic pub -1 / | ||
+ | rostopic pub -1 / | ||
+ | rostopic pub -1 / | ||
+ | rostopic pub -1 / | ||
+ | |||
+ | rostopic pub -1 / | ||
+ | |||
+ | rostopic pub -1 / | ||
+ | rostopic pub -1 / | ||
+ | </ | ||
+ | |||
+ | If you want to save the model for a later time then | ||
+ | |||
+ | < | ||
+ | |||
+ | To use the saved model at a later time, load it, build the svm, choose a sensor that is connected and then start predicting or editing the model. For example: | ||
+ | |||
+ | < | ||
+ | rostopic pub -1 / | ||
+ | rostopic pub -1 / | ||
+ | rostopic pub -1 / | ||
+ | rostopic pub -1 / | ||
+ | rostopic pub -1 / | ||
+ | </ | ||
+ | |||
+ | ==== Viewing sensor images ==== | ||
+ | |||
+ | < | ||
+ | rosrun image_view image_view image: | ||
+ | </ | ||
+ | |||
+ | Where <X> is the sensor you want to see (0-3). | ||