How to Use Vehicle Data to AGL

10/18/2017
Yuichi Kusakabe
SS Engineering Group
FUJITSU TEN LIMITED
Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

1About Myself
 Yuichi Kusakabe (FUJITSU TEN LIMITED) Software Engineer of IVI about 10 years(for 16-bit and 32-bit architecture) Linux Software Engineer(2011-2013)
 Linux Software Lead Engineer(2013-Now)
 BSP Porting/Customizing Supporting for in-house software developers
 AGL(Automotive Grade Linux) Advisory Board member

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

2

AgendaWhat’s current problem
Standard Linux CAN IF & OSS CAN Tool

How to use Vehicle Data to AGL
Support Hardware and Demonstration details
Conclusion

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

3

What’s current problems

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

4

What is current problems
On differences from actual products related to Vehicle data(include kaizen)
 Apps side Apps is depend vehicle Low level HW IF
 Apps is depend Low level CAN data format
 Apps is depend destination requirement->Shall be all vehicle data change to AGL public data provide to Apps
 MW side MW need to very high cycle vehicle data received
 MW need to support OEM private confidential data MW need to protect OEM private confidential data MW need to support many vehicle HW IF
 MW need to vehicle data cache MW need to easy removable vehicle HW IF
 Data Center side
 Data Center need to real time vehicle data.
 Data Center need to sync vehicle data when vehicle change offline to online.

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

5

Vehicle data Requirement
Shall be Support AGL public data
Shall be Support OEM private data

Shall be Support over 100 data/sec
Shall be access control to OEM confidential data
Shall be able toread/write/list/subscribe IF

Shall be Support data cache

Shall be able to removable
Shall be Support MRAA

Shall be Support All Vehicle IF
Shall be Support data Filtering/Thinning out

Shall be able to Exclude OEM
confidential data

Shall be Support read/write IF

Shall be Support over 1000 data/sec

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

6

Example Use Cases 1Provide to same event to Apps from different low level vehicle data.
OEM A

OEM B
Input mng
AGL public data(json)(iDrive event)

Input mng
same event
Shall be able to Exclude OEM
confidential data

LVDA[afb-daemon]
Vehicle data cachejson

CAN signal

Renesas R-CAR M3 + KF[1]can0

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

LVDA[afb-daemon]
Vehicle data cache

AGL format

CAN convert

AGL public data(json)(iDrive event)Different data

AGL format

OEM convert

json

OEM orignal signal

Renesas R-CAR M3 + KF[1]OEM0Example Use Cases 2
Apps not depend destination requirement(For example Driver Distraction)
Destination A

Apps

VehicleData

DriverDistraction

10km/h <= Speed

ON

Speed < 10km/h

OFFApps
Change destination logic

AGL public data(Driver Distraction)

HVDA(High level Vehicle Data Agent)
AGL public data(VehicleSpeed & ParkingBrake)

LVDA[afb-daemon]
Vehicle data cachejson

Renesas R-CAR M3 + KF[1]Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

DriverDistraction

10km/h <= Speed

ParkingBrake=OFFON

Speed < 10km/h

ParkingBrake=ON

OFF

HVDA(High level Vehicle Data Agent)
AGL public data(VehicleSpeed & ParkingBrake)

LVDA[afb-daemon]

CAN signal

can0VehicleData

AGL public data(Driver Distraction)

Vehicle data cache

AGL format

CAN convert

Destination B VehicleData

AGL format

CAN convert

json

CAN signal

Renesas R-CAR M3 + KF[1]can08

Standard Linux CAN IF& OSS CAN Tool

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

9What’s CAR CAN Signal
Standard CAN Signal is Low Speed(500kbps), But High frequency(**us).

Standard CAN Signal format(11bit).
Data line: D+/D-/GND(want)Baud rate: 500kbps
CAN ID: 11bit(0x000~0x7FF)
Data size: 0~8byte
CAN Bus load: 20~75%

