The purpose of this Python 3 program is to provide basic validation that the vehicle and OSCC are in a good state and are able to communicate as expected. Ideally it's a method to quickly verify whether your vehicle is in a good state. By sending control commands on the CAN gateway then polling for an expected result there, we should be able to tell whether OSCC is functioning properly or diagnose any issues more readily.
While this program was designed to be run as a stand alone executable it may be imported as a module should a use-case arise.
Prerequisites for success:
- A vehicle with OSCC installed
- That vehicle powered on (motor on)
- OSCC powered
- A socketcan connection to OSCC's CAN bus from your computer
But what does it do?
- Enable each OSCC module (brake, steering, throttle).
- Send commands to increase and decrease brake pressure.
- Verify that brake pressure reported by vehicle increased or decreased accordingly.
- Send commands to apply positive or negative torque to steering wheel.
- Verify that the steering wheel angle increased or decreased accordingly.
- Disable each OSCC module.
Works with OSCC v1.2.1
and up.
python3
(sudo apt install python3
)
python3
(https://www.python.org/downloads/windows/)- CAN driver (Kvaser, PCAN, etc.)
Install this package's dependencies with the following command:
python3 setup.py install --user
oscc-check.py (-V <vehicle>) [-hdelv] [-b <bustype>] [-c <channel>]
Options:
-h --help Display this information
-V <vehicle>, --vehicle <vehicle> Specify your vehicle. Required.
(kia_soul_ev / kia_soul_petrol / kia_niro)
-d --disable Disable modules only, no further checks (overrides enable)
-e --enable Enable modules only, no further checks
-l --loop Repeat all checks, run continuously
-b --bustype <bustype> CAN bus type [default: socketcan_native]
(for more see https://python-can.readthedocs.io/en/2.1.0/interfaces.html)
-c <channel>, --channel <channel> Specify CAN channel, [default: can0]
-v --version Display version information
On a Linux system socketcan
is a default so the oscc-check.py
can rely on the default settings
for bustype
and channel
. After initializing the socketcan interface with:
sudo ip link set can0 type can bitrate 500000
sudo ip link set up can0
you can run:
# Default Linux usage for Kia Soul EV
python3 oscc-check.py -V kia_soul_ev
On a Windows system socketcan
is not available so the bustype
and channel
must be specified.
If you've installed the Kvaser SDK you need to run:
# Default Kvaser CANlib usage for Kia Soul Petrol
python oscc-check.py -c 0 -b kvaser -V kia_soul_petrol
Using PCAN drivers you can run:
# Default PEAK PCAN-USB usage for Kia Niro
python oscc-check.py -c PCAN_USBBUS1 -b pcan -V kia_niro
python3 setup.py test
© 2018, PolySync Technologies, Inc., Shea Newton snewton@polysync.io