The VehicleIO sample demonstrates how to read and write the state of the vehicle actuators (i.e. throttle, brake, steering, etc.) It can talk to different vehicle control systems, one of which is Dataspeed. The VehicleIO module abstracts the underlying physical protocols and connections. The internal "driver layer" handles the protocol interface and the VehicleIO module handles the state.
The VehicleIO sample has been tested with CAN-based Dataspeed vehicle control system and validated with Ford MKZ and Ford Fusion vehicles. To send the steering, brake or throttle commands, use a keyboard or a USB joystick (tested with Logitech Gamepad F310).
The VehicleIO sample can run with the Dataspeed drive-by-wire (DbW) systems. It can also run with a generic NVIDIA DbW driver. The AutonomousVehicleCANSignals.dbc
DBC file describes the CAN commands for that driver.
If you run the vehicleIO sample with the generic driver, you must also run the DataspeedBridge utility. That utility converts the CAN messages and commands to/from DbW systems to a generic type.
The command line for the sample is:
./sample_vehicleio [--rig=path/to/rig/file] [--allow-no-safety=[no|yes]]
where
--rig=[path/to/rig/file] Points to the rig file. Default value: path/to/data/samples/samples/vehicleio/rig.json --allow-no-safety=[no|yes] Set to 'yes' to allow issuing actuation commands without software-imposed limits. Default value: no
While the sample is running, the following commands are available:
To use with the pre-recorded CAN data, which is provided with the sample, run the sample without any arguments:
./sample_vehicleio
To use a custom pre-recorded CAN data or to run live, one should provide a custom rig file and use --rig
argument:
./sample_vehicleio --rig=rig.json
One can use the provided (default) rig.json file as a template (exact location of that file can be found using ./sample_vehicleio --help
.)
Before you can run the sample with a generic driver, you must run the utility DataspeedBridge. This sample converts the messages from Dataspeed to a generic type and vice-versa.
You can use the CAN0 interface in a vehicle equipped with the Dataspeed DbW system. With that setup, you can use the generic vehicleIO driver directly in a CAR, where the Dataspeed system is connected to CAN0.
The following steps assume your DbW system is connected to CAN0.
After running the dataspeedBridge, run the vehicleio sample with a Rig Configuration that has only generic VehicleIO node:
Then run the sample with this new rig.json file:
./sample_vehicleio --rig=rig.json
If you want to use the generic vehicleio driver in a bench setup, you can use the VCAN interface.
sudo modprobe vcan sudo ip link add dev vcan0 type vcan sudo ip link set up vcan0
while true; do cat candump_dataspeed.log | canplayer -l i vcan0=can0; done
sample_dataspeedBridge
to convert Dataspeed messages to generic vehicleio messages (refer to Dataspeed Bridge Sample for details)../sample_vehicleio --rig=rig.json
The sample opens a window to display the various vehicle control parameters, such as throttle, braking, and steering. Once the window is in the focus, the throttle, brakes, steering of the vehicle can be controlled via a keyboard or a USB joystick, as described above.
The sample prints the basic vehicle state information to the terminal.
For more information, see VehicleIO .