40
Applying practical experience to HTML5 in Automotive W3C, 28 May 2013, Tokyo Andy Gryc

Applying practical experience to HTML5 in Automotive

  • Upload
    emma

  • View
    55

  • Download
    0

Embed Size (px)

DESCRIPTION

Applying practical experience to HTML5 in Automotive. W3C, 28 May 2013, Tokyo Andy Gryc. Outline. Part 1 QNX CAR as an HTML5 proving ground HTML5 market trends in automotive The direction this leads us Examples: old and new Status of QNX contributions Part 2 - PowerPoint PPT Presentation

Citation preview

Page 1: Applying practical experience to HTML5 in Automotive

Applying practical experience toHTML5 in Automotive

W3C, 28 May 2013, TokyoAndy Gryc

Page 2: Applying practical experience to HTML5 in Automotive

2

Outline

• Part 1

• QNX CAR as an HTML5 proving ground

• HTML5 market trends in automotive

• The direction this leads us

• Examples: old and new

• Status of QNX contributions

• Part 2

• Differences between QNX, Tizen, Webinos

• Issue list for union

• Proposed strategy for unionizing

Page 3: Applying practical experience to HTML5 in Automotive

QNX CAR overview

• Speed customer’s time-to-market– Leverage HTML5 mobile app development– Leverage consumer electronics speed– Integrate best of breed auto technologies– Solve development and integration issues

• Provide customer with flexibility– Support multiple simultaneous HMI frameworks– Fully abstracted component subsystems

• 12 customers across all major auto regions– North America, Europe, Japan, China– Active work on products & prototypes

Page 4: Applying practical experience to HTML5 in Automotive

HTML5 auto market trends

Page 5: Applying practical experience to HTML5 in Automotive

5

Overall picture• HTML5 activity still very high

• Four main categories of usage

– Using it for built-in HMI

– Using it for app container environment

– Using it for mobile->car integration

– Using it for cloud-based applications

• Not really auto-centric

• Can follow existing best practices

Page 6: Applying practical experience to HTML5 in Automotive

6

• Originally area of great interest by OEMs

• Interest here is waning

– Performance and memory use not living up to expectations

– OEMs won’t leverage developer community for creating built-in HMI

– Other environments either going strong (EB), or gaining traction (Qt)

• Conclusion

– Unlikely that HTML5 will be broadly used to build production HMIs at this time

HTML5 for built-in HMI

Page 7: Applying practical experience to HTML5 in Automotive

7

• Still very high degree of applicability

– HTML5 engine provides isolated execution container

– Gives OEMs ability to draw on mobile ecosystem

– HTML5 is only universal mobile app environment

– Mobile apps won’t just come “for free”—need adaptation to car environment

– All OEMs have this as an area of interest

• Conclusion

– Plan for dual mode environment (Native framework for HMI, HTML5 for apps)

– If work cannot support the broader mobile developer community, will not matter for automotive

HTML5 for app environment

Page 8: Applying practical experience to HTML5 in Automotive

8

• Mobile taking over the head unit: two cases

– No head unit: mobile + headless vehicle/telematics gateway

– Limited head unit: mobile for apps + head unit with MirrorLink or equivalent for expansion

• Has been talked about for a while; just starting to see this trend being realized

• Conclusion

– Whatever we recommend should be able to trivially migrate between mobile and in-car instantiations

HTML5 for mobile integration

Page 9: Applying practical experience to HTML5 in Automotive

9

The Three Musts of Automotive HTML51. Must build to run apps, not HMIs (unless HMIs come along for free)

2. Must build for mobile developers as the target development audience

3. Must be able to integrate HTML5 environment with native

Page 10: Applying practical experience to HTML5 in Automotive

Technical lessons learned in applying QNX CAR

Page 11: Applying practical experience to HTML5 in Automotive

11

Lessons learned in building systems with QNX CAR 2.0• Procedural APIs are convenient, but not complete

– Problems: many JavaScript frameworks are built expecting REST; also need way to marshal calls to remote parties (i.e. mobile -> car)

