This repository has been archived by the owner on Oct 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move fidls to dedicated folders, start implementation of enhp wamp
it makes the api management more understandable and also the Franca generation
- Loading branch information
asanoaozora
committed
Apr 24, 2018
1 parent
b2649d3
commit b91cad7
Showing
26 changed files
with
934 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
########################################################################### | ||
# @licence app begin@ | ||
# SPDX-License-Identifier: MPL-2.0 | ||
# | ||
# Component Name: franca enhanced position service generation | ||
# | ||
# Author: Philippe Colliot | ||
# | ||
# Copyright (C) 2018, PSA Groupe | ||
# | ||
# Note: | ||
# The current file is an adaptation of the example file | ||
# http://git.projects.genivi.org/?p=ipc/common-api-tools.git;a=blob;f=CommonAPI-Examples/E01HelloWorld/CMakeLists.txt | ||
# | ||
# License: | ||
# This Source Code Form is subject to the terms of the | ||
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with | ||
# this file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
# | ||
# @licence end@ | ||
########################################################################### | ||
|
||
cmake_minimum_required (VERSION 2.8.1) | ||
|
||
project(franca-enhancedpositionservice) | ||
|
||
get_directory_property(hasParent PARENT_DIRECTORY) | ||
|
||
if(hasParent) | ||
set(COMMONAPI_GEN_DIR "${COMMONAPI_GEN_DIR}" PARENT_SCOPE) | ||
else() | ||
set(COMMONAPI_GEN_DIR "${CMAKE_CURRENT_BINARY_DIR}/src-gen") | ||
endif() | ||
|
||
option(COMMONAPI_TOOL_GENERATOR | ||
"Absolute path to CommonAPI code generator" "") | ||
option(COMMONAPI_DBUS_TOOL_GENERATOR | ||
"Absolute path to CommonAPI-DBus code generator" "") | ||
option(COMMONAPI_WAMP_TOOL_GENERATOR | ||
"Absolute path to CommonAPI-Wamp code generator" "") | ||
option(WITH_WAMP_GENERATION | ||
"Generate Wamp files" OFF) | ||
|
||
set(COMMONAPI_FIDL_DIR "${CMAKE_CURRENT_SOURCE_DIR}") | ||
|
||
find_package(PkgConfig REQUIRED) | ||
|
||
include(FindPkgConfig) | ||
|
||
# generate code from fidl | ||
if(NOT COMMONAPI_GEN_DIR) | ||
message (FATAL_ERROR "Set the variable -DCOMMONAPI_GEN_DIR=<path>") | ||
endif() | ||
|
||
file(GLOB FIDL_FILES "${COMMONAPI_FIDL_DIR}/*.fidl") | ||
|
||
if (COMMONAPI_TOOL_GENERATOR) | ||
execute_process(WORKING_DIRECTORY ${COMMONAPI_FIDL_DIR} | ||
COMMAND ${COMMONAPI_TOOL_GENERATOR} -sk -d ${COMMONAPI_GEN_DIR} ${FIDL_FILES}) | ||
else () | ||
message (FATAL_ERROR "Set the variable -DCOMMONAPI_TOOL_GENERATOR=<tool>") | ||
endif () | ||
|
||
if (WITH_WAMP_GENERATION) | ||
if (COMMONAPI_WAMP_TOOL_GENERATOR) | ||
foreach(RAW_FILE ${FIDL_FILES}) | ||
execute_process(WORKING_DIRECTORY ${COMMONAPI_FIDL_DIR} | ||
COMMAND java -jar ${COMMONAPI_WAMP_TOOL_GENERATOR} -f ${RAW_FILE} -d ${COMMONAPI_GEN_DIR} ) | ||
endforeach() | ||
else () | ||
message (FATAL_ERROR "Set the variable -DCOMMONAPI_WAMP_TOOL_GENERATOR=<tool>") | ||
endif () | ||
else() | ||
if (COMMONAPI_DBUS_TOOL_GENERATOR) | ||
execute_process(WORKING_DIRECTORY ${COMMONAPI_FIDL_DIR} | ||
COMMAND ${COMMONAPI_DBUS_TOOL_GENERATOR} -d ${COMMONAPI_GEN_DIR} ${FIDL_FILES}) | ||
else () | ||
message (FATAL_ERROR "Set the variable -DCOMMONAPI_DBUS_TOOL_GENERATOR=<tool>") | ||
endif () | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* SPDX-License-Identifier: MPL-2.0 | ||
Component Name: EnhancedPositionService | ||
Compliance Level: Abstract Component | ||
Copyright (C) 2012, BMW Car IT GmbH, Continental Automotive GmbH, PCA Peugeot Citroën, XS Embedded GmbH | ||
License: | ||
This Source Code Form is subject to the terms of the | ||
Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with | ||
this file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package org.genivi.enhancedpositionservice | ||
|
||
import org.genivi.enhancedpositionservice.EnhancedPositionServiceTypes.* from "EnhancedPositionServiceTypes.fidl" | ||
|
||
<** @description : Configuration = This interface allows a client application to set and retrieve configuration options **> | ||
interface Configuration { | ||
version { | ||
major 5 | ||
minor 0 | ||
} | ||
|
||
<** @description : SatSystem = satellite system (GPS, GLONASS, ...) **> | ||
attribute SatelliteSystem SatSystem | ||
|
||
<** @description : UpdateInterval = update interval **> | ||
attribute Int32 UpdateInterval | ||
|
||
<** @description : GetVersion = This method returns the API version implemented by the server application **> | ||
method GetVersion { | ||
out { | ||
Version ^version | ||
} | ||
} | ||
|
||
<** @description : GetSupportedSatelliteSystems = This method returns a list of supported satellite systems **> | ||
method GetSupportedSatelliteSystems { | ||
out { | ||
<** @description : satelliteSystems = list of supported satellite systems **> | ||
SatelliteSystem[] satelliteSystems | ||
} | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* SPDX-License-Identifier: MPL-2.0 | ||
Component Name: EnhancedPositionService | ||
Compliance Level: Abstract Component | ||
Copyright (C) 2012, BMW Car IT GmbH, Continental Automotive GmbH, PCA Peugeot Citroën, XS Embedded GmbH | ||
License: | ||
This Source Code Form is subject to the terms of the | ||
Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with | ||
this file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package org.genivi.enhancedpositionservice | ||
|
||
import org.genivi.enhancedpositionservice.EnhancedPositionServiceTypes.* from "EnhancedPositionServiceTypes.fidl" | ||
|
||
<** @description : EnhancedPosition = This interface offers functionalities to retrieve the enhanced position of the vehicle **> | ||
interface EnhancedPosition { | ||
version { | ||
major 5 | ||
minor 0 | ||
} | ||
|
||
<** @description : GetVersion = This method returns the API version implemented by the server application **> | ||
method GetVersion { | ||
out { | ||
Version ^version | ||
} | ||
} | ||
|
||
<** @description : GetPositionInfo = This method returns a given set of positioning data (e.g. Position, Course, Accuracy, Status, ... ) | ||
Note: If a requested value is invalid, it's not returned to the client application | ||
**> | ||
method GetPositionInfo { | ||
in { | ||
<** @description : valuesToReturn = Bitmask obtained as result of a bitwise OR operation on the keys corresponding to the values to be returned **> | ||
Bitmask valuesToReturn | ||
} | ||
out { | ||
<** @description : timestamp = Timestamp of the acquisition of the position data [ms] **> | ||
Timestamp timestamp | ||
<** @description : data = Position data **> | ||
PositionInfo data | ||
} | ||
} | ||
|
||
<** | ||
@description : GetSatelliteInfo = This method returns information about the current satellite constellation | ||
Note: If a requested value is invalid, it's not returned to the client application | ||
**> | ||
method GetSatelliteInfo { | ||
out { | ||
<** @description : timestamp = Timestamp of the acquisition of the satellite detail data [ms] **> | ||
Timestamp timestamp | ||
<** @description : satelliteInfo = satellite information **> | ||
SatelliteInfo satelliteInfo | ||
} | ||
} | ||
|
||
<** @description : GetTime = This method returns UTC time and date. | ||
Note: If a requested value is invalid, it's not returned to the client application | ||
**> | ||
method GetTime { | ||
out { | ||
<** @description : timestamp = Timestamp of the acquisition of the UTC date/time [ms] **> | ||
Timestamp timestamp | ||
<** @description : time = UTC date/time **> | ||
TimeInfo time | ||
} | ||
} | ||
|
||
<** @description : PositionUpdate = This signal is called to notify a client application of a position change. The update frequency is implementation specific. The maximal allowed frequency is 10Hz **> | ||
broadcast PositionUpdate { | ||
out { | ||
<** @description : valuesToReturn = Bitmask obtained as result of a bitwise OR operation on the keys corresponding to the values that changed **> | ||
Bitmask changedValues | ||
} | ||
} | ||
|
||
} |
183 changes: 183 additions & 0 deletions
183
api/franca/enhancedpositionservice/EnhancedPositionServiceTypes.fidl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
/* SPDX-License-Identifier: MPL-2.0 | ||
Component Name: EnhancedPositionService | ||
Compliance Level: Abstract Component | ||
Copyright (C) 2012, BMW Car IT GmbH, Continental Automotive GmbH, PCA Peugeot Citroën, XS Embedded GmbH | ||
License: | ||
This Source Code Form is subject to the terms of the | ||
Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with | ||
this file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package org.genivi.enhancedpositionservice | ||
|
||
typeCollection EnhancedPositionServiceTypes { | ||
|
||
version { | ||
major 5 | ||
minor 0 | ||
} | ||
|
||
typedef Timestamp is UInt64 | ||
|
||
<** @description: bitmask obtained as a result of an OR operation on enum values of type PositionInfoKey **> | ||
typedef Bitmask is UInt64 | ||
|
||
<** @description: version **> | ||
struct Version { | ||
<** @description : when the major changes, then backward compatibility with previous releases is not granted **> | ||
UInt16 maj | ||
<** @description : when the minor changes, then backward compatibility with previous releases is granted, but something changed in the implementation of the API (e.g. new methods may have been added) **> | ||
UInt16 min | ||
<** @description : when the micro changes, then backward compatibility with previous releases is granted (bug fixes or documentation modifications) **> | ||
UInt16 mic | ||
<** @description : release date (e.g. 21-06-2011) **> | ||
String date | ||
} | ||
|
||
<** @description : Value = generic value (mapped to a dbus variant ('v') data type)**> | ||
union Value { | ||
UInt64 uInt64Value | ||
Double doubleValue | ||
Float floatValue | ||
String stringValue | ||
} | ||
|
||
enumeration PositionInfoKey { | ||
LATITUDE = 1 | ||
LONGITUDE = 2 | ||
ALTITUDE = 4 | ||
HEADING = 8 | ||
SPEED = 16 | ||
CLIMB = 32 | ||
ROLL_RATE = 64 | ||
PITCH_RATE = 128 | ||
YAW_RATE = 256 | ||
PDOP = 512 | ||
HDOP = 1024 | ||
VDOP = 2048 | ||
USED_SATELLITES = 4096 | ||
TRACKED_SATELLITES = 8192 | ||
VISIBLE_SATELLITES = 16384 | ||
SIGMA_HPOSITION = 32768 | ||
SIGMA_ALTITUDE = 65536 | ||
SIGMA_HEADING = 131072 | ||
SIGMA_SPEED = 262144 | ||
SIGMA_CLIMB = 524288 | ||
GNSS_FIX_STATUS = 1048576 | ||
DR_STATUS = 2097152 | ||
RELIABILTY_INDEX = 4194304 | ||
} | ||
|
||
<** @description : PositionInfo = array of tuples (key,value) | ||
key = enumeration PositionInfoKey | ||
key = LATITUDE, value = value of type 'Double', that expresses the latitude of the current position. Range [-90:+90]. Example: 48.053250 | ||
key = LONGITUDE, value = value of type 'Double', that expresses the longitude of the current position. Range [-180:+180]. Example: 8.324500 | ||
key = ALTITUDE, value = value of type 'Double', that expresses the altitude above the sea level of the current position in meters | ||
key = HEADING, value = value of type 'Double', that expresses the course angle in degree. Range [0:360]. 0 = north, 90 = east, 180 = south, 270 = west | ||
key = SPEED, value = value of type 'Double', that expresses speed measured in m/s. A negative value indicates that the vehicle is moving backwards | ||
key = CLIMB, value = value of type 'Double', that expresses the road gradient in degrees | ||
key = ROLL_RATE, value = value of type 'Double', rotation rate around the X-axis in degrees/s. Range [-100:+100] | ||
key = PITCH_RATE, value = value of type 'Double', rotation rate around the Y-axis in degrees/s. Range [-100:+100] | ||
key = YAW_RATE, value = value of type 'Double', rotation rate around the Z-axis in degrees/s. Range [-100:+100] | ||
key = PDOP, value = value of type 'Double', that represents the positional (3D) dilution of precision | ||
key = HDOP, value = value of type 'Double', that represents the horizontal (2D) dilution of precision | ||
key = VDOP, value = value of type 'Double', that represents vertical (altitude) dilution of precision | ||
key = USED_SATELLITES, value = value of type 'UInt8', that represents the number of used satellites | ||
key = TRACKED_SATELLITES, value = value of type 'UInt8', that represents the number of tracked satellites | ||
key = VISIBLE_SATELLITES, value = value of type 'UInt8', that represents the number of visible satellites | ||
key = SIGMA_HPOSITION, value = value of type 'Double', that represents the standard deviation for the horizontal position in m | ||
key = SIGMA_ALTITUDE, value = value of type 'Double', that represents the standard deviation for altitude in m | ||
key = SIGMA_HEADING, value = value of type 'Double', that represents the standard deviation for altitude in degrees | ||
key = SIGMA_SPEED, value = value of type 'Double', that represents the standard error estimate of the speed in m/s</line> | ||
key = SIGMA_CLIMB, value = value of type 'Double', that represents the standard error estimate of the climb in degrees</line> | ||
key = GNSS_FIX_STATUS, value = value of type 'UInt16', that represents an enum(NO_FIX(0x01),TIME_FIX(0x01),2D_FIX(0x02),3D_FIX(0x03), ... ) | ||
key = DR_STATUS, value = value of type 'Boolean', where TRUE means that a dead-reckoning algorithm has been used to calculate the current position | ||
**> | ||
map PositionInfo { | ||
PositionInfoKey to Value | ||
} | ||
|
||
enumeration SatelliteSystem { | ||
GPS = 1 | ||
GLONASS = 2 | ||
GALILEO = 3 | ||
COMPASS = 4 | ||
} | ||
|
||
<** @description : SatelliteInfo = array(struct(system,satelliteId,azimuth,elevation,cNo,inUse)) | ||
system = enum(GPS, GLONASS, GALILEO, COMPASS, ... ) | ||
satelliteId = satellite ID. This ID is unique within one satellite system | ||
azimuth = satellite azimuth in degrees. Value range 0..359 | ||
elevation = satellite elevation in degrees. Value range 0..90 | ||
cNo = C/No (SNR) in dBHz. Range 0 to 99, 0 when not tracking | ||
inUse = flag indicating if the satellite is used for the fix (inUse=true) | ||
**> | ||
struct SatelliteInfo { | ||
SatelliteSystem system | ||
UInt32 satellitId | ||
UInt32 azimuth | ||
UInt32 elevation | ||
UInt32 cNo | ||
Boolean inUse | ||
} | ||
|
||
<** @description: since the hexadecimal format is not supported by Franca yet | ||
the bitmask below is expressed using numbers in decimal format. | ||
Example: 0x01000000 = 16777216 **> | ||
enumeration TimeInfoKey { | ||
YEAR = 16777216 | ||
MONTH = 33554432 | ||
DAY = 67108864 | ||
HOUR = 134217728 | ||
MINUTE = 268435456 | ||
SECOND = 536870912 | ||
MS = 1073741824 | ||
} | ||
|
||
<** @description : TimeInfo = array of tuples (key,value) | ||
key = enumeration TimeInfoKey | ||
key = YEAR, value = value of type 'UInt16', 4 digits number that indicates the year. Example: 2012 | ||
key = MONTH, value = value of type 'UInt8', 2 digits number that indicates the month. Example: 03 means March | ||
key = DAY, value = value of type 'UInt8', 2 digits number that indicates the day. Range [0:31]. Example: 07 | ||
key = HOUR, value = value of type 'UInt8', 2 digits number that indicates the hour. Range [0:23]. Example: 01 | ||
key = MINUTE, value = value of type 'UInt8', 2 digits number that represents the minutes. Range [0:59]. Example: 01 | ||
key = SECOND, value = value of type 'UInt8', 2 digits number that represents the seconds. Range [0:59]. Example: 01 | ||
key = MS, value = value of type 'UInt16', 3 digits number that represents the milliseconds. Range [0:999]. Example: 007 | ||
**> | ||
map TimeInfo { | ||
TimeInfoKey to Value | ||
} | ||
|
||
enumeration PositionFeedbackKey { | ||
LATITUDE = 1 | ||
LONGITUDE = 2 | ||
ALTITUDE = 4 | ||
HEADING = 8 | ||
SPEED = 16 | ||
CLIMB = 32 | ||
RELIABILTY_INDEX = 64 | ||
} | ||
|
||
enumeration PositionFeedbackType { | ||
MAP_MATCHED_FEEDBACK = 1 | ||
TEST_FEEDBACK = 2 | ||
} | ||
|
||
<** | ||
@description : PositionFeedback = array of tuples (key,value)</line> | ||
key = enum(LATITUDE,LONGITUDE,ALTITUDE,HEADING,SPEED,CLIMB,RELIABILTY_INDEX, ... )</line> | ||
key = LATITUDE, value = value of type ´d´, that expresses the latitude of the current position in format %3.6f. [-90,+90]. Example: 48.053250 | ||
key = LONGITUDE, value = value of type ´d´, that expresses the longitude of the current position in format %3.6f. [-180,+180]. Example: 8.324500 | ||
key = ALTITUDE, value = value of type ´i´, that expresses the altitude above the sea level of the current position in meters | ||
key = HEADING, value = value of type ´i´, that expresses the course angle in degree. [0,360]. Example: 0 => north, 90 => east, 180 => south, 270 => west | ||
key = SPEED, value = value of type ´d´, that expresses speed measured in m/s | ||
key = CLIMB, value = value of type ´i´, that expresses the inclination measured in degrees | ||
key = RELIABILTY_INDEX, value = value of type ´y´, that indicates the position feedabck reliabilty. It can assume values from 0 to 100 | ||
**> | ||
map PositionFeedbackInfo { | ||
PositionFeedbackType to Value | ||
} | ||
|
||
} | ||
|
||
|
Oops, something went wrong.