https://ja.wikipedia.org/wiki/Controller_Area_Network
Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

10

Standard Linux CAN IF(SocketCAN)
Linux kernel all ready CAN IF with Socket CAN

https://en.wikipedia.org/wiki/SocketCAN
Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

11

Standard Linux CAN IF(CAN Driver)Linux kernel all ready CAN IF with Socket CAN

https://www.kernel.org/doc/Documentation/networking/can.txt
Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

12

CAN key technology
CAN ID Filtering and CAN DATA Thinning out is very important

CAN signal filtering(setting SocketCAN)
CAN ID xxx -> xx
CAN signal thinning out
CAN cycle xx ms -> xxx ms
CAN DATA
10ms → 100ms
CAN DATACAN Sample Appthinning

SocketCAN

filtering200->100 data/sec
CAN

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

13

OSS CAN Tool(Powerful software)
can-utils easy to debug CAN Signal (read/write/play)

https://github.com/linux-can/can-utils
Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

14

OSS CAN Tool(Powerful software)
CAN data send(cansend)
ID=333(11bit), DATA=33 send=can0# cansend can0 333#33
ID=00004444(24bit), DATA=44 send=can0# cansend can0 00004444#44

CAN data recv(candump)
recv=can# candump can0 -ta
root@porter:~# candump can0 -ta(1478869757.430017) can0 344 [8] FF EE 00 00 00 00 EE AA(1478869757.431290) can0 226 [8] E4 00 00 EE 00 EE EE 00
recv=all# candump any -ta
https://github.com/linux-can/can-utils
Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

15

How to use Vehicle Data
to AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

16

Low level CAN service
Low level CAN service made to decode and write on CAN bus

https://gerrit.automotivelinux.org/gerrit/gitweb?p=apps/low-level-can-service.git;a=summary
Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

17

AGL CAN Sｏｆｔｗａｒｅ stack
AGL support easy to use CAN dataAGL CAN Sｏｆｔｗａｒｅ stack
Sample CAN Apps

AGL Simple CAN Simulator

can-utils/dev/input/js0

Sample CAN Apps

Low level CAN service(afb)slcan0

vcan0

can0

R-CAR M3
USB-HID

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

USB-SerialCAN

18

CAN and vehicle signaling workshop

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

https://wiki.automotivelinux.org/agl-distro/sep2017-can-f2f

19

AGL New Vehicle Data Sｏｆｔｗａｒｅ stack

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

https://github.com/iotbzh/afb-signal-composer

20

Public CAN protocol(OpenXC)

http://openxcplatform.com/
Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

21

Public CAN protocol(OpenXC)

19 CAN Data
https://github.com/openxc/openxc-message-format
Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

22

Public CAN protocol(FMS)

http://www.fms-standard.com/Truck/down_load/fms_document_ver03_vers_14_09_2012.pdf
Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

23

Public CAN protocol(FMS)

56 CAN Data(include Bus)
http://www.fms-standard.com/Truck/down_load/fms_document_ver03_vers_14_09_2012.pdf
Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

24

Define AGL Public Vehicle Data
Collaborate with the Reference Hardware System Architecture Expert GroupSample

AGL Public Vehicle Data
Reference tohttps://rawgit.com/w3c/automotive-bg/master/snapshots/data_spec_snapshot_latest.html
NoData label(Apps side)
1 VehicleSpeed
2 GearPosition
3 LightStatus
4 Seatbelt;
5 FuelInterface
6 EngineSpeedvalueunsigned shortunsigned char
unsigned shortunsigned shortunsigned shortunsigned long

AGL Reference IFCAN
CAN
CAN
CAN
CAN
CAN

ID
0x010
0x100
0x2000x300
0x4000x011

AGL Reference Data
LengthData
2 **,**
1 **2 **,**
2 **,**
2 **,**
4 **,**cycle(ms)16641002001,00016

Reference to w3c, OpenXC and FMS Vehicle data
Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

25

