<commit_before>CANaerospace Controller for OpenGrab
============

CANaerospace controller for [OpenGrab - electro-permanent cargo holding magnet][1].

Based on [libcanaerospace][2] - open-source CANaerospace protocol implementation.

## CANaerospace Interface
The set of CANaerospace messages used by this node is documented below. Note that the message IDs can be reconfigured.

#### Input parameters
###### CANAS_UAV_GRIPPER_GRIP_COMMAND
- ID: 1820
- Type: CHAR
- Values:
    - 0 - turn the magnet off
    - 1+ - activate the magnet

#### Output parameters
###### CANAS_UAV_GRIPPER_GRIP_STATE
- ID: 1821
- Type: CHAR
- Values:
    - 0 - magnet OFF
    - 1+ - magnet ON
- Transmission rate: 1 Hz

## Getting Hardware
Coming late 2013.
Schematics and Gerber files are available in this repository; hardware design files are available upon request.

## Building Firmware
The firmware can be built with ARM GCC or any other GCC-based ARM toolchain.

1. Place the [libcanaerospace][2] sources into the same directory with this repository.
2. Build:

```shell
cd opengrab_can/firmware
make RELEASE=1
```
3. Flash.

## Setup
Use CLI via the TTL UART connector at 115200-8-N-1. Note that CLI will not be available unless the RX pin was pulled up at startup; that means that the UART cable must be connected before power-up.

Execute `help` to get a short command reference.

## Test
Clone and install the [pycanbus][3] library. This is the Python module that enables access to the CAN network.

Use script from the `tools/` directory to switch the magnet or read it's state:
```shell
cd opengrab_can/tools
./canas_control.py <can-iface>       # Simply prints all incoming CAN frames
./canas_control.py <can-iface> <0/1> # Sends the CANaerospace message to turn the magnet OFF/ON
```
[1]: https://code.google.com/p/opengrab/
[2]: https://bitbucket.org/pavel_kirienko/canaerospace
[3]: https://bitbucket.org/pavel_kirienko/pycanbus<commit_msg>Markdown fix<commit_after>CANaerospace Controller for OpenGrab
============

CANaerospace controller for [OpenGrab - electro-permanent cargo holding magnet][1].

Based on [libcanaerospace][2] - open-source CANaerospace protocol implementation.

## CANaerospace Interface
The set of CANaerospace messages used by this node is documented below. Note that the message IDs can be reconfigured.

#### Input parameters
###### CANAS_UAV_GRIPPER_GRIP_COMMAND
- ID: 1820
- Type: CHAR
- Values:
    - 0 - turn the magnet off
    - 1+ - activate the magnet

#### Output parameters
###### CANAS_UAV_GRIPPER_GRIP_STATE
- ID: 1821
- Type: CHAR
- Values:
    - 0 - magnet OFF
    - 1+ - magnet ON
- Transmission rate: 1 Hz

## Getting Hardware
Coming late 2013.

Schematics and Gerber files are available in this repository; hardware design files are available upon request.

## Building Firmware
The firmware can be built with ARM GCC or any other GCC-based ARM toolchain.

- Place the [libcanaerospace][2] sources into the same directory with this repository.
- Build:

```shell
cd opengrab_can/firmware
make RELEASE=1
```
- Flash.

## Setup
Use CLI via the TTL UART connector at 115200-8-N-1. Note that CLI will not be available unless the RX pin was pulled up at startup; that means that the UART cable must be connected before power-up.

Execute `help` to get a short command reference.

## Test
Clone and install the [pycanbus][3] library. This is the Python module that enables access to the CAN network.

Use script from the `tools/` directory to switch the magnet or read it's state:
```shell
cd opengrab_can/tools
./canas_control.py <can-iface>       # Simply prints all incoming CAN frames
./canas_control.py <can-iface> <0/1> # Sends the CANaerospace message to turn the magnet OFF/ON
```
[1]: https://code.google.com/p/opengrab/
[2]: https://bitbucket.org/pavel_kirienko/canaerospace
[3]: https://bitbucket.org/pavel_kirienko/pycanbus
{'fraction_non_alphanumeric': 0.09464701318851823, 'fraction_numerical': 0.018877682958365657, 'mean_word_length': 4.1096433289299865, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6085519', 'n_tokens_mistral': 1251, 'n_tokens_neox': 1170, 'n_words': 479}