– Solution: provide dual APIs, both procedural and REST, whenever practical

• Synchronous calls are convenient, but not performance optimal

– Problem: JavaScript single-threaded and synchronous calls stall everything for precious milliseconds

– Solution: be 100% asynchronous and use callbacks exclusively

Page 12: Applying practical experience to HTML5 in Automotive

12

Lessons learned in building systems with QNX CAR 2.0, cont.• Must be efficient crossing high latency boundaries

– Problem: multiple calls to get all attributes of a component wasteful in terms of interchanges, sending all data is wasteful in terms of bandwidth

– Solution: use JSON to request a subset of values in getters, JSON with multiple values in setters

• Must design for expansion

– Problem: every OEM will want additions or modifications

– Solution: provide enumeration whenever possible so callers don’t need to hardcode

Page 13: Applying practical experience to HTML5 in Automotive

13

• Set of standardized JavaScript APIs for access to native device functionality

• Apps developed completely using web technologies (HTML5, CSS and JavaScript) – no native coding

• APIs are consistent across multiple platforms (iOS, Android, BB10, Win7)

• Promotes a “develop once, target many” philosophy

• Content is free and open source under the Apache License, version 2.0

• Automotive can leverage mobile app development

What is Apache Cordova?

Page 14: Applying practical experience to HTML5 in Automotive

A sensible course

Page 15: Applying practical experience to HTML5 in Automotive

15

Capitalizing on the lessons• QNX CAR 2.1 is on-going development (QNX CAR 2.0 commercially released January 2013)

– Migrating all APIs to be compatible with Cordova

– APIs are now integrated into BlackBerry WebWorks

– BlackBerry WebWorks in process of being contributed to Cordova

In other words…

• QNX CAR 2.1 APIs are becoming part of Apache Cordova

Page 16: Applying practical experience to HTML5 in Automotive

16

QNX CAR 2.1 API changes

• Make QNX CAR a cross-platform target in Apache Cordova

– APIs are being converted to meet the Cordova API implementation architecture

– Comply with any Cordova APIs that are already in existence today such as audioplayer

• Develop Cordova-compliant APIs that are scalable

– Architect the APIs to support a superset of automotive system configurations

– For example, the HVAC API allows for variable number of climate control zones in vehicles, not just driver and passenger side

• Develop APIs that support the shift to mobile

– Support applications running locally in the car, and remotely on a mobile phone

Page 17: Applying practical experience to HTML5 in Automotive

HVAC example

Page 18: Applying practical experience to HTML5 in Automotive

18

QNX CAR 2.0 HVAC

get Returns object with the requested HVAC settings

Parameters:

set Set one or more HVAC settings

Parameters:

Name Type Description

settings Array A list of settings to get [optional]; if this parameter is omitted, all settings are returned

Name Type Description

args Object The HVAC settings to set

HVAC Attributes Data Type

airCirculation_setting Boolean

airConditioning_enabled Boolean

fan_setting_l Number

fan_setting_r Number

fan_speed_l Number

fan_speed_r Number

fan_temperature_l Number

fan_temperature_r Number

heatedSeat_level_l Number

heatedSeat_level_r Number

rearDefrost_enabled Boolean

zoneLink_enabled Boolean

NOTE: the list of settings is not fixed and depends on the specific system configuration

Page 19: Applying practical experience to HTML5 in Automotive

19

QNX CAR 2.0 HVAC example callsqnx.hvac.get( airCirculation_setting, airConditioning_enabled, fan_speed_l,...)

Returns:

{ airCirculation_setting: true, // circulate air

airConditioning_enabled: false,

fan_speed_l: 2, // left fan speed value

[...]

}

qnx.hvac.set(fan_setting_l: 3, fan_setting_r: 1, [...] )

Page 20: Applying practical experience to HTML5 in Automotive

20

HVAC API for Apache Cordova (QNX CAR 2.1)• com.qnx.car.hvac allows users to :

• retreive HVAC zones

