fix doc formatting

This commit is contained in:
Samuel Sadok
2017-11-13 23:26:12 +01:00
parent f881f60207
commit e982eb4bd9
2 changed files with 12 additions and 13 deletions
+1 -1
View File
@@ -147,7 +147,7 @@ pip install pyusb pyserial prompt_toolkit
* If 'Odrive V3.x' is not in the list of devices upon opening Zadig check 'List All Devices' from the options menu. Connecting to the Odrive board directly and not over a usb hub may also help. With the Odrive selected in the device list choose 'libusb-win32' from the target driver list and select the large 'install driver' button.
7. Run `./tools/demo.py` or `./tools/explore_odrive.py`.
- `demo.py` is a very simple script which will make motor 0 turn back and forth. Take a look at the code if you want to control the ODrive yourself programatically.
- `explore_odrive.py` drops you into an interactive python shell where you can explore and edit the parameters that are available on your device. For instance `my_odrive.motor0.pos_setpoint = 10000` makes motor0 move to position 10000. To connect over serial instead of USB run `./tools/explore_odrive.py --discover usb`.
- `explore_odrive.py` drops you into an interactive python shell where you can explore and edit the parameters that are available on your device. For instance `my_odrive.motor0.pos_setpoint = 10000` makes motor0 move to position 10000. To connect over serial instead of USB run `./tools/explore_odrive.py --discover serial`.
### From Arduino
+11 -12
View File
@@ -34,26 +34,25 @@ Each request-response transaction corresponds to a single endpoint operation.
__Request__
- __Bytes 0, 1__ Sequence number, MSB = 0
Currently the server does not care about ordering and does not filter resent messages.
- Currently the server does not care about ordering and does not filter resent messages.
- __Bytes 2, 3__ Endpoint ID
The IDs of all endpoints can be obtained from the JSON definition. The JSON definition can be obtained by reading from endpoint 0.
- The IDs of all endpoints can be obtained from the JSON definition. The JSON definition can be obtained by reading from endpoint 0.
If (and only if) the MSB is set to 1 the client expects a response for this request.
- __Bytes 4, 5__ Expected response size
The number of bytes that should be returned to the client. If the client doesn't need any response data, it can set this value to 0. The operation will still be acknowledged if the
- The number of bytes that should be returned to the client. If the client doesn't need any response data, it can set this value to 0. The operation will still be acknowledged if the
MSB in EndpointID is set.
- __Bytes 6 to N-3__ Payload
The length of the payload is determined by the total packet size. The format of the payload depends on the endpoint type. The endpoint type can be obtained from the JSON definition.
- The length of the payload is determined by the total packet size. The format of the payload depends on the endpoint type. The endpoint type can be obtained from the JSON definition.
- __Bytes N-2, N-1__
For endpoint 0: Protocol version (currently 1). A server shall ignore packets with other
values.
For all other endpoints: The CRC16 calculated over the JSON definition. The CRC16 init value is the protocol version (currently 1). A server shall ignore packets that set this field incorrectly. See protocol.hpp for CRC details.
- For endpoint 0: Protocol version (currently 1). A server shall ignore packets with other values.
- For all other endpoints: The CRC16 calculated over the JSON definition. The CRC16 init value is the protocol version (currently 1). A server shall ignore packets that set this field incorrectly. See protocol.hpp for CRC details.
__Response__
- __Bytes 0, 1__ Sequence number, MSB = 1
The sequence number of the request to which this is the response.
- The sequence number of the request to which this is the response.
- __Bytes 2, 3__ Payload
The length of the payload tends to be equal to the number of expected bytes as indicated
- The length of the payload tends to be equal to the number of expected bytes as indicated
in the request. The server must not expect the client to accept more bytes than it requested.
## Stream format ##
@@ -61,9 +60,9 @@ The stream based format is just a wrapper for the packet format.
- __Byte 0__ Sync byte `0xAA`
- __Bytes 1, 2__ Packet length
Currently both parties shall only emit and accept values of 0 through 127.
- Currently both parties shall only emit and accept values of 0 through 127.
- __Bytes 3__ CRC8 of bytes 0 through 2
See protocol.hpp for CRC details.
- See protocol.hpp for CRC details.
- __Bytes 4 to N-3__ Packet
- __Bytes N-2, N-1__ CRC16
See protocol.hpp for CRC details.
- See protocol.hpp for CRC details.