Skip to content

Running CarSimulator on WSL (Windows Subsystem for Linux)

Tobias Jaehnel edited this page Feb 3, 2022 · 2 revisions

In case your main workstation is a Windows machine, you can run the CarSimulator in WSL.

To install WSL, see this documentation: https://docs.microsoft.com/en-us/windows/wsl/install

CarSimulator was tested on WSL2 using Ubuntu 20.04

Install SocketCAN drivers

This is the hard part. Since the default Ubuntu Kernel does not have SocketCAN supported compiled in, you need to recompile the kernel.

tbd.

Compile CarSimulator

Compiling CarSimulator works in more or less the same way as on RaspberryPi.

Install necessary packages

# sudo apt-get install git build-essential lua5.2 liblua5.2-0 liblua5.2-dev libsocketcan-dev`

Get CarSimulator sources and build

# git clone https://github.com/AVL-DiTEST-DiagDev/car-simulator.git`
# cd car-simulator`
# make`

Run CarSimulator

While still in the CarSimulator directory create a directory 'lua_configs'

# mkdir lua_configs

and put your simulation files there. For example the one from the example directory

# cp example\ luas/example.lua lua_configs

Finally start the CarSimulator:

# ./dist/Debug/GNU-Linux/amos-ss17-proj4 vcan0

Test if the setup is working

Open two additional wsl console windows. One to Send and one to receive. Execute the following commands respectively.

First the receive part:

# isotprecv -s 7e0 -d 7e8 vcan0

In the second window send a message:

# isotpsend -s 7e0 -d 7e8 vcan0
01 46

You should now receive a response in the other window and see some log messages from the CarSimulator.

Clone this wiki locally