• retreive HVAC settings for a specified filter

• save an HVAC setting

• Implement APIs using callback functions:

• successCallback

• errorCallback

Page 21: Applying practical experience to HTML5 in Automotive

21

Settings and Fan Direction enumerated types

Page 22: Applying practical experience to HTML5 in Automotive

22

Vehicle Zone enumerated types

Page 23: Applying practical experience to HTML5 in Automotive

23

Retrieve HVAC settings example• Retrieve HVAC settings:

car.hvac.get(successCb, errorCb, [‘fanSpeed’, ‘heatedSeat’, … ]);

• Returns object sent in callback:

{setting: ‘fanSpeed’ // car.hvac.HvacSetting.FAN_SPEEDzone: ‘everywhere’ // car.zones.Zone.EVERYWHEREvalue: 5

}, { setting: ‘heatedSeat’ // car.hvac.HvacSetting.HEATED_SEAT, zone: ‘frontleft’ //car.zones.Zone.FRONT_LEFT, value: 0

}, { … }

Page 24: Applying practical experience to HTML5 in Automotive

24

HVAC settings example

• Save HVAC settings:

car.hvac.set([car.hvac.HvacFanDirection.DEFROST == 'defrost‘], [car.zones.Zones. FRONT_LEFT == ‘frontleft’], value == true, successCB, errorCb);

callbacks optional on setters

Page 25: Applying practical experience to HTML5 in Automotive

Vehicle Sensors example

Page 26: Applying practical experience to HTML5 in Automotive

26

QNX CAR 2.0 sensors

get Returns object with the current vehicle sensors

Parameters:Name Type Description

sensors Array A list of sensors to get [optional]; if omitted, all sensors are returned

Sensor Attributes

brakeFluid_level engineOil_level tire_pressure_rl

brake_abs engineOil_pressure tire_pressure_rr

brake_abs_fl engine_rpm tire_wear_fl

brake_abs_fr fuel_level tire_wear_fr

brake_abs_rl light_head_fl tire_wear_rl

brake_abs_rr light_head_fr tire_wear_rr

brake_wear_fl light_tail_rl transmission_clutchWear

brake_wear_fr light_tail_rr transmissionFluid_level

brake_wear_rl speed transmission_gear

brake_wear_rr tire_pressure_fl transmission_temperature

engineCoolant_level tire_pressure_fr washerFluid_level

Page 27: Applying practical experience to HTML5 in Automotive

27

QNX CAR 2.0 sensors exampleqnx.sensors.get( speed, tire_pressure_fl, tire_pressure_fr, ...)

Returns:

{

speed: 0,

tire_pressure_fl: 31,

tire_pressure_fr: 31

[...]

}

Page 28: Applying practical experience to HTML5 in Automotive

28

Vehicle sensor API for Apache Cordova (QNX CAR 2.1)• com.qnx.car.hvac allows users to :

• retreives HVAC zones

• retreives HVAC settings for a specified filter

• saves an HVAC setting

• Implement APIs using callback functions:

• successCallback

• errorCallback

Page 29: Applying practical experience to HTML5 in Automotive

29

Sensors enumerated types

Page 30: Applying practical experience to HTML5 in Automotive

30

Retrieve sensor settings example• Retrieve current vehicle sensors:

car.sensors.get(successCb, errorCb, [‘coolantLevel’, ‘transmissionGear’, … ]);

• Returns object sent in callback:

{coolantLevel: 50, // car.sensors.COOLANT_LEVELtransmissionGear: ‘D’, // car.sensors.TRANSMISSION_GEAR

}

Page 31: Applying practical experience to HTML5 in Automotive

31

Example using filters

var sensors = [ car.sensors.Sensor.COOLANT_LEVEL, car.sensors.Sensor.COOLANT_TEMERATURE ];

car.sensors.get(successCb, errorCb, sensors);

function successCb(data) {

for (var i in data) {

console log ('sensor: ' + i + '; value=' + data[i]);]

}

}

Page 32: Applying practical experience to HTML5 in Automotive

QNX contributions to W3C

Page 33: Applying practical experience to HTML5 in Automotive

33Not there yet: API classes as possible contributions

application keyboard phone

application.event locale radio

audiomixer medialibrary sensors

audioplayer mediasource settings

bluetooth message theme

bluetooth.pbap navigation user

hvac navigator voice

info network volume

Page 34: Applying practical experience to HTML5 in Automotive

Comparing QNX CAR, Tizen, Webinos

Page 35: Applying practical experience to HTML5 in Automotive

35

Comparison 1: getting Engine Oil Level• QNX CAR

car.sensor.get({ setting: ’engineOilLevel’}, onSuccess, onFailure);function onSuccess(sensorData) {

console.log(sensorData[‘engineOilLevel’]); // 0..100}

• Tizen

navigator.vehicle.get(“EngineOil”, onsuccess, onerror);function onsuccess(engineoil) {

console.log(engineoil.Remaining); // 0..100}

• Webinos

vehicleService.vehicle.addEventListener("EngineOilData", oilHandler, null);function oilHandler(data) { console.log(data.level);} //”OVER_MAX”,”MAX”,”OK”,”MIN”,”UNDER_MIN’,”MEASURING”  

Page 36: Applying practical experience to HTML5 in Automotive

36

Comparison 2: Setting fan speed• QNX CAR

car.hvac.set({ setting: ’fanSpeed', zone: 'frontLeft', value: 50}, onSuccess, onFailure);

• Tizen

navigator.vehicle.set("HVAC”, onsuccess, onerror);function onsuccess(hvacsettings) {

hvacsettings.FanSpeed = 3; navigator.vehicle.set("HVAC", hvacsettings, onsetsuccess, onerror);

}

• Webinos (READ ONLY)

 vehicleService.vehicle.addEventListener("climate", climateHandler, null); function climateHandler(data) { console.log(data.ventLevel);}  

Page 37: Applying practical experience to HTML5 in Automotive

37

Attribute issue list• Commonize attributes

– names

– types

– units / enums

– ranges

– allowable increments

• Representational issues (like zone vs front/rear, driver/passenger vs left/right)

• Organizational agreement (i.e. Fuel+EngineSpeed+EngineOil vs Sensors)

• Issues with vehicle capability assumption (i.e. wiper front & wiper rear on same vehicle) – independent of OEM extendability

Page 38: Applying practical experience to HTML5 in Automotive

38

Method issue list• Querying unsupported attributes/writablility

• Handling notification on change

• Caution status condition, alert status condition

– Any way to change per vehicle?

– How do they get triggered?

– How can you find the alert level?

• getHistory and timestamp in attribute

– What is use case?

• Getting/setting values in aggregate

• Utilize existing APIs (eg. Geolocation)

• Security/access rights

• REST conversion of APIs

Page 39: Applying practical experience to HTML5 in Automotive

39

Proposed strategyATTRIBUTE TRACK

1. Create full list of all merged attributes from all 4 proposals

2. Add in missing OBD II data

3. Agree on attribute names

4. Agree on units, ranges, types

5. Agree on organization

Need to assign volunteers

METHOD TRACK

6. List differences between all methodologies, including pros & cons

7. Hash it all out

Page 40: Applying practical experience to HTML5 in Automotive

© 2013 QNX Software Systems Limited. QNX, QNX CAR, NEUTRINO, MOMENTICS, AVIAGE and other product names are trademarks of Research in Motion Limited doing business as BlackBerry, which are registered and/or used in certain jurisdictions, and used under license by QNX Software Systems Limited. The information herein is for informational purposes only and represents the current view of QSSL as of the date of this presentation. Because QSS must respond to changing market conditions, it should not be interpreted to be a commitment on the part of QSSL, and QSSL cannot guarantee the accuracy of any information provided after the date of this presentation. QSSL MAKES NO WARRANTIES, REPRESENTATIONS OR CONDITIONS EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Andy [email protected]