Hardware andDemonstration details

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

26

Target Hardware spec
AGL reference Hardware to Renesas R-CAR M3

http://elinux.org/R-Car/Boards/
Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

27

R-CAR Gen3 Expansion board

https://www.renesas.com/ja-jp/about/press-center/news/2017/news20170524.html
Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

28

Target Hardware spec
CANUSB easy connect CAN IF

http://www.can232.com/?page_id=16
Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

29

Target Hardware spec
CANUSB connected CAN IF simple Hardware

http://www.can232.com/?page_id=16
Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

30

Software setup
Add Kernel defconfig CAN driver and CANUSBCONFIG_CAN=yCONFIG_CAN_VCAN=yCONFIG_CAN_RCAR=y <- Renesas board only
CONFIG_CAN_SLCAN=yCONFIG_USB_SERIAL=yCONFIG_USB_SERIAL_FTDI_SIO=y

Add rootfs “can-utils” and “iproute2”
yocto local.conf
IMAGE_INSTALL_append = “ can-utils iproute2”

Setup CAN and CANUSB
CAN0
ip link set can0 type can bitrate 500000
ip link set can0 up
Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

CANUSBslcand -o -s 6 -t hw /dev/ttyUSB*
ip link set slcan0 up31

Software setup
Start Low level CAN service(afb-deamon)./afb-daemon --token=${AFB_CANIVI_TOKEN} --ldpaths=. |--port=${AFB_CANIVI_PORT}- |--rootdir=. ${SERVICE_VERBOSE}

Setting CAN data receive./afb-client-demo ws://localhost:5555/api?token=3210
low-can subscribe { "event" : "*" } <- receive all data
low-can subscribe { "event" : "VehicleSpeed" } <- receive Vehicle Speed only

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

32

AGL Vehicle CAN Demonstration
R-CAR M3 board running AGL CAN Simulator and Low level CAN service(afb)

CESDEMO CAN Apps

AGL Simple CAN Simulator

can-utils/dev/input/js0

Low level CAN service(afb)slcan0can0

Renesas R-CAR M3 + Kingfisher
USB-HIDCANUSBCAN
×：Accelerator□：Break
Right paddle：Gear UP
Left paddle：Gear DOWN

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

33

Performance measurement result
Data used for measurement
logtime = 1122 sec,
CAN ID cnt = 129, datacnt = 1042673
can load ave= 19.04%, min = 18.82%, max = 37.89%
cyc ave[us] = 929, min = 8, max = 8565
Support CAN ID 42, Thinning out time ** -> 100ms
AFB (websocket)
Process name CPU load(%)
Service

afb-daemon

1.34

Client(App)afb-clientdemo

0.82

CAN Sim

canplayer

1.51

Total

＊

3.67

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

34

Next step

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

35

[RFC]2018CES demo plan
AGL DATA Center
AGL public data(json)

New apps

AGL Vehicle Data Sｏｆｔｗａｒｅ stack

Input mng

Dashboard appsAGL public data(json)

HVDA(High level Vehicle Data Agent)
AGL public data(json)

AGL public data(json)(iDrive event)

HVAC apps

AGL public data(json)
OEM private data(json)

Signal Composer
Vehicle data cache

AGL format

AGL format

CAN convert
CAN signal

json

CAN convert

AGL format
json

CAN signal

LIN convertjson

LIN signal

Renesas R-CAR M3 + KF[1]
can0

can1

sllin0Servomotor

AGL CAN Simulator
Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

KF[1]http://elinux.org/R-Car/Boards/Kingfisher

36ConclusionLinux Kernel all ready use to vehicle CAN IFOSS CAN Tool “can utils” is good software
AGL support easy to use Vehicle CAN dataNext stepDefine AGL public Vehicle CAN data format-> With the cockpit architecture team
AGL simple CAN simulator provide
Support all in-vehicle communication
Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

37

Thank you!!!
yuichi.kusakabe@jp.fujitsu.com

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

38