Seat Adjuster

Provides option to request a new seat position and to publish the current seat position

In the scenario of a car sharing company, the goal is to provide the functionality of automatically adjusting the driver’s seat position based on their preferred settings stored in their profile. When the driver unlocks the car, a request is sent to the vehicle to retrieve the preferred seat position. This is where your implementation begins.

The Seat Adjuster Vehicle App receives a MQTT message containing the seat position, which then triggers a seat adjustment command through the Seat Service to change the seat position. Additionally, to ensure convenience for future trips, the car sharing company saves the driver’s preferred seat position and utilizes it accordingly. The Seat Adjuster Vehicle App subscribes to the seat position, receiving updates from the Data Broker, which streams data from the Seat Service.

Requesting new seat position

seat_adjuster_dataflow_1

  1. The Customer requests the change of the seat position as MQTT message on the topic seatadjuster/setPosition/request with the payload:

    {"requestId": 42, "position": 300}
    
  2. The Seat Adjuster Vehicle App that has subscribed to this topic, receives the request to change the seat position as a MQTT message.

  3. The Seat Adjuster Vehicle App gets the current vehicle speed from the data broker, which is fed by the CAN Feeder (KUKSA DBC Feeder).

  4. With the support of the Vehicle App SDK, the Seat Adjuster Vehicle App triggers a seat adjustment command of the Seat Service via gRPC in the event that the speed is equal to zero. Hint: This is a helpful convenience check but not a safety check.

  5. The Seat Service moves the seat to the new position via CAN messages.

  6. The Seat Service returns OK or an error code as gRPC status to the Seat Adjuster Vehicle App.

  7. If everything went well, the Seat Adjuster Vehicle App returns a success message for the topic seatadjuster/setPosition/response with the payload:

    {"requestId": 42, "status": 0 }
    

    Otherwise, an error message will be returned:

    {"requestId": 42, "status": 1, "message": "<error message>" }
    
  8. This success or error message will be returned to the Customer.

Publishing current seat position

seat_adjuster_dataflow_2

  1. If the seat position will be changed by the driver, the new seat position will be sent to the Seat Service via CAN.

  2. The Seat Service streams the seat position via gRPC to the KUKSA Data Broker since it was registered beforehand.

  3. The Seat Adjuster Vehicle App that subscribed to the seat position receives the new seat position from the KUKSA Data Broker as a result.

  4. The Seat Adjuster Vehicle App publishes this on topic seatadjuster/currentPosition with the payload:

    {"position": 350}
    
  5. The Customer who has subscribed to this topic retrieves the new seat position and can store this position to use it for the next trip.

Example Code

You can find an example implementation of a Seat Adjuster Vehicle App here: Seat Adjuster