mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-12 06:54:12 +08:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95a349abcc | ||
|
|
c6ba5dc539 | ||
|
|
6c3afeec0f | ||
|
|
29c58b4588 | ||
|
|
ecc565aa3f | ||
|
|
db61810f98 | ||
|
|
48f203ad5b | ||
|
|
6ab4ac2dfb | ||
|
|
9cb3c7b6e6 | ||
|
|
adaa4ed350 | ||
|
|
a64b9aa9b8 | ||
|
|
0138eca61d | ||
|
|
139a40de29 |
22
.gitignore
vendored
Normal file
22
.gitignore
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
.DS_Store
|
||||
.tags
|
||||
.ipynb_checkpoints
|
||||
|
||||
*.pyc
|
||||
.*.swp
|
||||
.*.swo
|
||||
.*.un~
|
||||
*.o
|
||||
*.d
|
||||
*.so
|
||||
*.a
|
||||
*.clb
|
||||
config.json
|
||||
clcache
|
||||
|
||||
board/obj/
|
||||
selfdrive/boardd/boardd
|
||||
selfdrive/logcatd/logcatd
|
||||
selfdrive/sensord/sensord
|
||||
selfdrive/ui/ui
|
||||
|
||||
13
.travis.yml
Normal file
13
.travis.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
sudo: required
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
install:
|
||||
- docker build -t tmppilot -f Dockerfile.openpilot .
|
||||
|
||||
script:
|
||||
- docker run --rm
|
||||
-v "$(pwd)"/selfdrive/test/plant/out:/tmp/openpilot/selfdrive/test/plant/out
|
||||
tmppilot /bin/sh -c 'cd /tmp/openpilot/selfdrive/test/plant && ./runtest.sh'
|
||||
|
||||
6
Makefile
Normal file
6
Makefile
Normal file
@@ -0,0 +1,6 @@
|
||||
.PHONY: all
|
||||
|
||||
# TODO: Add a global build system to openpilot
|
||||
all:
|
||||
cd /data/openpilot/selfdrive && PYTHONPATH=/data/openpilot PREPAREONLY=1 /data/openpilot/selfdrive/manager.py
|
||||
|
||||
13
README.md
13
README.md
@@ -10,15 +10,9 @@ The openpilot codebase has been written to be concise and enable rapid prototypi
|
||||
Hardware
|
||||
------
|
||||
|
||||
Right now openpilot supports the [neo research platform](http://github.com/commaai/neo) for vehicle control. We'd like to support [Open Source Car Control](https://github.com/PolySync/OSCC) as well.
|
||||
Right now openpilot supports the [neo research platform](http://github.com/commaai/neo) for vehicle control. We'd like to support other platforms as well.
|
||||
|
||||
To install it on the NEO:
|
||||
|
||||
```bash
|
||||
# Requires working adb in PATH
|
||||
cd installation
|
||||
./install.sh
|
||||
```
|
||||
Install openpilot on a neo device by entering ``https://openpilot.comma.ai`` during NEOS setup.
|
||||
|
||||
Supported Cars
|
||||
------
|
||||
@@ -26,7 +20,7 @@ Supported Cars
|
||||
- Acura ILX 2016 with AcuraWatch Plus
|
||||
- Limitations: Due to use of the cruise control for gas, it can only be enabled above 25 mph
|
||||
|
||||
- Honda Civic 2016 Touring Edition
|
||||
- Honda Civic 2016 with Honda Sensing
|
||||
- Limitations: Due to limitations in steering firmware, steering is disabled below 18 mph
|
||||
|
||||
Directory structure
|
||||
@@ -36,7 +30,6 @@ Directory structure
|
||||
- cereal -- The messaging spec used for all logs on the phone
|
||||
- common -- Library like functionality we've developed here
|
||||
- dbcs -- Files showing how to interpret data from cars
|
||||
- installation -- Installation on the neo platform
|
||||
- phonelibs -- Libraries used on the phone
|
||||
- selfdrive -- Code needed to drive the car
|
||||
- assets -- Fonts for ui
|
||||
|
||||
36
RELEASES.md
36
RELEASES.md
@@ -1,3 +1,39 @@
|
||||
Version 0.2.8 (2017-02-27)
|
||||
===========================
|
||||
* Fix bug where frames were being dropped in minute 71
|
||||
|
||||
Version 0.2.7 (2017-02-08)
|
||||
===========================
|
||||
* Better performance and pictures at night
|
||||
* Fix ptr alignment issue in boardd
|
||||
* Fix brake error light, fix crash if too cold
|
||||
|
||||
Version 0.2.6 (2017-01-31)
|
||||
===========================
|
||||
* Fix bug in visiond model execution
|
||||
|
||||
Version 0.2.5 (2017-01-30)
|
||||
===========================
|
||||
* Fix race condition in manager
|
||||
|
||||
Version 0.2.4 (2017-01-27)
|
||||
===========================
|
||||
* OnePlus 3T support
|
||||
* Enable installation as NEOS app
|
||||
* Various minor bugfixes
|
||||
|
||||
Version 0.2.3 (2017-01-11)
|
||||
===========================
|
||||
* Reduce space usage by 80%
|
||||
* Add better logging
|
||||
* Add Travis CI
|
||||
|
||||
Version 0.2.2 (2017-01-10)
|
||||
===========================
|
||||
* Board triggers started signal on CAN messages
|
||||
* Improved autoexposure
|
||||
* Handle out of space, improve upload status
|
||||
|
||||
Version 0.2.1 (2016-12-14)
|
||||
===========================
|
||||
* Performance improvements, removal of more numpy
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
void can_init(CAN_TypeDef *CAN) {
|
||||
// enable CAN busses
|
||||
if (CAN == CAN1) {
|
||||
// CAN1_EN
|
||||
GPIOB->ODR |= (1 << 3);
|
||||
} else if (CAN == CAN2) {
|
||||
// CAN2_EN
|
||||
GPIOB->ODR |= (1 << 4);
|
||||
}
|
||||
|
||||
CAN->MCR = CAN_MCR_TTCM | CAN_MCR_INRQ;
|
||||
while((CAN->MSR & CAN_MSR_INAK) != CAN_MSR_INAK);
|
||||
puts("CAN initting\n");
|
||||
|
||||
148
board/inc/stm32f2xx_hal_def.h
Normal file
148
board/inc/stm32f2xx_hal_def.h
Normal file
@@ -0,0 +1,148 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32f2xx_hal_def.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.1
|
||||
* @date 25-March-2014
|
||||
* @brief This file contains HAL common defines, enumeration, macros and
|
||||
* structures definitions.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __STM32F2xx_HAL_DEF
|
||||
#define __STM32F2xx_HAL_DEF
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f2xx.h"
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* @brief HAL Status structures definition
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
HAL_OK = 0x00,
|
||||
HAL_ERROR = 0x01,
|
||||
HAL_BUSY = 0x02,
|
||||
HAL_TIMEOUT = 0x03
|
||||
} HAL_StatusTypeDef;
|
||||
|
||||
/**
|
||||
* @brief HAL Lock structures definition
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
HAL_UNLOCKED = 0x00,
|
||||
HAL_LOCKED = 0x01
|
||||
} HAL_LockTypeDef;
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
#ifndef NULL
|
||||
#define NULL (void *) 0
|
||||
#endif
|
||||
|
||||
#define HAL_MAX_DELAY 0xFFFFFFFF
|
||||
|
||||
#define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) != RESET)
|
||||
#define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == RESET)
|
||||
|
||||
#define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD_, __DMA_HANDLE_) \
|
||||
do{ \
|
||||
(__HANDLE__)->__PPP_DMA_FIELD_ = &(__DMA_HANDLE_); \
|
||||
(__DMA_HANDLE_).Parent = (__HANDLE__); \
|
||||
} while(0)
|
||||
|
||||
#if (USE_RTOS == 1)
|
||||
/* Reserved for future use */
|
||||
#else
|
||||
#define __HAL_LOCK(__HANDLE__) \
|
||||
do{ \
|
||||
if((__HANDLE__)->Lock == HAL_LOCKED) \
|
||||
{ \
|
||||
return HAL_BUSY; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(__HANDLE__)->Lock = HAL_LOCKED; \
|
||||
} \
|
||||
}while (0)
|
||||
|
||||
#define __HAL_UNLOCK(__HANDLE__) \
|
||||
do{ \
|
||||
(__HANDLE__)->Lock = HAL_UNLOCKED; \
|
||||
}while (0)
|
||||
#endif /* USE_RTOS */
|
||||
|
||||
#if defined ( __GNUC__ )
|
||||
#ifndef __weak
|
||||
#define __weak __attribute__((weak))
|
||||
#endif /* __weak */
|
||||
#ifndef __packed
|
||||
#define __packed __attribute__((__packed__))
|
||||
#endif /* __packed */
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
|
||||
/* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */
|
||||
#if defined (__GNUC__) /* GNU Compiler */
|
||||
#ifndef __ALIGN_END
|
||||
#define __ALIGN_END __attribute__ ((aligned (4)))
|
||||
#endif /* __ALIGN_END */
|
||||
#ifndef __ALIGN_BEGIN
|
||||
#define __ALIGN_BEGIN
|
||||
#endif /* __ALIGN_BEGIN */
|
||||
#else
|
||||
#ifndef __ALIGN_END
|
||||
#define __ALIGN_END
|
||||
#endif /* __ALIGN_END */
|
||||
#ifndef __ALIGN_BEGIN
|
||||
#if defined (__CC_ARM) /* ARM Compiler */
|
||||
#define __ALIGN_BEGIN __align(4)
|
||||
#elif defined (__ICCARM__) /* IAR Compiler */
|
||||
#define __ALIGN_BEGIN
|
||||
#elif defined (__TASKING__) /* TASKING Compiler */
|
||||
#define __ALIGN_BEGIN __align(4)
|
||||
#endif /* __CC_ARM */
|
||||
#endif /* __ALIGN_BEGIN */
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ___STM32F2xx_HAL_DEF */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
236
board/inc/stm32f2xx_hal_gpio_ex.h
Normal file
236
board/inc/stm32f2xx_hal_gpio_ex.h
Normal file
@@ -0,0 +1,236 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32f2xx_hal_gpio_ex.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.1
|
||||
* @date 25-March-2014
|
||||
* @brief Header file of GPIO HAL Extension module.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __STM32F2xx_HAL_GPIO_EX_H
|
||||
#define __STM32F2xx_HAL_GPIO_EX_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f2xx_hal_def.h"
|
||||
|
||||
/** @addtogroup STM32F2xx_HAL_Driver
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup GPIO
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/** @defgroup GPIO_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup GPIO_Alternat_function_selection
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief AF 0 selection
|
||||
*/
|
||||
#define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
|
||||
#define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
|
||||
#define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */
|
||||
#define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
|
||||
#define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
|
||||
|
||||
/**
|
||||
* @brief AF 1 selection
|
||||
*/
|
||||
#define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
|
||||
#define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
|
||||
|
||||
/**
|
||||
* @brief AF 2 selection
|
||||
*/
|
||||
#define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
|
||||
#define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
|
||||
#define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
|
||||
|
||||
/**
|
||||
* @brief AF 3 selection
|
||||
*/
|
||||
#define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */
|
||||
#define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */
|
||||
#define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */
|
||||
#define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */
|
||||
|
||||
/**
|
||||
* @brief AF 4 selection
|
||||
*/
|
||||
#define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
|
||||
#define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
|
||||
#define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
|
||||
|
||||
/**
|
||||
* @brief AF 5 selection
|
||||
*/
|
||||
#define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
|
||||
#define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */
|
||||
/**
|
||||
* @brief AF 6 selection
|
||||
*/
|
||||
#define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */
|
||||
|
||||
/**
|
||||
* @brief AF 7 selection
|
||||
*/
|
||||
#define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
|
||||
#define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
|
||||
#define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
|
||||
|
||||
/**
|
||||
* @brief AF 8 selection
|
||||
*/
|
||||
#define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */
|
||||
#define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */
|
||||
#define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */
|
||||
|
||||
/**
|
||||
* @brief AF 9 selection
|
||||
*/
|
||||
#define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */
|
||||
#define GPIO_AF9_CAN2 ((uint8_t)0x09) /* CAN2 Alternate Function mapping */
|
||||
#define GPIO_AF9_TIM12 ((uint8_t)0x09) /* TIM12 Alternate Function mapping */
|
||||
#define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */
|
||||
#define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */
|
||||
|
||||
/**
|
||||
* @brief AF 10 selection
|
||||
*/
|
||||
#define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */
|
||||
#define GPIO_AF10_OTG_HS ((uint8_t)0xA) /* OTG_HS Alternate Function mapping */
|
||||
|
||||
/**
|
||||
* @brief AF 11 selection
|
||||
*/
|
||||
#if defined(STM32F207xx) || defined(STM32F217xx)
|
||||
#define GPIO_AF11_ETH ((uint8_t)0x0B) /* ETHERNET Alternate Function mapping */
|
||||
#endif /* STM32F207xx || STM32F217xx */
|
||||
|
||||
/**
|
||||
* @brief AF 12 selection
|
||||
*/
|
||||
#define GPIO_AF12_FSMC ((uint8_t)0xC) /* FSMC Alternate Function mapping */
|
||||
#define GPIO_AF12_OTG_HS_FS ((uint8_t)0xC) /* OTG HS configured in FS, Alternate Function mapping */
|
||||
#define GPIO_AF12_SDIO ((uint8_t)0xC) /* SDIO Alternate Function mapping */
|
||||
|
||||
/**
|
||||
* @brief AF 13 selection
|
||||
*/
|
||||
#if defined(STM32F207xx) || defined(STM32F217xx)
|
||||
#define GPIO_AF13_DCMI ((uint8_t)0x0D) /* DCMI Alternate Function mapping */
|
||||
#endif /* STM32F207xx || STM32F217xx */
|
||||
|
||||
/**
|
||||
* @brief AF 15 selection
|
||||
*/
|
||||
#define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
|
||||
|
||||
#if defined(STM32F207xx) || defined(STM32F217xx)
|
||||
#define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \
|
||||
((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \
|
||||
((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \
|
||||
((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \
|
||||
((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \
|
||||
((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \
|
||||
((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \
|
||||
((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \
|
||||
((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \
|
||||
((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \
|
||||
((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \
|
||||
((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \
|
||||
((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \
|
||||
((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \
|
||||
((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \
|
||||
((AF) == GPIO_AF11_ETH) || ((AF) == GPIO_AF12_OTG_HS_FS) || \
|
||||
((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF13_DCMI) || \
|
||||
((AF) == GPIO_AF12_FSMC) || ((AF) == GPIO_AF15_EVENTOUT))
|
||||
#else /* STM32F207xx || STM32F217xx */
|
||||
#define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \
|
||||
((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \
|
||||
((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \
|
||||
((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \
|
||||
((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \
|
||||
((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \
|
||||
((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \
|
||||
((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \
|
||||
((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \
|
||||
((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \
|
||||
((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \
|
||||
((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \
|
||||
((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \
|
||||
((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \
|
||||
((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \
|
||||
((AF) == GPIO_AF12_OTG_HS_FS) || ((AF) == GPIO_AF12_SDIO) || \
|
||||
((AF) == GPIO_AF12_FSMC) || ((AF) == GPIO_AF15_EVENTOUT))
|
||||
#endif /* STM32F207xx || STM32F217xx */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __STM32F2xx_HAL_GPIO_EX_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
41
board/libc.h
41
board/libc.h
@@ -13,19 +13,7 @@
|
||||
#define __DIVFRAQ(_PCLK_, _BAUD_) (((__DIV((_PCLK_), (_BAUD_)) - (__DIVMANT((_PCLK_), (_BAUD_)) * 100)) * 16 + 50) / 100)
|
||||
#define __USART_BRR(_PCLK_, _BAUD_) ((__DIVMANT((_PCLK_), (_BAUD_)) << 4)|(__DIVFRAQ((_PCLK_), (_BAUD_)) & 0x0F))
|
||||
|
||||
#define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
|
||||
#define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
|
||||
#define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
|
||||
#define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */
|
||||
#define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */
|
||||
#define GPIO_AF12_OTG_HS_FS ((uint8_t)0xC) /* OTG HS configured in FS */
|
||||
|
||||
#ifdef OLD_BOARD
|
||||
#define USART USART2
|
||||
#else
|
||||
#define USART USART3
|
||||
#endif
|
||||
|
||||
#include "stm32f2xx_hal_gpio_ex.h"
|
||||
|
||||
// **** shitty libc ****
|
||||
|
||||
@@ -68,15 +56,20 @@ void clock_init() {
|
||||
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN;
|
||||
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOBEN;
|
||||
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOCEN;
|
||||
|
||||
RCC->AHB1ENR |= RCC_AHB1ENR_DMA2EN;
|
||||
|
||||
RCC->APB1ENR |= RCC_APB1ENR_USART2EN;
|
||||
RCC->APB1ENR |= RCC_APB1ENR_USART3EN;
|
||||
RCC->APB1ENR |= RCC_APB1ENR_CAN1EN;
|
||||
RCC->APB1ENR |= RCC_APB1ENR_CAN2EN;
|
||||
RCC->APB1ENR |= RCC_APB1ENR_DACEN;
|
||||
RCC->APB1ENR |= RCC_APB1ENR_TIM3EN;
|
||||
//RCC->APB1ENR |= RCC_APB1ENR_TIM4EN;
|
||||
RCC->AHB2ENR |= RCC_AHB2ENR_OTGFSEN;
|
||||
//RCC->APB2ENR |= RCC_APB2ENR_TIM1EN;
|
||||
RCC->APB2ENR |= RCC_APB2ENR_TIM1EN;
|
||||
RCC->APB2ENR |= RCC_APB2ENR_ADC1EN;
|
||||
RCC->APB2ENR |= RCC_APB2ENR_SPI1EN;
|
||||
|
||||
// turn on alt USB
|
||||
RCC->AHB1ENR |= RCC_AHB1ENR_OTGHSEN;
|
||||
@@ -101,7 +94,7 @@ void gpio_init() {
|
||||
// IGNITION on C13
|
||||
|
||||
// set mode for LEDs and CAN
|
||||
GPIOB->MODER = GPIO_MODER_MODER10_0 | GPIO_MODER_MODER11_0;
|
||||
GPIOB->MODER = GPIO_MODER_MODER10_0 | GPIO_MODER_MODER11_0 | GPIO_MODER_MODER12_0;
|
||||
// CAN 2
|
||||
GPIOB->MODER |= GPIO_MODER_MODER5_1 | GPIO_MODER_MODER6_1;
|
||||
// CAN 1
|
||||
@@ -125,6 +118,12 @@ void gpio_init() {
|
||||
|
||||
GPIOA->PUPDR = GPIO_PUPDR_PUPDR2_0 | GPIO_PUPDR_PUPDR3_0;
|
||||
|
||||
// setup SPI
|
||||
GPIOA->MODER |= GPIO_MODER_MODER4_1 | GPIO_MODER_MODER5_1 |
|
||||
GPIO_MODER_MODER6_1 | GPIO_MODER_MODER7_1;
|
||||
GPIOA->AFR[0] |= GPIO_AF5_SPI1 << (4*4) | GPIO_AF5_SPI1 << (5*4) |
|
||||
GPIO_AF5_SPI1 << (6*4) | GPIO_AF5_SPI1 << (7*4);
|
||||
|
||||
// set mode for CAN / USB_HS pins
|
||||
GPIOB->AFR[0] = GPIO_AF9_CAN1 << (5*4) | GPIO_AF9_CAN1 << (6*4);
|
||||
GPIOB->AFR[1] = GPIO_AF9_CAN1 << ((8-8)*4) | GPIO_AF9_CAN1 << ((9-8)*4);
|
||||
@@ -136,9 +135,6 @@ void gpio_init() {
|
||||
|
||||
GPIOB->OSPEEDR = GPIO_OSPEEDER_OSPEEDR14 | GPIO_OSPEEDER_OSPEEDR15;
|
||||
|
||||
// enable CAN busses
|
||||
GPIOB->ODR |= (1 << 3) | (1 << 4);
|
||||
|
||||
// enable OTG out tied to ground
|
||||
GPIOA->ODR = 0;
|
||||
GPIOA->MODER |= GPIO_MODER_MODER1_0;
|
||||
@@ -223,4 +219,13 @@ void *memcpy(void *dest, const void *src, unsigned int n) {
|
||||
return dest;
|
||||
}
|
||||
|
||||
void set_led(int led_num, int state) {
|
||||
if (state) {
|
||||
// turn on
|
||||
GPIOB->ODR &= ~(1 << (10 + led_num));
|
||||
} else {
|
||||
// turn off
|
||||
GPIOB->ODR |= (1 << (10 + led_num));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
106
board/main.c
106
board/main.c
@@ -3,6 +3,11 @@
|
||||
//#define USE_INTERNAL_OSC
|
||||
//#define OLD_BOARD
|
||||
//#define ENABLE_CURRENT_SENSOR
|
||||
//#define ENABLE_SPI
|
||||
|
||||
// choose serial port for debugging
|
||||
//#define USART USART2
|
||||
#define USART USART3
|
||||
|
||||
#define USB_VID 0xbbaa
|
||||
#define USB_PID 0xddcc
|
||||
@@ -22,10 +27,16 @@ USB_OTG_GlobalTypeDef *USBx = USB_OTG_FS;
|
||||
#include "timer.h"
|
||||
#include "usb.h"
|
||||
#include "can.h"
|
||||
#include "spi.h"
|
||||
|
||||
// debug safety check: is controls allowed?
|
||||
int controls_allowed = 0;
|
||||
int started = 0;
|
||||
int can_live = 0, pending_can_live = 0;
|
||||
|
||||
// optional features
|
||||
int gas_interceptor_detected = 0;
|
||||
int started_signal_detected = 0;
|
||||
|
||||
// ********************* instantiate queues *********************
|
||||
|
||||
@@ -147,6 +158,9 @@ void CAN2_TX_IRQHandler() {
|
||||
// CAN receive handlers
|
||||
void can_rx(CAN_TypeDef *CAN, int can_number) {
|
||||
while (CAN->RF0R & CAN_RF0R_FMP0) {
|
||||
// can is live
|
||||
pending_can_live = 1;
|
||||
|
||||
// add to my fifo
|
||||
CAN_FIFOMailBox_TypeDef to_push;
|
||||
to_push.RIR = CAN->sFIFOMailBox[0].RIR;
|
||||
@@ -256,6 +270,7 @@ int get_health_pkt(void *dat) {
|
||||
uint8_t started;
|
||||
uint8_t controls_allowed;
|
||||
uint8_t gas_interceptor_detected;
|
||||
uint8_t started_signal_detected;
|
||||
} *health = dat;
|
||||
health->voltage = adc_get(ADCCHAN_VOLTAGE);
|
||||
#ifdef ENABLE_CURRENT_SENSOR
|
||||
@@ -263,9 +278,12 @@ int get_health_pkt(void *dat) {
|
||||
#else
|
||||
health->current = 0;
|
||||
#endif
|
||||
health->started = (GPIOC->IDR & (1 << 13)) != 0;
|
||||
health->started = started;
|
||||
|
||||
health->controls_allowed = controls_allowed;
|
||||
|
||||
health->gas_interceptor_detected = gas_interceptor_detected;
|
||||
health->started_signal_detected = started_signal_detected;
|
||||
return sizeof(*health);
|
||||
}
|
||||
|
||||
@@ -382,6 +400,48 @@ void ADC_IRQHandler(void) {
|
||||
puts("ADC_IRQ\n");
|
||||
}
|
||||
|
||||
#ifdef ENABLE_SPI
|
||||
|
||||
#define SPI_BUF_SIZE 128
|
||||
uint8_t spi_buf[SPI_BUF_SIZE];
|
||||
int spi_buf_count = 0;
|
||||
uint8_t spi_tx_buf[0x10];
|
||||
|
||||
void DMA2_Stream3_IRQHandler(void) {
|
||||
#ifdef DEBUG
|
||||
puts("DMA2\n");
|
||||
#endif
|
||||
DMA2->LIFCR = DMA_LIFCR_CTCIF3;
|
||||
|
||||
pop(&can_rx_q, spi_tx_buf);
|
||||
spi_tx_dma(spi_tx_buf, 0x10);
|
||||
}
|
||||
|
||||
void SPI1_IRQHandler(void) {
|
||||
// status is 0x43
|
||||
if (SPI1->SR & SPI_SR_RXNE) {
|
||||
uint8_t dat = SPI1->DR;
|
||||
/*spi_buf[spi_buf_count] = dat;
|
||||
if (spi_buf_count < SPI_BUF_SIZE-1) {
|
||||
spi_buf_count += 1;
|
||||
}*/
|
||||
}
|
||||
|
||||
if (SPI1->SR & SPI_SR_TXE) {
|
||||
// all i send is U U U no matter what
|
||||
//SPI1->DR = 'U';
|
||||
}
|
||||
|
||||
int stat = SPI1->SR;
|
||||
if (stat & ((~SPI_SR_RXNE) & (~SPI_SR_TXE) & (~SPI_SR_BSY))) {
|
||||
puts("SPI status: ");
|
||||
puth(stat);
|
||||
puts("\n");
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// ***************************** main code *****************************
|
||||
|
||||
void __initialize_hardware_early() {
|
||||
@@ -416,11 +476,6 @@ int main() {
|
||||
// init devices
|
||||
clock_init();
|
||||
|
||||
// test the USB choice before GPIO init
|
||||
if (GPIOA->IDR & (1 << 12)) {
|
||||
USBx = USB_OTG_HS;
|
||||
}
|
||||
|
||||
gpio_init();
|
||||
uart_init();
|
||||
usb_init();
|
||||
@@ -428,6 +483,14 @@ int main() {
|
||||
can_init(CAN2);
|
||||
adc_init();
|
||||
|
||||
#ifdef ENABLE_SPI
|
||||
spi_init();
|
||||
|
||||
// set up DMA
|
||||
memset(spi_tx_buf, 0, 0x10);
|
||||
spi_tx_dma(spi_tx_buf, 0x10);
|
||||
#endif
|
||||
|
||||
// timer for fan PWM
|
||||
#ifdef OLD_BOARD
|
||||
TIM3->CCMR2 = TIM_CCMR2_OC4M_2 | TIM_CCMR2_OC4M_1;
|
||||
@@ -463,11 +526,22 @@ int main() {
|
||||
NVIC_EnableIRQ(CAN2_TX_IRQn);
|
||||
NVIC_EnableIRQ(CAN2_RX0_IRQn);
|
||||
NVIC_EnableIRQ(CAN2_SCE_IRQn);
|
||||
|
||||
#ifdef ENABLE_SPI
|
||||
NVIC_EnableIRQ(DMA2_Stream3_IRQn);
|
||||
NVIC_EnableIRQ(SPI1_IRQn);
|
||||
#endif
|
||||
__enable_irq();
|
||||
|
||||
|
||||
// LED should keep on blinking all the time
|
||||
while (1) {
|
||||
int cnt;
|
||||
for (cnt=0;;cnt++) {
|
||||
can_live = pending_can_live;
|
||||
|
||||
// reset this every 16th pass
|
||||
if ((cnt&0xF) == 0) pending_can_live = 0;
|
||||
|
||||
#ifdef DEBUG
|
||||
puts("** blink ");
|
||||
puth(can_rx_q.r_ptr); puts(" "); puth(can_rx_q.w_ptr); puts(" ");
|
||||
@@ -489,14 +563,28 @@ int main() {
|
||||
GPIOB->ODR &= ~(1 << 10);
|
||||
delay(1000000);
|
||||
|
||||
if (GPIOC->IDR & (1 << 13)) {
|
||||
#ifdef ENABLE_SPI
|
||||
if (spi_buf_count > 0) {
|
||||
hexdump(spi_buf, spi_buf_count);
|
||||
spi_buf_count = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
// started logic
|
||||
int started_signal = (GPIOC->IDR & (1 << 13)) != 0;
|
||||
if (started_signal) { started_signal_detected = 1; }
|
||||
|
||||
if (started_signal || (!started_signal_detected && can_live)) {
|
||||
started = 1;
|
||||
|
||||
// turn on fan at half speed
|
||||
set_fan_speed(32768);
|
||||
} else {
|
||||
started = 0;
|
||||
|
||||
// turn off fan
|
||||
set_fan_speed(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
23
board/spi.h
Normal file
23
board/spi.h
Normal file
@@ -0,0 +1,23 @@
|
||||
void spi_init() {
|
||||
puts("SPI init\n");
|
||||
SPI1->CR1 = SPI_CR1_SPE;
|
||||
SPI1->CR2 = SPI_CR2_RXNEIE | SPI_CR2_ERRIE | SPI_CR2_TXEIE;
|
||||
}
|
||||
|
||||
void spi_tx_dma(void *addr, int len) {
|
||||
// disable DMA
|
||||
SPI1->CR2 &= ~SPI_CR2_TXDMAEN;
|
||||
DMA2_Stream3->CR &= ~DMA_SxCR_EN;
|
||||
|
||||
// DMA2, stream 3, channel 3
|
||||
DMA2_Stream3->M0AR = addr;
|
||||
DMA2_Stream3->NDTR = len;
|
||||
DMA2_Stream3->PAR = &(SPI1->DR);
|
||||
|
||||
// channel3, increment memory, memory -> periph, enable
|
||||
DMA2_Stream3->CR = DMA_SxCR_CHSEL_1 | DMA_SxCR_CHSEL_0 | DMA_SxCR_MINC | DMA_SxCR_DIR_0 | DMA_SxCR_EN;
|
||||
DMA2_Stream3->CR |= DMA_SxCR_TCIE;
|
||||
|
||||
SPI1->CR2 |= SPI_CR2_TXDMAEN;
|
||||
}
|
||||
|
||||
337
cereal/gen/c/car.capnp.c
Normal file
337
cereal/gen/c/car.capnp.c
Normal file
@@ -0,0 +1,337 @@
|
||||
#include "car.capnp.h"
|
||||
/* AUTO GENERATED - DO NOT EDIT */
|
||||
|
||||
cereal_CarState_ptr cereal_new_CarState(struct capn_segment *s) {
|
||||
cereal_CarState_ptr p;
|
||||
p.p = capn_new_struct(s, 24, 5);
|
||||
return p;
|
||||
}
|
||||
cereal_CarState_list cereal_new_CarState_list(struct capn_segment *s, int len) {
|
||||
cereal_CarState_list p;
|
||||
p.p = capn_new_list(s, len, 24, 5);
|
||||
return p;
|
||||
}
|
||||
void cereal_read_CarState(struct cereal_CarState *s, cereal_CarState_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
s->errors.p = capn_getp(p.p, 0, 0);
|
||||
s->vEgo = capn_to_f32(capn_read32(p.p, 0));
|
||||
s->wheelSpeeds.p = capn_getp(p.p, 1, 0);
|
||||
s->gas = capn_to_f32(capn_read32(p.p, 4));
|
||||
s->gasPressed = (capn_read8(p.p, 8) & 1) != 0;
|
||||
s->brake = capn_to_f32(capn_read32(p.p, 12));
|
||||
s->brakePressed = (capn_read8(p.p, 8) & 2) != 0;
|
||||
s->steeringAngle = capn_to_f32(capn_read32(p.p, 16));
|
||||
s->steeringTorque = capn_to_f32(capn_read32(p.p, 20));
|
||||
s->steeringPressed = (capn_read8(p.p, 8) & 4) != 0;
|
||||
s->cruiseState.p = capn_getp(p.p, 2, 0);
|
||||
s->buttonEvents.p = capn_getp(p.p, 3, 0);
|
||||
s->canMonoTimes.p = capn_getp(p.p, 4, 0);
|
||||
}
|
||||
void cereal_write_CarState(const struct cereal_CarState *s, cereal_CarState_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
capn_setp(p.p, 0, s->errors.p);
|
||||
capn_write32(p.p, 0, capn_from_f32(s->vEgo));
|
||||
capn_setp(p.p, 1, s->wheelSpeeds.p);
|
||||
capn_write32(p.p, 4, capn_from_f32(s->gas));
|
||||
capn_write1(p.p, 64, s->gasPressed != 0);
|
||||
capn_write32(p.p, 12, capn_from_f32(s->brake));
|
||||
capn_write1(p.p, 65, s->brakePressed != 0);
|
||||
capn_write32(p.p, 16, capn_from_f32(s->steeringAngle));
|
||||
capn_write32(p.p, 20, capn_from_f32(s->steeringTorque));
|
||||
capn_write1(p.p, 66, s->steeringPressed != 0);
|
||||
capn_setp(p.p, 2, s->cruiseState.p);
|
||||
capn_setp(p.p, 3, s->buttonEvents.p);
|
||||
capn_setp(p.p, 4, s->canMonoTimes.p);
|
||||
}
|
||||
void cereal_get_CarState(struct cereal_CarState *s, cereal_CarState_list l, int i) {
|
||||
cereal_CarState_ptr p;
|
||||
p.p = capn_getp(l.p, i, 0);
|
||||
cereal_read_CarState(s, p);
|
||||
}
|
||||
void cereal_set_CarState(const struct cereal_CarState *s, cereal_CarState_list l, int i) {
|
||||
cereal_CarState_ptr p;
|
||||
p.p = capn_getp(l.p, i, 0);
|
||||
cereal_write_CarState(s, p);
|
||||
}
|
||||
|
||||
cereal_CarState_WheelSpeeds_ptr cereal_new_CarState_WheelSpeeds(struct capn_segment *s) {
|
||||
cereal_CarState_WheelSpeeds_ptr p;
|
||||
p.p = capn_new_struct(s, 16, 0);
|
||||
return p;
|
||||
}
|
||||
cereal_CarState_WheelSpeeds_list cereal_new_CarState_WheelSpeeds_list(struct capn_segment *s, int len) {
|
||||
cereal_CarState_WheelSpeeds_list p;
|
||||
p.p = capn_new_list(s, len, 16, 0);
|
||||
return p;
|
||||
}
|
||||
void cereal_read_CarState_WheelSpeeds(struct cereal_CarState_WheelSpeeds *s, cereal_CarState_WheelSpeeds_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
s->fl = capn_to_f32(capn_read32(p.p, 0));
|
||||
s->fr = capn_to_f32(capn_read32(p.p, 4));
|
||||
s->rl = capn_to_f32(capn_read32(p.p, 8));
|
||||
s->rr = capn_to_f32(capn_read32(p.p, 12));
|
||||
}
|
||||
void cereal_write_CarState_WheelSpeeds(const struct cereal_CarState_WheelSpeeds *s, cereal_CarState_WheelSpeeds_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
capn_write32(p.p, 0, capn_from_f32(s->fl));
|
||||
capn_write32(p.p, 4, capn_from_f32(s->fr));
|
||||
capn_write32(p.p, 8, capn_from_f32(s->rl));
|
||||
capn_write32(p.p, 12, capn_from_f32(s->rr));
|
||||
}
|
||||
void cereal_get_CarState_WheelSpeeds(struct cereal_CarState_WheelSpeeds *s, cereal_CarState_WheelSpeeds_list l, int i) {
|
||||
cereal_CarState_WheelSpeeds_ptr p;
|
||||
p.p = capn_getp(l.p, i, 0);
|
||||
cereal_read_CarState_WheelSpeeds(s, p);
|
||||
}
|
||||
void cereal_set_CarState_WheelSpeeds(const struct cereal_CarState_WheelSpeeds *s, cereal_CarState_WheelSpeeds_list l, int i) {
|
||||
cereal_CarState_WheelSpeeds_ptr p;
|
||||
p.p = capn_getp(l.p, i, 0);
|
||||
cereal_write_CarState_WheelSpeeds(s, p);
|
||||
}
|
||||
|
||||
cereal_CarState_CruiseState_ptr cereal_new_CarState_CruiseState(struct capn_segment *s) {
|
||||
cereal_CarState_CruiseState_ptr p;
|
||||
p.p = capn_new_struct(s, 8, 0);
|
||||
return p;
|
||||
}
|
||||
cereal_CarState_CruiseState_list cereal_new_CarState_CruiseState_list(struct capn_segment *s, int len) {
|
||||
cereal_CarState_CruiseState_list p;
|
||||
p.p = capn_new_list(s, len, 8, 0);
|
||||
return p;
|
||||
}
|
||||
void cereal_read_CarState_CruiseState(struct cereal_CarState_CruiseState *s, cereal_CarState_CruiseState_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
s->enabled = (capn_read8(p.p, 0) & 1) != 0;
|
||||
s->speed = capn_to_f32(capn_read32(p.p, 4));
|
||||
}
|
||||
void cereal_write_CarState_CruiseState(const struct cereal_CarState_CruiseState *s, cereal_CarState_CruiseState_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
capn_write1(p.p, 0, s->enabled != 0);
|
||||
capn_write32(p.p, 4, capn_from_f32(s->speed));
|
||||
}
|
||||
void cereal_get_CarState_CruiseState(struct cereal_CarState_CruiseState *s, cereal_CarState_CruiseState_list l, int i) {
|
||||
cereal_CarState_CruiseState_ptr p;
|
||||
p.p = capn_getp(l.p, i, 0);
|
||||
cereal_read_CarState_CruiseState(s, p);
|
||||
}
|
||||
void cereal_set_CarState_CruiseState(const struct cereal_CarState_CruiseState *s, cereal_CarState_CruiseState_list l, int i) {
|
||||
cereal_CarState_CruiseState_ptr p;
|
||||
p.p = capn_getp(l.p, i, 0);
|
||||
cereal_write_CarState_CruiseState(s, p);
|
||||
}
|
||||
|
||||
cereal_CarState_ButtonEvent_ptr cereal_new_CarState_ButtonEvent(struct capn_segment *s) {
|
||||
cereal_CarState_ButtonEvent_ptr p;
|
||||
p.p = capn_new_struct(s, 8, 0);
|
||||
return p;
|
||||
}
|
||||
cereal_CarState_ButtonEvent_list cereal_new_CarState_ButtonEvent_list(struct capn_segment *s, int len) {
|
||||
cereal_CarState_ButtonEvent_list p;
|
||||
p.p = capn_new_list(s, len, 8, 0);
|
||||
return p;
|
||||
}
|
||||
void cereal_read_CarState_ButtonEvent(struct cereal_CarState_ButtonEvent *s, cereal_CarState_ButtonEvent_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
s->pressed = (capn_read8(p.p, 0) & 1) != 0;
|
||||
s->type = (enum cereal_CarState_ButtonEvent_Type)(int) capn_read16(p.p, 2);
|
||||
}
|
||||
void cereal_write_CarState_ButtonEvent(const struct cereal_CarState_ButtonEvent *s, cereal_CarState_ButtonEvent_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
capn_write1(p.p, 0, s->pressed != 0);
|
||||
capn_write16(p.p, 2, (uint16_t) (s->type));
|
||||
}
|
||||
void cereal_get_CarState_ButtonEvent(struct cereal_CarState_ButtonEvent *s, cereal_CarState_ButtonEvent_list l, int i) {
|
||||
cereal_CarState_ButtonEvent_ptr p;
|
||||
p.p = capn_getp(l.p, i, 0);
|
||||
cereal_read_CarState_ButtonEvent(s, p);
|
||||
}
|
||||
void cereal_set_CarState_ButtonEvent(const struct cereal_CarState_ButtonEvent *s, cereal_CarState_ButtonEvent_list l, int i) {
|
||||
cereal_CarState_ButtonEvent_ptr p;
|
||||
p.p = capn_getp(l.p, i, 0);
|
||||
cereal_write_CarState_ButtonEvent(s, p);
|
||||
}
|
||||
|
||||
cereal_RadarState_ptr cereal_new_RadarState(struct capn_segment *s) {
|
||||
cereal_RadarState_ptr p;
|
||||
p.p = capn_new_struct(s, 0, 3);
|
||||
return p;
|
||||
}
|
||||
cereal_RadarState_list cereal_new_RadarState_list(struct capn_segment *s, int len) {
|
||||
cereal_RadarState_list p;
|
||||
p.p = capn_new_list(s, len, 0, 3);
|
||||
return p;
|
||||
}
|
||||
void cereal_read_RadarState(struct cereal_RadarState *s, cereal_RadarState_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
s->errors.p = capn_getp(p.p, 0, 0);
|
||||
s->points.p = capn_getp(p.p, 1, 0);
|
||||
s->canMonoTimes.p = capn_getp(p.p, 2, 0);
|
||||
}
|
||||
void cereal_write_RadarState(const struct cereal_RadarState *s, cereal_RadarState_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
capn_setp(p.p, 0, s->errors.p);
|
||||
capn_setp(p.p, 1, s->points.p);
|
||||
capn_setp(p.p, 2, s->canMonoTimes.p);
|
||||
}
|
||||
void cereal_get_RadarState(struct cereal_RadarState *s, cereal_RadarState_list l, int i) {
|
||||
cereal_RadarState_ptr p;
|
||||
p.p = capn_getp(l.p, i, 0);
|
||||
cereal_read_RadarState(s, p);
|
||||
}
|
||||
void cereal_set_RadarState(const struct cereal_RadarState *s, cereal_RadarState_list l, int i) {
|
||||
cereal_RadarState_ptr p;
|
||||
p.p = capn_getp(l.p, i, 0);
|
||||
cereal_write_RadarState(s, p);
|
||||
}
|
||||
|
||||
cereal_RadarState_RadarPoint_ptr cereal_new_RadarState_RadarPoint(struct capn_segment *s) {
|
||||
cereal_RadarState_RadarPoint_ptr p;
|
||||
p.p = capn_new_struct(s, 32, 0);
|
||||
return p;
|
||||
}
|
||||
cereal_RadarState_RadarPoint_list cereal_new_RadarState_RadarPoint_list(struct capn_segment *s, int len) {
|
||||
cereal_RadarState_RadarPoint_list p;
|
||||
p.p = capn_new_list(s, len, 32, 0);
|
||||
return p;
|
||||
}
|
||||
void cereal_read_RadarState_RadarPoint(struct cereal_RadarState_RadarPoint *s, cereal_RadarState_RadarPoint_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
s->trackId = capn_read64(p.p, 0);
|
||||
s->dRel = capn_to_f32(capn_read32(p.p, 8));
|
||||
s->yRel = capn_to_f32(capn_read32(p.p, 12));
|
||||
s->vRel = capn_to_f32(capn_read32(p.p, 16));
|
||||
s->aRel = capn_to_f32(capn_read32(p.p, 20));
|
||||
s->yvRel = capn_to_f32(capn_read32(p.p, 24));
|
||||
}
|
||||
void cereal_write_RadarState_RadarPoint(const struct cereal_RadarState_RadarPoint *s, cereal_RadarState_RadarPoint_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
capn_write64(p.p, 0, s->trackId);
|
||||
capn_write32(p.p, 8, capn_from_f32(s->dRel));
|
||||
capn_write32(p.p, 12, capn_from_f32(s->yRel));
|
||||
capn_write32(p.p, 16, capn_from_f32(s->vRel));
|
||||
capn_write32(p.p, 20, capn_from_f32(s->aRel));
|
||||
capn_write32(p.p, 24, capn_from_f32(s->yvRel));
|
||||
}
|
||||
void cereal_get_RadarState_RadarPoint(struct cereal_RadarState_RadarPoint *s, cereal_RadarState_RadarPoint_list l, int i) {
|
||||
cereal_RadarState_RadarPoint_ptr p;
|
||||
p.p = capn_getp(l.p, i, 0);
|
||||
cereal_read_RadarState_RadarPoint(s, p);
|
||||
}
|
||||
void cereal_set_RadarState_RadarPoint(const struct cereal_RadarState_RadarPoint *s, cereal_RadarState_RadarPoint_list l, int i) {
|
||||
cereal_RadarState_RadarPoint_ptr p;
|
||||
p.p = capn_getp(l.p, i, 0);
|
||||
cereal_write_RadarState_RadarPoint(s, p);
|
||||
}
|
||||
|
||||
cereal_CarControl_ptr cereal_new_CarControl(struct capn_segment *s) {
|
||||
cereal_CarControl_ptr p;
|
||||
p.p = capn_new_struct(s, 16, 2);
|
||||
return p;
|
||||
}
|
||||
cereal_CarControl_list cereal_new_CarControl_list(struct capn_segment *s, int len) {
|
||||
cereal_CarControl_list p;
|
||||
p.p = capn_new_list(s, len, 16, 2);
|
||||
return p;
|
||||
}
|
||||
void cereal_read_CarControl(struct cereal_CarControl *s, cereal_CarControl_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
s->enabled = (capn_read8(p.p, 0) & 1) != 0;
|
||||
s->gas = capn_to_f32(capn_read32(p.p, 4));
|
||||
s->brake = capn_to_f32(capn_read32(p.p, 8));
|
||||
s->steeringTorque = capn_to_f32(capn_read32(p.p, 12));
|
||||
s->cruiseControl.p = capn_getp(p.p, 0, 0);
|
||||
s->hudControl.p = capn_getp(p.p, 1, 0);
|
||||
}
|
||||
void cereal_write_CarControl(const struct cereal_CarControl *s, cereal_CarControl_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
capn_write1(p.p, 0, s->enabled != 0);
|
||||
capn_write32(p.p, 4, capn_from_f32(s->gas));
|
||||
capn_write32(p.p, 8, capn_from_f32(s->brake));
|
||||
capn_write32(p.p, 12, capn_from_f32(s->steeringTorque));
|
||||
capn_setp(p.p, 0, s->cruiseControl.p);
|
||||
capn_setp(p.p, 1, s->hudControl.p);
|
||||
}
|
||||
void cereal_get_CarControl(struct cereal_CarControl *s, cereal_CarControl_list l, int i) {
|
||||
cereal_CarControl_ptr p;
|
||||
p.p = capn_getp(l.p, i, 0);
|
||||
cereal_read_CarControl(s, p);
|
||||
}
|
||||
void cereal_set_CarControl(const struct cereal_CarControl *s, cereal_CarControl_list l, int i) {
|
||||
cereal_CarControl_ptr p;
|
||||
p.p = capn_getp(l.p, i, 0);
|
||||
cereal_write_CarControl(s, p);
|
||||
}
|
||||
|
||||
cereal_CarControl_CruiseControl_ptr cereal_new_CarControl_CruiseControl(struct capn_segment *s) {
|
||||
cereal_CarControl_CruiseControl_ptr p;
|
||||
p.p = capn_new_struct(s, 16, 0);
|
||||
return p;
|
||||
}
|
||||
cereal_CarControl_CruiseControl_list cereal_new_CarControl_CruiseControl_list(struct capn_segment *s, int len) {
|
||||
cereal_CarControl_CruiseControl_list p;
|
||||
p.p = capn_new_list(s, len, 16, 0);
|
||||
return p;
|
||||
}
|
||||
void cereal_read_CarControl_CruiseControl(struct cereal_CarControl_CruiseControl *s, cereal_CarControl_CruiseControl_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
s->cancel = (capn_read8(p.p, 0) & 1) != 0;
|
||||
s->override = (capn_read8(p.p, 0) & 2) != 0;
|
||||
s->speedOverride = capn_to_f32(capn_read32(p.p, 4));
|
||||
s->accelOverride = capn_to_f32(capn_read32(p.p, 8));
|
||||
}
|
||||
void cereal_write_CarControl_CruiseControl(const struct cereal_CarControl_CruiseControl *s, cereal_CarControl_CruiseControl_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
capn_write1(p.p, 0, s->cancel != 0);
|
||||
capn_write1(p.p, 1, s->override != 0);
|
||||
capn_write32(p.p, 4, capn_from_f32(s->speedOverride));
|
||||
capn_write32(p.p, 8, capn_from_f32(s->accelOverride));
|
||||
}
|
||||
void cereal_get_CarControl_CruiseControl(struct cereal_CarControl_CruiseControl *s, cereal_CarControl_CruiseControl_list l, int i) {
|
||||
cereal_CarControl_CruiseControl_ptr p;
|
||||
p.p = capn_getp(l.p, i, 0);
|
||||
cereal_read_CarControl_CruiseControl(s, p);
|
||||
}
|
||||
void cereal_set_CarControl_CruiseControl(const struct cereal_CarControl_CruiseControl *s, cereal_CarControl_CruiseControl_list l, int i) {
|
||||
cereal_CarControl_CruiseControl_ptr p;
|
||||
p.p = capn_getp(l.p, i, 0);
|
||||
cereal_write_CarControl_CruiseControl(s, p);
|
||||
}
|
||||
|
||||
cereal_CarControl_HUDControl_ptr cereal_new_CarControl_HUDControl(struct capn_segment *s) {
|
||||
cereal_CarControl_HUDControl_ptr p;
|
||||
p.p = capn_new_struct(s, 16, 0);
|
||||
return p;
|
||||
}
|
||||
cereal_CarControl_HUDControl_list cereal_new_CarControl_HUDControl_list(struct capn_segment *s, int len) {
|
||||
cereal_CarControl_HUDControl_list p;
|
||||
p.p = capn_new_list(s, len, 16, 0);
|
||||
return p;
|
||||
}
|
||||
void cereal_read_CarControl_HUDControl(struct cereal_CarControl_HUDControl *s, cereal_CarControl_HUDControl_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
s->speedVisible = (capn_read8(p.p, 0) & 1) != 0;
|
||||
s->setSpeed = capn_to_f32(capn_read32(p.p, 4));
|
||||
s->lanesVisible = (capn_read8(p.p, 0) & 2) != 0;
|
||||
s->leadVisible = (capn_read8(p.p, 0) & 4) != 0;
|
||||
s->visualAlert = (enum cereal_CarControl_HUDControl_VisualAlert)(int) capn_read16(p.p, 2);
|
||||
s->audibleAlert = (enum cereal_CarControl_HUDControl_AudibleAlert)(int) capn_read16(p.p, 8);
|
||||
}
|
||||
void cereal_write_CarControl_HUDControl(const struct cereal_CarControl_HUDControl *s, cereal_CarControl_HUDControl_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
capn_write1(p.p, 0, s->speedVisible != 0);
|
||||
capn_write32(p.p, 4, capn_from_f32(s->setSpeed));
|
||||
capn_write1(p.p, 1, s->lanesVisible != 0);
|
||||
capn_write1(p.p, 2, s->leadVisible != 0);
|
||||
capn_write16(p.p, 2, (uint16_t) (s->visualAlert));
|
||||
capn_write16(p.p, 8, (uint16_t) (s->audibleAlert));
|
||||
}
|
||||
void cereal_get_CarControl_HUDControl(struct cereal_CarControl_HUDControl *s, cereal_CarControl_HUDControl_list l, int i) {
|
||||
cereal_CarControl_HUDControl_ptr p;
|
||||
p.p = capn_getp(l.p, i, 0);
|
||||
cereal_read_CarControl_HUDControl(s, p);
|
||||
}
|
||||
void cereal_set_CarControl_HUDControl(const struct cereal_CarControl_HUDControl *s, cereal_CarControl_HUDControl_list l, int i) {
|
||||
cereal_CarControl_HUDControl_ptr p;
|
||||
p.p = capn_getp(l.p, i, 0);
|
||||
cereal_write_CarControl_HUDControl(s, p);
|
||||
}
|
||||
287
cereal/gen/c/car.capnp.h
Normal file
287
cereal/gen/c/car.capnp.h
Normal file
@@ -0,0 +1,287 @@
|
||||
#ifndef CAPN_8E2AF1E78AF8B8D
|
||||
#define CAPN_8E2AF1E78AF8B8D
|
||||
/* AUTO GENERATED - DO NOT EDIT */
|
||||
#include <capnp_c.h>
|
||||
|
||||
#if CAPN_VERSION != 1
|
||||
#error "version mismatch between capnp_c.h and generated code"
|
||||
#endif
|
||||
|
||||
#include "c++.capnp.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct cereal_CarState;
|
||||
struct cereal_CarState_WheelSpeeds;
|
||||
struct cereal_CarState_CruiseState;
|
||||
struct cereal_CarState_ButtonEvent;
|
||||
struct cereal_RadarState;
|
||||
struct cereal_RadarState_RadarPoint;
|
||||
struct cereal_CarControl;
|
||||
struct cereal_CarControl_CruiseControl;
|
||||
struct cereal_CarControl_HUDControl;
|
||||
|
||||
typedef struct {capn_ptr p;} cereal_CarState_ptr;
|
||||
typedef struct {capn_ptr p;} cereal_CarState_WheelSpeeds_ptr;
|
||||
typedef struct {capn_ptr p;} cereal_CarState_CruiseState_ptr;
|
||||
typedef struct {capn_ptr p;} cereal_CarState_ButtonEvent_ptr;
|
||||
typedef struct {capn_ptr p;} cereal_RadarState_ptr;
|
||||
typedef struct {capn_ptr p;} cereal_RadarState_RadarPoint_ptr;
|
||||
typedef struct {capn_ptr p;} cereal_CarControl_ptr;
|
||||
typedef struct {capn_ptr p;} cereal_CarControl_CruiseControl_ptr;
|
||||
typedef struct {capn_ptr p;} cereal_CarControl_HUDControl_ptr;
|
||||
|
||||
typedef struct {capn_ptr p;} cereal_CarState_list;
|
||||
typedef struct {capn_ptr p;} cereal_CarState_WheelSpeeds_list;
|
||||
typedef struct {capn_ptr p;} cereal_CarState_CruiseState_list;
|
||||
typedef struct {capn_ptr p;} cereal_CarState_ButtonEvent_list;
|
||||
typedef struct {capn_ptr p;} cereal_RadarState_list;
|
||||
typedef struct {capn_ptr p;} cereal_RadarState_RadarPoint_list;
|
||||
typedef struct {capn_ptr p;} cereal_CarControl_list;
|
||||
typedef struct {capn_ptr p;} cereal_CarControl_CruiseControl_list;
|
||||
typedef struct {capn_ptr p;} cereal_CarControl_HUDControl_list;
|
||||
|
||||
enum cereal_CarState_Error {
|
||||
cereal_CarState_Error_commIssue = 0,
|
||||
cereal_CarState_Error_steerUnavailable = 1,
|
||||
cereal_CarState_Error_brakeUnavailable = 2,
|
||||
cereal_CarState_Error_gasUnavailable = 3,
|
||||
cereal_CarState_Error_wrongGear = 4,
|
||||
cereal_CarState_Error_doorOpen = 5,
|
||||
cereal_CarState_Error_seatbeltNotLatched = 6,
|
||||
cereal_CarState_Error_espDisabled = 7,
|
||||
cereal_CarState_Error_wrongCarMode = 8,
|
||||
cereal_CarState_Error_steerTemporarilyUnavailable = 9,
|
||||
cereal_CarState_Error_reverseGear = 10
|
||||
};
|
||||
|
||||
enum cereal_CarState_ButtonEvent_Type {
|
||||
cereal_CarState_ButtonEvent_Type_unknown = 0,
|
||||
cereal_CarState_ButtonEvent_Type_leftBlinker = 1,
|
||||
cereal_CarState_ButtonEvent_Type_rightBlinker = 2,
|
||||
cereal_CarState_ButtonEvent_Type_accelCruise = 3,
|
||||
cereal_CarState_ButtonEvent_Type_decelCruise = 4,
|
||||
cereal_CarState_ButtonEvent_Type_cancel = 5,
|
||||
cereal_CarState_ButtonEvent_Type_altButton1 = 6,
|
||||
cereal_CarState_ButtonEvent_Type_altButton2 = 7,
|
||||
cereal_CarState_ButtonEvent_Type_altButton3 = 8
|
||||
};
|
||||
|
||||
enum cereal_RadarState_Error {
|
||||
cereal_RadarState_Error_notValid = 0
|
||||
};
|
||||
|
||||
enum cereal_CarControl_HUDControl_VisualAlert {
|
||||
cereal_CarControl_HUDControl_VisualAlert_none = 0,
|
||||
cereal_CarControl_HUDControl_VisualAlert_fcw = 1,
|
||||
cereal_CarControl_HUDControl_VisualAlert_steerRequired = 2,
|
||||
cereal_CarControl_HUDControl_VisualAlert_brakePressed = 3,
|
||||
cereal_CarControl_HUDControl_VisualAlert_wrongGear = 4,
|
||||
cereal_CarControl_HUDControl_VisualAlert_seatbeltUnbuckled = 5,
|
||||
cereal_CarControl_HUDControl_VisualAlert_speedTooHigh = 6
|
||||
};
|
||||
|
||||
enum cereal_CarControl_HUDControl_AudibleAlert {
|
||||
cereal_CarControl_HUDControl_AudibleAlert_none = 0,
|
||||
cereal_CarControl_HUDControl_AudibleAlert_beepSingle = 1,
|
||||
cereal_CarControl_HUDControl_AudibleAlert_beepTriple = 2,
|
||||
cereal_CarControl_HUDControl_AudibleAlert_beepRepeated = 3,
|
||||
cereal_CarControl_HUDControl_AudibleAlert_chimeSingle = 4,
|
||||
cereal_CarControl_HUDControl_AudibleAlert_chimeDouble = 5,
|
||||
cereal_CarControl_HUDControl_AudibleAlert_chimeRepeated = 6,
|
||||
cereal_CarControl_HUDControl_AudibleAlert_chimeContinuous = 7
|
||||
};
|
||||
|
||||
struct cereal_CarState {
|
||||
capn_list16 errors;
|
||||
float vEgo;
|
||||
cereal_CarState_WheelSpeeds_ptr wheelSpeeds;
|
||||
float gas;
|
||||
unsigned gasPressed : 1;
|
||||
float brake;
|
||||
unsigned brakePressed : 1;
|
||||
float steeringAngle;
|
||||
float steeringTorque;
|
||||
unsigned steeringPressed : 1;
|
||||
cereal_CarState_CruiseState_ptr cruiseState;
|
||||
cereal_CarState_ButtonEvent_list buttonEvents;
|
||||
capn_list64 canMonoTimes;
|
||||
};
|
||||
|
||||
static const size_t cereal_CarState_word_count = 3;
|
||||
|
||||
static const size_t cereal_CarState_pointer_count = 5;
|
||||
|
||||
static const size_t cereal_CarState_struct_bytes_count = 64;
|
||||
|
||||
struct cereal_CarState_WheelSpeeds {
|
||||
float fl;
|
||||
float fr;
|
||||
float rl;
|
||||
float rr;
|
||||
};
|
||||
|
||||
static const size_t cereal_CarState_WheelSpeeds_word_count = 2;
|
||||
|
||||
static const size_t cereal_CarState_WheelSpeeds_pointer_count = 0;
|
||||
|
||||
static const size_t cereal_CarState_WheelSpeeds_struct_bytes_count = 16;
|
||||
|
||||
struct cereal_CarState_CruiseState {
|
||||
unsigned enabled : 1;
|
||||
float speed;
|
||||
};
|
||||
|
||||
static const size_t cereal_CarState_CruiseState_word_count = 1;
|
||||
|
||||
static const size_t cereal_CarState_CruiseState_pointer_count = 0;
|
||||
|
||||
static const size_t cereal_CarState_CruiseState_struct_bytes_count = 8;
|
||||
|
||||
struct cereal_CarState_ButtonEvent {
|
||||
unsigned pressed : 1;
|
||||
enum cereal_CarState_ButtonEvent_Type type;
|
||||
};
|
||||
|
||||
static const size_t cereal_CarState_ButtonEvent_word_count = 1;
|
||||
|
||||
static const size_t cereal_CarState_ButtonEvent_pointer_count = 0;
|
||||
|
||||
static const size_t cereal_CarState_ButtonEvent_struct_bytes_count = 8;
|
||||
|
||||
struct cereal_RadarState {
|
||||
capn_list16 errors;
|
||||
cereal_RadarState_RadarPoint_list points;
|
||||
capn_list64 canMonoTimes;
|
||||
};
|
||||
|
||||
static const size_t cereal_RadarState_word_count = 0;
|
||||
|
||||
static const size_t cereal_RadarState_pointer_count = 3;
|
||||
|
||||
static const size_t cereal_RadarState_struct_bytes_count = 24;
|
||||
|
||||
struct cereal_RadarState_RadarPoint {
|
||||
uint64_t trackId;
|
||||
float dRel;
|
||||
float yRel;
|
||||
float vRel;
|
||||
float aRel;
|
||||
float yvRel;
|
||||
};
|
||||
|
||||
static const size_t cereal_RadarState_RadarPoint_word_count = 4;
|
||||
|
||||
static const size_t cereal_RadarState_RadarPoint_pointer_count = 0;
|
||||
|
||||
static const size_t cereal_RadarState_RadarPoint_struct_bytes_count = 32;
|
||||
|
||||
struct cereal_CarControl {
|
||||
unsigned enabled : 1;
|
||||
float gas;
|
||||
float brake;
|
||||
float steeringTorque;
|
||||
cereal_CarControl_CruiseControl_ptr cruiseControl;
|
||||
cereal_CarControl_HUDControl_ptr hudControl;
|
||||
};
|
||||
|
||||
static const size_t cereal_CarControl_word_count = 2;
|
||||
|
||||
static const size_t cereal_CarControl_pointer_count = 2;
|
||||
|
||||
static const size_t cereal_CarControl_struct_bytes_count = 32;
|
||||
|
||||
struct cereal_CarControl_CruiseControl {
|
||||
unsigned cancel : 1;
|
||||
unsigned override : 1;
|
||||
float speedOverride;
|
||||
float accelOverride;
|
||||
};
|
||||
|
||||
static const size_t cereal_CarControl_CruiseControl_word_count = 2;
|
||||
|
||||
static const size_t cereal_CarControl_CruiseControl_pointer_count = 0;
|
||||
|
||||
static const size_t cereal_CarControl_CruiseControl_struct_bytes_count = 16;
|
||||
|
||||
struct cereal_CarControl_HUDControl {
|
||||
unsigned speedVisible : 1;
|
||||
float setSpeed;
|
||||
unsigned lanesVisible : 1;
|
||||
unsigned leadVisible : 1;
|
||||
enum cereal_CarControl_HUDControl_VisualAlert visualAlert;
|
||||
enum cereal_CarControl_HUDControl_AudibleAlert audibleAlert;
|
||||
};
|
||||
|
||||
static const size_t cereal_CarControl_HUDControl_word_count = 2;
|
||||
|
||||
static const size_t cereal_CarControl_HUDControl_pointer_count = 0;
|
||||
|
||||
static const size_t cereal_CarControl_HUDControl_struct_bytes_count = 16;
|
||||
|
||||
cereal_CarState_ptr cereal_new_CarState(struct capn_segment*);
|
||||
cereal_CarState_WheelSpeeds_ptr cereal_new_CarState_WheelSpeeds(struct capn_segment*);
|
||||
cereal_CarState_CruiseState_ptr cereal_new_CarState_CruiseState(struct capn_segment*);
|
||||
cereal_CarState_ButtonEvent_ptr cereal_new_CarState_ButtonEvent(struct capn_segment*);
|
||||
cereal_RadarState_ptr cereal_new_RadarState(struct capn_segment*);
|
||||
cereal_RadarState_RadarPoint_ptr cereal_new_RadarState_RadarPoint(struct capn_segment*);
|
||||
cereal_CarControl_ptr cereal_new_CarControl(struct capn_segment*);
|
||||
cereal_CarControl_CruiseControl_ptr cereal_new_CarControl_CruiseControl(struct capn_segment*);
|
||||
cereal_CarControl_HUDControl_ptr cereal_new_CarControl_HUDControl(struct capn_segment*);
|
||||
|
||||
cereal_CarState_list cereal_new_CarState_list(struct capn_segment*, int len);
|
||||
cereal_CarState_WheelSpeeds_list cereal_new_CarState_WheelSpeeds_list(struct capn_segment*, int len);
|
||||
cereal_CarState_CruiseState_list cereal_new_CarState_CruiseState_list(struct capn_segment*, int len);
|
||||
cereal_CarState_ButtonEvent_list cereal_new_CarState_ButtonEvent_list(struct capn_segment*, int len);
|
||||
cereal_RadarState_list cereal_new_RadarState_list(struct capn_segment*, int len);
|
||||
cereal_RadarState_RadarPoint_list cereal_new_RadarState_RadarPoint_list(struct capn_segment*, int len);
|
||||
cereal_CarControl_list cereal_new_CarControl_list(struct capn_segment*, int len);
|
||||
cereal_CarControl_CruiseControl_list cereal_new_CarControl_CruiseControl_list(struct capn_segment*, int len);
|
||||
cereal_CarControl_HUDControl_list cereal_new_CarControl_HUDControl_list(struct capn_segment*, int len);
|
||||
|
||||
void cereal_read_CarState(struct cereal_CarState*, cereal_CarState_ptr);
|
||||
void cereal_read_CarState_WheelSpeeds(struct cereal_CarState_WheelSpeeds*, cereal_CarState_WheelSpeeds_ptr);
|
||||
void cereal_read_CarState_CruiseState(struct cereal_CarState_CruiseState*, cereal_CarState_CruiseState_ptr);
|
||||
void cereal_read_CarState_ButtonEvent(struct cereal_CarState_ButtonEvent*, cereal_CarState_ButtonEvent_ptr);
|
||||
void cereal_read_RadarState(struct cereal_RadarState*, cereal_RadarState_ptr);
|
||||
void cereal_read_RadarState_RadarPoint(struct cereal_RadarState_RadarPoint*, cereal_RadarState_RadarPoint_ptr);
|
||||
void cereal_read_CarControl(struct cereal_CarControl*, cereal_CarControl_ptr);
|
||||
void cereal_read_CarControl_CruiseControl(struct cereal_CarControl_CruiseControl*, cereal_CarControl_CruiseControl_ptr);
|
||||
void cereal_read_CarControl_HUDControl(struct cereal_CarControl_HUDControl*, cereal_CarControl_HUDControl_ptr);
|
||||
|
||||
void cereal_write_CarState(const struct cereal_CarState*, cereal_CarState_ptr);
|
||||
void cereal_write_CarState_WheelSpeeds(const struct cereal_CarState_WheelSpeeds*, cereal_CarState_WheelSpeeds_ptr);
|
||||
void cereal_write_CarState_CruiseState(const struct cereal_CarState_CruiseState*, cereal_CarState_CruiseState_ptr);
|
||||
void cereal_write_CarState_ButtonEvent(const struct cereal_CarState_ButtonEvent*, cereal_CarState_ButtonEvent_ptr);
|
||||
void cereal_write_RadarState(const struct cereal_RadarState*, cereal_RadarState_ptr);
|
||||
void cereal_write_RadarState_RadarPoint(const struct cereal_RadarState_RadarPoint*, cereal_RadarState_RadarPoint_ptr);
|
||||
void cereal_write_CarControl(const struct cereal_CarControl*, cereal_CarControl_ptr);
|
||||
void cereal_write_CarControl_CruiseControl(const struct cereal_CarControl_CruiseControl*, cereal_CarControl_CruiseControl_ptr);
|
||||
void cereal_write_CarControl_HUDControl(const struct cereal_CarControl_HUDControl*, cereal_CarControl_HUDControl_ptr);
|
||||
|
||||
void cereal_get_CarState(struct cereal_CarState*, cereal_CarState_list, int i);
|
||||
void cereal_get_CarState_WheelSpeeds(struct cereal_CarState_WheelSpeeds*, cereal_CarState_WheelSpeeds_list, int i);
|
||||
void cereal_get_CarState_CruiseState(struct cereal_CarState_CruiseState*, cereal_CarState_CruiseState_list, int i);
|
||||
void cereal_get_CarState_ButtonEvent(struct cereal_CarState_ButtonEvent*, cereal_CarState_ButtonEvent_list, int i);
|
||||
void cereal_get_RadarState(struct cereal_RadarState*, cereal_RadarState_list, int i);
|
||||
void cereal_get_RadarState_RadarPoint(struct cereal_RadarState_RadarPoint*, cereal_RadarState_RadarPoint_list, int i);
|
||||
void cereal_get_CarControl(struct cereal_CarControl*, cereal_CarControl_list, int i);
|
||||
void cereal_get_CarControl_CruiseControl(struct cereal_CarControl_CruiseControl*, cereal_CarControl_CruiseControl_list, int i);
|
||||
void cereal_get_CarControl_HUDControl(struct cereal_CarControl_HUDControl*, cereal_CarControl_HUDControl_list, int i);
|
||||
|
||||
void cereal_set_CarState(const struct cereal_CarState*, cereal_CarState_list, int i);
|
||||
void cereal_set_CarState_WheelSpeeds(const struct cereal_CarState_WheelSpeeds*, cereal_CarState_WheelSpeeds_list, int i);
|
||||
void cereal_set_CarState_CruiseState(const struct cereal_CarState_CruiseState*, cereal_CarState_CruiseState_list, int i);
|
||||
void cereal_set_CarState_ButtonEvent(const struct cereal_CarState_ButtonEvent*, cereal_CarState_ButtonEvent_list, int i);
|
||||
void cereal_set_RadarState(const struct cereal_RadarState*, cereal_RadarState_list, int i);
|
||||
void cereal_set_RadarState_RadarPoint(const struct cereal_RadarState_RadarPoint*, cereal_RadarState_RadarPoint_list, int i);
|
||||
void cereal_set_CarControl(const struct cereal_CarControl*, cereal_CarControl_list, int i);
|
||||
void cereal_set_CarControl_CruiseControl(const struct cereal_CarControl_CruiseControl*, cereal_CarControl_CruiseControl_list, int i);
|
||||
void cereal_set_CarControl_HUDControl(const struct cereal_CarControl_HUDControl*, cereal_CarControl_HUDControl_list, int i);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -137,6 +137,7 @@ void cereal_read_SensorEventData(struct cereal_SensorEventData *s, cereal_Sensor
|
||||
default:
|
||||
break;
|
||||
}
|
||||
s->source = (enum cereal_SensorEventData_SensorSource)(int) capn_read16(p.p, 14);
|
||||
}
|
||||
void cereal_write_SensorEventData(const struct cereal_SensorEventData *s, cereal_SensorEventData_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
@@ -155,6 +156,7 @@ void cereal_write_SensorEventData(const struct cereal_SensorEventData *s, cereal
|
||||
default:
|
||||
break;
|
||||
}
|
||||
capn_write16(p.p, 14, (uint16_t) (s->source));
|
||||
}
|
||||
void cereal_get_SensorEventData(struct cereal_SensorEventData *s, cereal_SensorEventData_list l, int i) {
|
||||
cereal_SensorEventData_ptr p;
|
||||
@@ -198,6 +200,49 @@ void cereal_set_SensorEventData_SensorVec(const struct cereal_SensorEventData_Se
|
||||
cereal_write_SensorEventData_SensorVec(s, p);
|
||||
}
|
||||
|
||||
cereal_GpsLocationData_ptr cereal_new_GpsLocationData(struct capn_segment *s) {
|
||||
cereal_GpsLocationData_ptr p;
|
||||
p.p = capn_new_struct(s, 48, 0);
|
||||
return p;
|
||||
}
|
||||
cereal_GpsLocationData_list cereal_new_GpsLocationData_list(struct capn_segment *s, int len) {
|
||||
cereal_GpsLocationData_list p;
|
||||
p.p = capn_new_list(s, len, 48, 0);
|
||||
return p;
|
||||
}
|
||||
void cereal_read_GpsLocationData(struct cereal_GpsLocationData *s, cereal_GpsLocationData_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
s->flags = capn_read16(p.p, 0);
|
||||
s->latitude = capn_to_f64(capn_read64(p.p, 8));
|
||||
s->longitude = capn_to_f64(capn_read64(p.p, 16));
|
||||
s->altitude = capn_to_f64(capn_read64(p.p, 24));
|
||||
s->speed = capn_to_f32(capn_read32(p.p, 4));
|
||||
s->bearing = capn_to_f32(capn_read32(p.p, 32));
|
||||
s->accuracy = capn_to_f32(capn_read32(p.p, 36));
|
||||
s->timestamp = (int64_t) ((int64_t)(capn_read64(p.p, 40)));
|
||||
}
|
||||
void cereal_write_GpsLocationData(const struct cereal_GpsLocationData *s, cereal_GpsLocationData_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
capn_write16(p.p, 0, s->flags);
|
||||
capn_write64(p.p, 8, capn_from_f64(s->latitude));
|
||||
capn_write64(p.p, 16, capn_from_f64(s->longitude));
|
||||
capn_write64(p.p, 24, capn_from_f64(s->altitude));
|
||||
capn_write32(p.p, 4, capn_from_f32(s->speed));
|
||||
capn_write32(p.p, 32, capn_from_f32(s->bearing));
|
||||
capn_write32(p.p, 36, capn_from_f32(s->accuracy));
|
||||
capn_write64(p.p, 40, (uint64_t) (s->timestamp));
|
||||
}
|
||||
void cereal_get_GpsLocationData(struct cereal_GpsLocationData *s, cereal_GpsLocationData_list l, int i) {
|
||||
cereal_GpsLocationData_ptr p;
|
||||
p.p = capn_getp(l.p, i, 0);
|
||||
cereal_read_GpsLocationData(s, p);
|
||||
}
|
||||
void cereal_set_GpsLocationData(const struct cereal_GpsLocationData *s, cereal_GpsLocationData_list l, int i) {
|
||||
cereal_GpsLocationData_ptr p;
|
||||
p.p = capn_getp(l.p, i, 0);
|
||||
cereal_write_GpsLocationData(s, p);
|
||||
}
|
||||
|
||||
cereal_CanData_ptr cereal_new_CanData(struct capn_segment *s) {
|
||||
cereal_CanData_ptr p;
|
||||
p.p = capn_new_struct(s, 8, 1);
|
||||
@@ -235,12 +280,12 @@ void cereal_set_CanData(const struct cereal_CanData *s, cereal_CanData_list l, i
|
||||
|
||||
cereal_ThermalData_ptr cereal_new_ThermalData(struct capn_segment *s) {
|
||||
cereal_ThermalData_ptr p;
|
||||
p.p = capn_new_struct(s, 16, 0);
|
||||
p.p = capn_new_struct(s, 24, 1);
|
||||
return p;
|
||||
}
|
||||
cereal_ThermalData_list cereal_new_ThermalData_list(struct capn_segment *s, int len) {
|
||||
cereal_ThermalData_list p;
|
||||
p.p = capn_new_list(s, len, 16, 0);
|
||||
p.p = capn_new_list(s, len, 24, 1);
|
||||
return p;
|
||||
}
|
||||
void cereal_read_ThermalData(struct cereal_ThermalData *s, cereal_ThermalData_ptr p) {
|
||||
@@ -252,6 +297,9 @@ void cereal_read_ThermalData(struct cereal_ThermalData *s, cereal_ThermalData_pt
|
||||
s->mem = capn_read16(p.p, 8);
|
||||
s->gpu = capn_read16(p.p, 10);
|
||||
s->bat = capn_read32(p.p, 12);
|
||||
s->freeSpace = capn_to_f32(capn_read32(p.p, 16));
|
||||
s->batteryPercent = (int16_t) ((int16_t)capn_read16(p.p, 20));
|
||||
s->batteryStatus = capn_get_text(p.p, 0, capn_val0);
|
||||
}
|
||||
void cereal_write_ThermalData(const struct cereal_ThermalData *s, cereal_ThermalData_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
@@ -262,6 +310,9 @@ void cereal_write_ThermalData(const struct cereal_ThermalData *s, cereal_Thermal
|
||||
capn_write16(p.p, 8, s->mem);
|
||||
capn_write16(p.p, 10, s->gpu);
|
||||
capn_write32(p.p, 12, s->bat);
|
||||
capn_write32(p.p, 16, capn_from_f32(s->freeSpace));
|
||||
capn_write16(p.p, 20, (uint16_t) (s->batteryPercent));
|
||||
capn_set_text(p.p, 0, s->batteryStatus);
|
||||
}
|
||||
void cereal_get_ThermalData(struct cereal_ThermalData *s, cereal_ThermalData_list l, int i) {
|
||||
cereal_ThermalData_ptr p;
|
||||
@@ -291,6 +342,7 @@ void cereal_read_HealthData(struct cereal_HealthData *s, cereal_HealthData_ptr p
|
||||
s->started = (capn_read8(p.p, 8) & 1) != 0;
|
||||
s->controlsAllowed = (capn_read8(p.p, 8) & 2) != 0;
|
||||
s->gasInterceptorDetected = (capn_read8(p.p, 8) & 4) != 0;
|
||||
s->startedSignalDetected = (capn_read8(p.p, 8) & 8) != 0;
|
||||
}
|
||||
void cereal_write_HealthData(const struct cereal_HealthData *s, cereal_HealthData_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
@@ -299,6 +351,7 @@ void cereal_write_HealthData(const struct cereal_HealthData *s, cereal_HealthDat
|
||||
capn_write1(p.p, 64, s->started != 0);
|
||||
capn_write1(p.p, 65, s->controlsAllowed != 0);
|
||||
capn_write1(p.p, 66, s->gasInterceptorDetected != 0);
|
||||
capn_write1(p.p, 67, s->startedSignalDetected != 0);
|
||||
}
|
||||
void cereal_get_HealthData(struct cereal_HealthData *s, cereal_HealthData_list l, int i) {
|
||||
cereal_HealthData_ptr p;
|
||||
@@ -361,11 +414,11 @@ void cereal_read_Live20Data(struct cereal_Live20Data *s, cereal_Live20Data_ptr p
|
||||
s->canMonoTimes.p = capn_getp(p.p, 3, 0);
|
||||
s->mdMonoTime = capn_read64(p.p, 16);
|
||||
s->ftMonoTime = capn_read64(p.p, 24);
|
||||
s->warpMatrix.p = capn_getp(p.p, 0, 0);
|
||||
s->angleOffset = capn_to_f32(capn_read32(p.p, 0));
|
||||
s->calStatus = (int8_t) ((int8_t)capn_read8(p.p, 4));
|
||||
s->calCycle = (int32_t) ((int32_t)capn_read32(p.p, 12));
|
||||
s->calPerc = (int8_t) ((int8_t)capn_read8(p.p, 5));
|
||||
s->warpMatrixDEPRECATED.p = capn_getp(p.p, 0, 0);
|
||||
s->angleOffsetDEPRECATED = capn_to_f32(capn_read32(p.p, 0));
|
||||
s->calStatusDEPRECATED = (int8_t) ((int8_t)capn_read8(p.p, 4));
|
||||
s->calCycleDEPRECATED = (int32_t) ((int32_t)capn_read32(p.p, 12));
|
||||
s->calPercDEPRECATED = (int8_t) ((int8_t)capn_read8(p.p, 5));
|
||||
s->leadOne.p = capn_getp(p.p, 1, 0);
|
||||
s->leadTwo.p = capn_getp(p.p, 2, 0);
|
||||
s->cumLagMs = capn_to_f32(capn_read32(p.p, 8));
|
||||
@@ -375,11 +428,11 @@ void cereal_write_Live20Data(const struct cereal_Live20Data *s, cereal_Live20Dat
|
||||
capn_setp(p.p, 3, s->canMonoTimes.p);
|
||||
capn_write64(p.p, 16, s->mdMonoTime);
|
||||
capn_write64(p.p, 24, s->ftMonoTime);
|
||||
capn_setp(p.p, 0, s->warpMatrix.p);
|
||||
capn_write32(p.p, 0, capn_from_f32(s->angleOffset));
|
||||
capn_write8(p.p, 4, (uint8_t) (s->calStatus));
|
||||
capn_write32(p.p, 12, (uint32_t) (s->calCycle));
|
||||
capn_write8(p.p, 5, (uint8_t) (s->calPerc));
|
||||
capn_setp(p.p, 0, s->warpMatrixDEPRECATED.p);
|
||||
capn_write32(p.p, 0, capn_from_f32(s->angleOffsetDEPRECATED));
|
||||
capn_write8(p.p, 4, (uint8_t) (s->calStatusDEPRECATED));
|
||||
capn_write32(p.p, 12, (uint32_t) (s->calCycleDEPRECATED));
|
||||
capn_write8(p.p, 5, (uint8_t) (s->calPercDEPRECATED));
|
||||
capn_setp(p.p, 1, s->leadOne.p);
|
||||
capn_setp(p.p, 2, s->leadTwo.p);
|
||||
capn_write32(p.p, 8, capn_from_f32(s->cumLagMs));
|
||||
@@ -545,7 +598,7 @@ void cereal_read_Live100Data(struct cereal_Live100Data *s, cereal_Live100Data_pt
|
||||
s->l20MonoTime = capn_read64(p.p, 72);
|
||||
s->mdMonoTime = capn_read64(p.p, 80);
|
||||
s->vEgo = capn_to_f32(capn_read32(p.p, 0));
|
||||
s->aEgo = capn_to_f32(capn_read32(p.p, 4));
|
||||
s->aEgoDEPRECATED = capn_to_f32(capn_read32(p.p, 4));
|
||||
s->vPid = capn_to_f32(capn_read32(p.p, 8));
|
||||
s->vTargetLead = capn_to_f32(capn_read32(p.p, 12));
|
||||
s->upAccelCmd = capn_to_f32(capn_read32(p.p, 16));
|
||||
@@ -558,7 +611,7 @@ void cereal_read_Live100Data(struct cereal_Live100Data *s, cereal_Live100Data_pt
|
||||
s->aTargetMax = capn_to_f32(capn_read32(p.p, 44));
|
||||
s->jerkFactor = capn_to_f32(capn_read32(p.p, 48));
|
||||
s->angleSteers = capn_to_f32(capn_read32(p.p, 52));
|
||||
s->hudLead = (int32_t) ((int32_t)capn_read32(p.p, 56));
|
||||
s->hudLeadDEPRECATED = (int32_t) ((int32_t)capn_read32(p.p, 56));
|
||||
s->cumLagMs = capn_to_f32(capn_read32(p.p, 60));
|
||||
s->enabled = (capn_read8(p.p, 88) & 1) != 0;
|
||||
s->steerOverride = (capn_read8(p.p, 88) & 2) != 0;
|
||||
@@ -575,7 +628,7 @@ void cereal_write_Live100Data(const struct cereal_Live100Data *s, cereal_Live100
|
||||
capn_write64(p.p, 72, s->l20MonoTime);
|
||||
capn_write64(p.p, 80, s->mdMonoTime);
|
||||
capn_write32(p.p, 0, capn_from_f32(s->vEgo));
|
||||
capn_write32(p.p, 4, capn_from_f32(s->aEgo));
|
||||
capn_write32(p.p, 4, capn_from_f32(s->aEgoDEPRECATED));
|
||||
capn_write32(p.p, 8, capn_from_f32(s->vPid));
|
||||
capn_write32(p.p, 12, capn_from_f32(s->vTargetLead));
|
||||
capn_write32(p.p, 16, capn_from_f32(s->upAccelCmd));
|
||||
@@ -588,7 +641,7 @@ void cereal_write_Live100Data(const struct cereal_Live100Data *s, cereal_Live100
|
||||
capn_write32(p.p, 44, capn_from_f32(s->aTargetMax));
|
||||
capn_write32(p.p, 48, capn_from_f32(s->jerkFactor));
|
||||
capn_write32(p.p, 52, capn_from_f32(s->angleSteers));
|
||||
capn_write32(p.p, 56, (uint32_t) (s->hudLead));
|
||||
capn_write32(p.p, 56, (uint32_t) (s->hudLeadDEPRECATED));
|
||||
capn_write32(p.p, 60, capn_from_f32(s->cumLagMs));
|
||||
capn_write1(p.p, 704, s->enabled != 0);
|
||||
capn_write1(p.p, 705, s->steerOverride != 0);
|
||||
@@ -965,7 +1018,10 @@ void cereal_read_Event(struct cereal_Event *s, cereal_Event_ptr p) {
|
||||
case cereal_Event_sendcan:
|
||||
case cereal_Event_liveCalibration:
|
||||
case cereal_Event_androidLogEntry:
|
||||
s->androidLogEntry.p = capn_getp(p.p, 0, 0);
|
||||
case cereal_Event_gpsLocation:
|
||||
case cereal_Event_carState:
|
||||
case cereal_Event_carControl:
|
||||
s->carControl.p = capn_getp(p.p, 0, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -998,7 +1054,10 @@ void cereal_write_Event(const struct cereal_Event *s, cereal_Event_ptr p) {
|
||||
case cereal_Event_sendcan:
|
||||
case cereal_Event_liveCalibration:
|
||||
case cereal_Event_androidLogEntry:
|
||||
capn_setp(p.p, 0, s->androidLogEntry.p);
|
||||
case cereal_Event_gpsLocation:
|
||||
case cereal_Event_carState:
|
||||
case cereal_Event_carControl:
|
||||
capn_setp(p.p, 0, s->carControl.p);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#endif
|
||||
|
||||
#include "c++.capnp.h"
|
||||
#include "car.capnp.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -18,6 +19,7 @@ struct cereal_FrameData;
|
||||
struct cereal_GPSNMEAData;
|
||||
struct cereal_SensorEventData;
|
||||
struct cereal_SensorEventData_SensorVec;
|
||||
struct cereal_GpsLocationData;
|
||||
struct cereal_CanData;
|
||||
struct cereal_ThermalData;
|
||||
struct cereal_HealthData;
|
||||
@@ -43,6 +45,7 @@ typedef struct {capn_ptr p;} cereal_FrameData_ptr;
|
||||
typedef struct {capn_ptr p;} cereal_GPSNMEAData_ptr;
|
||||
typedef struct {capn_ptr p;} cereal_SensorEventData_ptr;
|
||||
typedef struct {capn_ptr p;} cereal_SensorEventData_SensorVec_ptr;
|
||||
typedef struct {capn_ptr p;} cereal_GpsLocationData_ptr;
|
||||
typedef struct {capn_ptr p;} cereal_CanData_ptr;
|
||||
typedef struct {capn_ptr p;} cereal_ThermalData_ptr;
|
||||
typedef struct {capn_ptr p;} cereal_HealthData_ptr;
|
||||
@@ -68,6 +71,7 @@ typedef struct {capn_ptr p;} cereal_FrameData_list;
|
||||
typedef struct {capn_ptr p;} cereal_GPSNMEAData_list;
|
||||
typedef struct {capn_ptr p;} cereal_SensorEventData_list;
|
||||
typedef struct {capn_ptr p;} cereal_SensorEventData_SensorVec_list;
|
||||
typedef struct {capn_ptr p;} cereal_GpsLocationData_list;
|
||||
typedef struct {capn_ptr p;} cereal_CanData_list;
|
||||
typedef struct {capn_ptr p;} cereal_ThermalData_list;
|
||||
typedef struct {capn_ptr p;} cereal_HealthData_list;
|
||||
@@ -88,6 +92,13 @@ typedef struct {capn_ptr p;} cereal_AndroidLogEntry_list;
|
||||
typedef struct {capn_ptr p;} cereal_LogRotate_list;
|
||||
typedef struct {capn_ptr p;} cereal_Event_list;
|
||||
|
||||
enum cereal_SensorEventData_SensorSource {
|
||||
cereal_SensorEventData_SensorSource_android = 0,
|
||||
cereal_SensorEventData_SensorSource_iOS = 1,
|
||||
cereal_SensorEventData_SensorSource_fiber = 2,
|
||||
cereal_SensorEventData_SensorSource_velodyne = 3
|
||||
};
|
||||
|
||||
enum cereal_EncodeIndex_Type {
|
||||
cereal_EncodeIndex_Type_bigBoxLossless = 0,
|
||||
cereal_EncodeIndex_Type_fullHEVC = 1,
|
||||
@@ -153,6 +164,7 @@ struct cereal_SensorEventData {
|
||||
cereal_SensorEventData_SensorVec_ptr orientation;
|
||||
cereal_SensorEventData_SensorVec_ptr gyro;
|
||||
};
|
||||
enum cereal_SensorEventData_SensorSource source;
|
||||
};
|
||||
|
||||
static const size_t cereal_SensorEventData_word_count = 3;
|
||||
@@ -172,6 +184,23 @@ static const size_t cereal_SensorEventData_SensorVec_pointer_count = 1;
|
||||
|
||||
static const size_t cereal_SensorEventData_SensorVec_struct_bytes_count = 16;
|
||||
|
||||
struct cereal_GpsLocationData {
|
||||
uint16_t flags;
|
||||
double latitude;
|
||||
double longitude;
|
||||
double altitude;
|
||||
float speed;
|
||||
float bearing;
|
||||
float accuracy;
|
||||
int64_t timestamp;
|
||||
};
|
||||
|
||||
static const size_t cereal_GpsLocationData_word_count = 6;
|
||||
|
||||
static const size_t cereal_GpsLocationData_pointer_count = 0;
|
||||
|
||||
static const size_t cereal_GpsLocationData_struct_bytes_count = 48;
|
||||
|
||||
struct cereal_CanData {
|
||||
uint32_t address;
|
||||
uint16_t busTime;
|
||||
@@ -193,13 +222,16 @@ struct cereal_ThermalData {
|
||||
uint16_t mem;
|
||||
uint16_t gpu;
|
||||
uint32_t bat;
|
||||
float freeSpace;
|
||||
int16_t batteryPercent;
|
||||
capn_text batteryStatus;
|
||||
};
|
||||
|
||||
static const size_t cereal_ThermalData_word_count = 2;
|
||||
static const size_t cereal_ThermalData_word_count = 3;
|
||||
|
||||
static const size_t cereal_ThermalData_pointer_count = 0;
|
||||
static const size_t cereal_ThermalData_pointer_count = 1;
|
||||
|
||||
static const size_t cereal_ThermalData_struct_bytes_count = 16;
|
||||
static const size_t cereal_ThermalData_struct_bytes_count = 32;
|
||||
|
||||
struct cereal_HealthData {
|
||||
uint32_t voltage;
|
||||
@@ -207,6 +239,7 @@ struct cereal_HealthData {
|
||||
unsigned started : 1;
|
||||
unsigned controlsAllowed : 1;
|
||||
unsigned gasInterceptorDetected : 1;
|
||||
unsigned startedSignalDetected : 1;
|
||||
};
|
||||
|
||||
static const size_t cereal_HealthData_word_count = 2;
|
||||
@@ -232,11 +265,11 @@ struct cereal_Live20Data {
|
||||
capn_list64 canMonoTimes;
|
||||
uint64_t mdMonoTime;
|
||||
uint64_t ftMonoTime;
|
||||
capn_list32 warpMatrix;
|
||||
float angleOffset;
|
||||
int8_t calStatus;
|
||||
int32_t calCycle;
|
||||
int8_t calPerc;
|
||||
capn_list32 warpMatrixDEPRECATED;
|
||||
float angleOffsetDEPRECATED;
|
||||
int8_t calStatusDEPRECATED;
|
||||
int32_t calCycleDEPRECATED;
|
||||
int8_t calPercDEPRECATED;
|
||||
cereal_Live20Data_LeadData_ptr leadOne;
|
||||
cereal_Live20Data_LeadData_ptr leadTwo;
|
||||
float cumLagMs;
|
||||
@@ -307,7 +340,7 @@ struct cereal_Live100Data {
|
||||
uint64_t l20MonoTime;
|
||||
uint64_t mdMonoTime;
|
||||
float vEgo;
|
||||
float aEgo;
|
||||
float aEgoDEPRECATED;
|
||||
float vPid;
|
||||
float vTargetLead;
|
||||
float upAccelCmd;
|
||||
@@ -320,7 +353,7 @@ struct cereal_Live100Data {
|
||||
float aTargetMax;
|
||||
float jerkFactor;
|
||||
float angleSteers;
|
||||
int32_t hudLead;
|
||||
int32_t hudLeadDEPRECATED;
|
||||
float cumLagMs;
|
||||
unsigned enabled : 1;
|
||||
unsigned steerOverride : 1;
|
||||
@@ -475,7 +508,10 @@ enum cereal_Event_which {
|
||||
cereal_Event_sendcan = 16,
|
||||
cereal_Event_logMessage = 17,
|
||||
cereal_Event_liveCalibration = 18,
|
||||
cereal_Event_androidLogEntry = 19
|
||||
cereal_Event_androidLogEntry = 19,
|
||||
cereal_Event_gpsLocation = 20,
|
||||
cereal_Event_carState = 21,
|
||||
cereal_Event_carControl = 22
|
||||
};
|
||||
|
||||
struct cereal_Event {
|
||||
@@ -502,6 +538,9 @@ struct cereal_Event {
|
||||
capn_text logMessage;
|
||||
cereal_LiveCalibrationData_ptr liveCalibration;
|
||||
cereal_AndroidLogEntry_ptr androidLogEntry;
|
||||
cereal_GpsLocationData_ptr gpsLocation;
|
||||
cereal_CarState_ptr carState;
|
||||
cereal_CarControl_ptr carControl;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -516,6 +555,7 @@ cereal_FrameData_ptr cereal_new_FrameData(struct capn_segment*);
|
||||
cereal_GPSNMEAData_ptr cereal_new_GPSNMEAData(struct capn_segment*);
|
||||
cereal_SensorEventData_ptr cereal_new_SensorEventData(struct capn_segment*);
|
||||
cereal_SensorEventData_SensorVec_ptr cereal_new_SensorEventData_SensorVec(struct capn_segment*);
|
||||
cereal_GpsLocationData_ptr cereal_new_GpsLocationData(struct capn_segment*);
|
||||
cereal_CanData_ptr cereal_new_CanData(struct capn_segment*);
|
||||
cereal_ThermalData_ptr cereal_new_ThermalData(struct capn_segment*);
|
||||
cereal_HealthData_ptr cereal_new_HealthData(struct capn_segment*);
|
||||
@@ -541,6 +581,7 @@ cereal_FrameData_list cereal_new_FrameData_list(struct capn_segment*, int len);
|
||||
cereal_GPSNMEAData_list cereal_new_GPSNMEAData_list(struct capn_segment*, int len);
|
||||
cereal_SensorEventData_list cereal_new_SensorEventData_list(struct capn_segment*, int len);
|
||||
cereal_SensorEventData_SensorVec_list cereal_new_SensorEventData_SensorVec_list(struct capn_segment*, int len);
|
||||
cereal_GpsLocationData_list cereal_new_GpsLocationData_list(struct capn_segment*, int len);
|
||||
cereal_CanData_list cereal_new_CanData_list(struct capn_segment*, int len);
|
||||
cereal_ThermalData_list cereal_new_ThermalData_list(struct capn_segment*, int len);
|
||||
cereal_HealthData_list cereal_new_HealthData_list(struct capn_segment*, int len);
|
||||
@@ -566,6 +607,7 @@ void cereal_read_FrameData(struct cereal_FrameData*, cereal_FrameData_ptr);
|
||||
void cereal_read_GPSNMEAData(struct cereal_GPSNMEAData*, cereal_GPSNMEAData_ptr);
|
||||
void cereal_read_SensorEventData(struct cereal_SensorEventData*, cereal_SensorEventData_ptr);
|
||||
void cereal_read_SensorEventData_SensorVec(struct cereal_SensorEventData_SensorVec*, cereal_SensorEventData_SensorVec_ptr);
|
||||
void cereal_read_GpsLocationData(struct cereal_GpsLocationData*, cereal_GpsLocationData_ptr);
|
||||
void cereal_read_CanData(struct cereal_CanData*, cereal_CanData_ptr);
|
||||
void cereal_read_ThermalData(struct cereal_ThermalData*, cereal_ThermalData_ptr);
|
||||
void cereal_read_HealthData(struct cereal_HealthData*, cereal_HealthData_ptr);
|
||||
@@ -591,6 +633,7 @@ void cereal_write_FrameData(const struct cereal_FrameData*, cereal_FrameData_ptr
|
||||
void cereal_write_GPSNMEAData(const struct cereal_GPSNMEAData*, cereal_GPSNMEAData_ptr);
|
||||
void cereal_write_SensorEventData(const struct cereal_SensorEventData*, cereal_SensorEventData_ptr);
|
||||
void cereal_write_SensorEventData_SensorVec(const struct cereal_SensorEventData_SensorVec*, cereal_SensorEventData_SensorVec_ptr);
|
||||
void cereal_write_GpsLocationData(const struct cereal_GpsLocationData*, cereal_GpsLocationData_ptr);
|
||||
void cereal_write_CanData(const struct cereal_CanData*, cereal_CanData_ptr);
|
||||
void cereal_write_ThermalData(const struct cereal_ThermalData*, cereal_ThermalData_ptr);
|
||||
void cereal_write_HealthData(const struct cereal_HealthData*, cereal_HealthData_ptr);
|
||||
@@ -616,6 +659,7 @@ void cereal_get_FrameData(struct cereal_FrameData*, cereal_FrameData_list, int i
|
||||
void cereal_get_GPSNMEAData(struct cereal_GPSNMEAData*, cereal_GPSNMEAData_list, int i);
|
||||
void cereal_get_SensorEventData(struct cereal_SensorEventData*, cereal_SensorEventData_list, int i);
|
||||
void cereal_get_SensorEventData_SensorVec(struct cereal_SensorEventData_SensorVec*, cereal_SensorEventData_SensorVec_list, int i);
|
||||
void cereal_get_GpsLocationData(struct cereal_GpsLocationData*, cereal_GpsLocationData_list, int i);
|
||||
void cereal_get_CanData(struct cereal_CanData*, cereal_CanData_list, int i);
|
||||
void cereal_get_ThermalData(struct cereal_ThermalData*, cereal_ThermalData_list, int i);
|
||||
void cereal_get_HealthData(struct cereal_HealthData*, cereal_HealthData_list, int i);
|
||||
@@ -641,6 +685,7 @@ void cereal_set_FrameData(const struct cereal_FrameData*, cereal_FrameData_list,
|
||||
void cereal_set_GPSNMEAData(const struct cereal_GPSNMEAData*, cereal_GPSNMEAData_list, int i);
|
||||
void cereal_set_SensorEventData(const struct cereal_SensorEventData*, cereal_SensorEventData_list, int i);
|
||||
void cereal_set_SensorEventData_SensorVec(const struct cereal_SensorEventData_SensorVec*, cereal_SensorEventData_SensorVec_list, int i);
|
||||
void cereal_set_GpsLocationData(const struct cereal_GpsLocationData*, cereal_GpsLocationData_list, int i);
|
||||
void cereal_set_CanData(const struct cereal_CanData*, cereal_CanData_list, int i);
|
||||
void cereal_set_ThermalData(const struct cereal_ThermalData*, cereal_ThermalData_list, int i);
|
||||
void cereal_set_HealthData(const struct cereal_HealthData*, cereal_HealthData_list, int i);
|
||||
|
||||
1504
cereal/gen/cpp/car.capnp.c++
Normal file
1504
cereal/gen/cpp/car.capnp.c++
Normal file
File diff suppressed because it is too large
Load Diff
2032
cereal/gen/cpp/car.capnp.h
Normal file
2032
cereal/gen/cpp/car.capnp.h
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -10,6 +10,7 @@
|
||||
#error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library."
|
||||
#endif
|
||||
|
||||
#include "car.capnp.h"
|
||||
|
||||
namespace capnp {
|
||||
namespace schemas {
|
||||
@@ -20,6 +21,15 @@ CAPNP_DECLARE_SCHEMA(ea0245f695ae0a33);
|
||||
CAPNP_DECLARE_SCHEMA(9d291d7813ba4a88);
|
||||
CAPNP_DECLARE_SCHEMA(a2b29a69d44529a1);
|
||||
CAPNP_DECLARE_SCHEMA(a43429bd2bfc24fc);
|
||||
CAPNP_DECLARE_SCHEMA(e49b3ce8f7f48d0d);
|
||||
enum class SensorSource_e49b3ce8f7f48d0d: uint16_t {
|
||||
ANDROID,
|
||||
I_O_S,
|
||||
FIBER,
|
||||
VELODYNE,
|
||||
};
|
||||
CAPNP_DECLARE_ENUM(SensorSource, e49b3ce8f7f48d0d);
|
||||
CAPNP_DECLARE_SCHEMA(e946524859add50e);
|
||||
CAPNP_DECLARE_SCHEMA(8785009a964c7c59);
|
||||
CAPNP_DECLARE_SCHEMA(8d8231a40b7fe6e0);
|
||||
CAPNP_DECLARE_SCHEMA(cfa2b0c2c82af1e4);
|
||||
@@ -111,6 +121,8 @@ struct SensorEventData {
|
||||
GYRO,
|
||||
};
|
||||
struct SensorVec;
|
||||
typedef ::capnp::schemas::SensorSource_e49b3ce8f7f48d0d SensorSource;
|
||||
|
||||
|
||||
struct _capnpPrivate {
|
||||
CAPNP_DECLARE_STRUCT_HEADER(a2b29a69d44529a1, 3, 1)
|
||||
@@ -135,6 +147,21 @@ struct SensorEventData::SensorVec {
|
||||
};
|
||||
};
|
||||
|
||||
struct GpsLocationData {
|
||||
GpsLocationData() = delete;
|
||||
|
||||
class Reader;
|
||||
class Builder;
|
||||
class Pipeline;
|
||||
|
||||
struct _capnpPrivate {
|
||||
CAPNP_DECLARE_STRUCT_HEADER(e946524859add50e, 6, 0)
|
||||
#if !CAPNP_LITE
|
||||
static constexpr ::capnp::_::RawBrandedSchema const* brand = &schema->defaultBrand;
|
||||
#endif // !CAPNP_LITE
|
||||
};
|
||||
};
|
||||
|
||||
struct CanData {
|
||||
CanData() = delete;
|
||||
|
||||
@@ -158,7 +185,7 @@ struct ThermalData {
|
||||
class Pipeline;
|
||||
|
||||
struct _capnpPrivate {
|
||||
CAPNP_DECLARE_STRUCT_HEADER(8d8231a40b7fe6e0, 2, 0)
|
||||
CAPNP_DECLARE_STRUCT_HEADER(8d8231a40b7fe6e0, 3, 1)
|
||||
#if !CAPNP_LITE
|
||||
static constexpr ::capnp::_::RawBrandedSchema const* brand = &schema->defaultBrand;
|
||||
#endif // !CAPNP_LITE
|
||||
@@ -438,6 +465,9 @@ struct Event {
|
||||
LOG_MESSAGE,
|
||||
LIVE_CALIBRATION,
|
||||
ANDROID_LOG_ENTRY,
|
||||
GPS_LOCATION,
|
||||
CAR_STATE,
|
||||
CAR_CONTROL,
|
||||
};
|
||||
|
||||
struct _capnpPrivate {
|
||||
@@ -796,6 +826,8 @@ public:
|
||||
inline bool hasGyro() const;
|
||||
inline ::cereal::SensorEventData::SensorVec::Reader getGyro() const;
|
||||
|
||||
inline ::cereal::SensorEventData::SensorSource getSource() const;
|
||||
|
||||
private:
|
||||
::capnp::_::StructReader _reader;
|
||||
template <typename, ::capnp::Kind>
|
||||
@@ -869,6 +901,9 @@ public:
|
||||
inline void adoptGyro(::capnp::Orphan< ::cereal::SensorEventData::SensorVec>&& value);
|
||||
inline ::capnp::Orphan< ::cereal::SensorEventData::SensorVec> disownGyro();
|
||||
|
||||
inline ::cereal::SensorEventData::SensorSource getSource();
|
||||
inline void setSource( ::cereal::SensorEventData::SensorSource value);
|
||||
|
||||
private:
|
||||
::capnp::_::StructBuilder _builder;
|
||||
template <typename, ::capnp::Kind>
|
||||
@@ -982,6 +1017,117 @@ private:
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
class GpsLocationData::Reader {
|
||||
public:
|
||||
typedef GpsLocationData Reads;
|
||||
|
||||
Reader() = default;
|
||||
inline explicit Reader(::capnp::_::StructReader base): _reader(base) {}
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const {
|
||||
return _reader.totalSize().asPublic();
|
||||
}
|
||||
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const {
|
||||
return ::capnp::_::structString(_reader, *_capnpPrivate::brand);
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline ::uint16_t getFlags() const;
|
||||
|
||||
inline double getLatitude() const;
|
||||
|
||||
inline double getLongitude() const;
|
||||
|
||||
inline double getAltitude() const;
|
||||
|
||||
inline float getSpeed() const;
|
||||
|
||||
inline float getBearing() const;
|
||||
|
||||
inline float getAccuracy() const;
|
||||
|
||||
inline ::int64_t getTimestamp() const;
|
||||
|
||||
private:
|
||||
::capnp::_::StructReader _reader;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::List;
|
||||
friend class ::capnp::MessageBuilder;
|
||||
friend class ::capnp::Orphanage;
|
||||
};
|
||||
|
||||
class GpsLocationData::Builder {
|
||||
public:
|
||||
typedef GpsLocationData Builds;
|
||||
|
||||
Builder() = delete; // Deleted to discourage incorrect usage.
|
||||
// You can explicitly initialize to nullptr instead.
|
||||
inline Builder(decltype(nullptr)) {}
|
||||
inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {}
|
||||
inline operator Reader() const { return Reader(_builder.asReader()); }
|
||||
inline Reader asReader() const { return *this; }
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); }
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const { return asReader().toString(); }
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline ::uint16_t getFlags();
|
||||
inline void setFlags( ::uint16_t value);
|
||||
|
||||
inline double getLatitude();
|
||||
inline void setLatitude(double value);
|
||||
|
||||
inline double getLongitude();
|
||||
inline void setLongitude(double value);
|
||||
|
||||
inline double getAltitude();
|
||||
inline void setAltitude(double value);
|
||||
|
||||
inline float getSpeed();
|
||||
inline void setSpeed(float value);
|
||||
|
||||
inline float getBearing();
|
||||
inline void setBearing(float value);
|
||||
|
||||
inline float getAccuracy();
|
||||
inline void setAccuracy(float value);
|
||||
|
||||
inline ::int64_t getTimestamp();
|
||||
inline void setTimestamp( ::int64_t value);
|
||||
|
||||
private:
|
||||
::capnp::_::StructBuilder _builder;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
friend class ::capnp::Orphanage;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
};
|
||||
|
||||
#if !CAPNP_LITE
|
||||
class GpsLocationData::Pipeline {
|
||||
public:
|
||||
typedef GpsLocationData Pipelines;
|
||||
|
||||
inline Pipeline(decltype(nullptr)): _typeless(nullptr) {}
|
||||
inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless)
|
||||
: _typeless(kj::mv(typeless)) {}
|
||||
|
||||
private:
|
||||
::capnp::AnyPointer::Pipeline _typeless;
|
||||
friend class ::capnp::PipelineHook;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
class CanData::Reader {
|
||||
public:
|
||||
typedef CanData Reads;
|
||||
@@ -1109,6 +1255,13 @@ public:
|
||||
|
||||
inline ::uint32_t getBat() const;
|
||||
|
||||
inline float getFreeSpace() const;
|
||||
|
||||
inline ::int16_t getBatteryPercent() const;
|
||||
|
||||
inline bool hasBatteryStatus() const;
|
||||
inline ::capnp::Text::Reader getBatteryStatus() const;
|
||||
|
||||
private:
|
||||
::capnp::_::StructReader _reader;
|
||||
template <typename, ::capnp::Kind>
|
||||
@@ -1158,6 +1311,19 @@ public:
|
||||
inline ::uint32_t getBat();
|
||||
inline void setBat( ::uint32_t value);
|
||||
|
||||
inline float getFreeSpace();
|
||||
inline void setFreeSpace(float value);
|
||||
|
||||
inline ::int16_t getBatteryPercent();
|
||||
inline void setBatteryPercent( ::int16_t value);
|
||||
|
||||
inline bool hasBatteryStatus();
|
||||
inline ::capnp::Text::Builder getBatteryStatus();
|
||||
inline void setBatteryStatus( ::capnp::Text::Reader value);
|
||||
inline ::capnp::Text::Builder initBatteryStatus(unsigned int size);
|
||||
inline void adoptBatteryStatus(::capnp::Orphan< ::capnp::Text>&& value);
|
||||
inline ::capnp::Orphan< ::capnp::Text> disownBatteryStatus();
|
||||
|
||||
private:
|
||||
::capnp::_::StructBuilder _builder;
|
||||
template <typename, ::capnp::Kind>
|
||||
@@ -1211,6 +1377,8 @@ public:
|
||||
|
||||
inline bool getGasInterceptorDetected() const;
|
||||
|
||||
inline bool getStartedSignalDetected() const;
|
||||
|
||||
private:
|
||||
::capnp::_::StructReader _reader;
|
||||
template <typename, ::capnp::Kind>
|
||||
@@ -1254,6 +1422,9 @@ public:
|
||||
inline bool getGasInterceptorDetected();
|
||||
inline void setGasInterceptorDetected(bool value);
|
||||
|
||||
inline bool getStartedSignalDetected();
|
||||
inline void setStartedSignalDetected(bool value);
|
||||
|
||||
private:
|
||||
::capnp::_::StructBuilder _builder;
|
||||
template <typename, ::capnp::Kind>
|
||||
@@ -1398,12 +1569,12 @@ public:
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline bool hasWarpMatrix() const;
|
||||
inline ::capnp::List<float>::Reader getWarpMatrix() const;
|
||||
inline bool hasWarpMatrixDEPRECATED() const;
|
||||
inline ::capnp::List<float>::Reader getWarpMatrixDEPRECATED() const;
|
||||
|
||||
inline float getAngleOffset() const;
|
||||
inline float getAngleOffsetDEPRECATED() const;
|
||||
|
||||
inline ::int8_t getCalStatus() const;
|
||||
inline ::int8_t getCalStatusDEPRECATED() const;
|
||||
|
||||
inline bool hasLeadOne() const;
|
||||
inline ::cereal::Live20Data::LeadData::Reader getLeadOne() const;
|
||||
@@ -1417,9 +1588,9 @@ public:
|
||||
|
||||
inline ::uint64_t getFtMonoTime() const;
|
||||
|
||||
inline ::int32_t getCalCycle() const;
|
||||
inline ::int32_t getCalCycleDEPRECATED() const;
|
||||
|
||||
inline ::int8_t getCalPerc() const;
|
||||
inline ::int8_t getCalPercDEPRECATED() const;
|
||||
|
||||
inline bool hasCanMonoTimes() const;
|
||||
inline ::capnp::List< ::uint64_t>::Reader getCanMonoTimes() const;
|
||||
@@ -1452,19 +1623,19 @@ public:
|
||||
inline ::kj::StringTree toString() const { return asReader().toString(); }
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline bool hasWarpMatrix();
|
||||
inline ::capnp::List<float>::Builder getWarpMatrix();
|
||||
inline void setWarpMatrix( ::capnp::List<float>::Reader value);
|
||||
inline void setWarpMatrix(::kj::ArrayPtr<const float> value);
|
||||
inline ::capnp::List<float>::Builder initWarpMatrix(unsigned int size);
|
||||
inline void adoptWarpMatrix(::capnp::Orphan< ::capnp::List<float>>&& value);
|
||||
inline ::capnp::Orphan< ::capnp::List<float>> disownWarpMatrix();
|
||||
inline bool hasWarpMatrixDEPRECATED();
|
||||
inline ::capnp::List<float>::Builder getWarpMatrixDEPRECATED();
|
||||
inline void setWarpMatrixDEPRECATED( ::capnp::List<float>::Reader value);
|
||||
inline void setWarpMatrixDEPRECATED(::kj::ArrayPtr<const float> value);
|
||||
inline ::capnp::List<float>::Builder initWarpMatrixDEPRECATED(unsigned int size);
|
||||
inline void adoptWarpMatrixDEPRECATED(::capnp::Orphan< ::capnp::List<float>>&& value);
|
||||
inline ::capnp::Orphan< ::capnp::List<float>> disownWarpMatrixDEPRECATED();
|
||||
|
||||
inline float getAngleOffset();
|
||||
inline void setAngleOffset(float value);
|
||||
inline float getAngleOffsetDEPRECATED();
|
||||
inline void setAngleOffsetDEPRECATED(float value);
|
||||
|
||||
inline ::int8_t getCalStatus();
|
||||
inline void setCalStatus( ::int8_t value);
|
||||
inline ::int8_t getCalStatusDEPRECATED();
|
||||
inline void setCalStatusDEPRECATED( ::int8_t value);
|
||||
|
||||
inline bool hasLeadOne();
|
||||
inline ::cereal::Live20Data::LeadData::Builder getLeadOne();
|
||||
@@ -1489,11 +1660,11 @@ public:
|
||||
inline ::uint64_t getFtMonoTime();
|
||||
inline void setFtMonoTime( ::uint64_t value);
|
||||
|
||||
inline ::int32_t getCalCycle();
|
||||
inline void setCalCycle( ::int32_t value);
|
||||
inline ::int32_t getCalCycleDEPRECATED();
|
||||
inline void setCalCycleDEPRECATED( ::int32_t value);
|
||||
|
||||
inline ::int8_t getCalPerc();
|
||||
inline void setCalPerc( ::int8_t value);
|
||||
inline ::int8_t getCalPercDEPRECATED();
|
||||
inline void setCalPercDEPRECATED( ::int8_t value);
|
||||
|
||||
inline bool hasCanMonoTimes();
|
||||
inline ::capnp::List< ::uint64_t>::Builder getCanMonoTimes();
|
||||
@@ -1899,7 +2070,7 @@ public:
|
||||
|
||||
inline float getVEgo() const;
|
||||
|
||||
inline float getAEgo() const;
|
||||
inline float getAEgoDEPRECATED() const;
|
||||
|
||||
inline float getVPid() const;
|
||||
|
||||
@@ -1925,7 +2096,7 @@ public:
|
||||
|
||||
inline float getAngleSteers() const;
|
||||
|
||||
inline ::int32_t getHudLead() const;
|
||||
inline ::int32_t getHudLeadDEPRECATED() const;
|
||||
|
||||
inline float getCumLagMs() const;
|
||||
|
||||
@@ -1985,8 +2156,8 @@ public:
|
||||
inline float getVEgo();
|
||||
inline void setVEgo(float value);
|
||||
|
||||
inline float getAEgo();
|
||||
inline void setAEgo(float value);
|
||||
inline float getAEgoDEPRECATED();
|
||||
inline void setAEgoDEPRECATED(float value);
|
||||
|
||||
inline float getVPid();
|
||||
inline void setVPid(float value);
|
||||
@@ -2024,8 +2195,8 @@ public:
|
||||
inline float getAngleSteers();
|
||||
inline void setAngleSteers(float value);
|
||||
|
||||
inline ::int32_t getHudLead();
|
||||
inline void setHudLead( ::int32_t value);
|
||||
inline ::int32_t getHudLeadDEPRECATED();
|
||||
inline void setHudLeadDEPRECATED( ::int32_t value);
|
||||
|
||||
inline float getCumLagMs();
|
||||
inline void setCumLagMs(float value);
|
||||
@@ -3117,6 +3288,18 @@ public:
|
||||
inline bool hasAndroidLogEntry() const;
|
||||
inline ::cereal::AndroidLogEntry::Reader getAndroidLogEntry() const;
|
||||
|
||||
inline bool isGpsLocation() const;
|
||||
inline bool hasGpsLocation() const;
|
||||
inline ::cereal::GpsLocationData::Reader getGpsLocation() const;
|
||||
|
||||
inline bool isCarState() const;
|
||||
inline bool hasCarState() const;
|
||||
inline ::cereal::CarState::Reader getCarState() const;
|
||||
|
||||
inline bool isCarControl() const;
|
||||
inline bool hasCarControl() const;
|
||||
inline ::cereal::CarControl::Reader getCarControl() const;
|
||||
|
||||
private:
|
||||
::capnp::_::StructReader _reader;
|
||||
template <typename, ::capnp::Kind>
|
||||
@@ -3309,6 +3492,30 @@ public:
|
||||
inline void adoptAndroidLogEntry(::capnp::Orphan< ::cereal::AndroidLogEntry>&& value);
|
||||
inline ::capnp::Orphan< ::cereal::AndroidLogEntry> disownAndroidLogEntry();
|
||||
|
||||
inline bool isGpsLocation();
|
||||
inline bool hasGpsLocation();
|
||||
inline ::cereal::GpsLocationData::Builder getGpsLocation();
|
||||
inline void setGpsLocation( ::cereal::GpsLocationData::Reader value);
|
||||
inline ::cereal::GpsLocationData::Builder initGpsLocation();
|
||||
inline void adoptGpsLocation(::capnp::Orphan< ::cereal::GpsLocationData>&& value);
|
||||
inline ::capnp::Orphan< ::cereal::GpsLocationData> disownGpsLocation();
|
||||
|
||||
inline bool isCarState();
|
||||
inline bool hasCarState();
|
||||
inline ::cereal::CarState::Builder getCarState();
|
||||
inline void setCarState( ::cereal::CarState::Reader value);
|
||||
inline ::cereal::CarState::Builder initCarState();
|
||||
inline void adoptCarState(::capnp::Orphan< ::cereal::CarState>&& value);
|
||||
inline ::capnp::Orphan< ::cereal::CarState> disownCarState();
|
||||
|
||||
inline bool isCarControl();
|
||||
inline bool hasCarControl();
|
||||
inline ::cereal::CarControl::Builder getCarControl();
|
||||
inline void setCarControl( ::cereal::CarControl::Reader value);
|
||||
inline ::cereal::CarControl::Builder initCarControl();
|
||||
inline void adoptCarControl(::capnp::Orphan< ::cereal::CarControl>&& value);
|
||||
inline ::capnp::Orphan< ::cereal::CarControl> disownCarControl();
|
||||
|
||||
private:
|
||||
::capnp::_::StructBuilder _builder;
|
||||
template <typename, ::capnp::Kind>
|
||||
@@ -3884,6 +4091,20 @@ inline ::capnp::Orphan< ::cereal::SensorEventData::SensorVec> SensorEventData::B
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline ::cereal::SensorEventData::SensorSource SensorEventData::Reader::getSource() const {
|
||||
return _reader.getDataField< ::cereal::SensorEventData::SensorSource>(
|
||||
7 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline ::cereal::SensorEventData::SensorSource SensorEventData::Builder::getSource() {
|
||||
return _builder.getDataField< ::cereal::SensorEventData::SensorSource>(
|
||||
7 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void SensorEventData::Builder::setSource( ::cereal::SensorEventData::SensorSource value) {
|
||||
_builder.setDataField< ::cereal::SensorEventData::SensorSource>(
|
||||
7 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline bool SensorEventData::SensorVec::Reader::hasV() const {
|
||||
return !_reader.getPointerField(0 * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
@@ -3934,6 +4155,118 @@ inline void SensorEventData::SensorVec::Builder::setStatus( ::int8_t value) {
|
||||
0 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline ::uint16_t GpsLocationData::Reader::getFlags() const {
|
||||
return _reader.getDataField< ::uint16_t>(
|
||||
0 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline ::uint16_t GpsLocationData::Builder::getFlags() {
|
||||
return _builder.getDataField< ::uint16_t>(
|
||||
0 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void GpsLocationData::Builder::setFlags( ::uint16_t value) {
|
||||
_builder.setDataField< ::uint16_t>(
|
||||
0 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline double GpsLocationData::Reader::getLatitude() const {
|
||||
return _reader.getDataField<double>(
|
||||
1 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline double GpsLocationData::Builder::getLatitude() {
|
||||
return _builder.getDataField<double>(
|
||||
1 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void GpsLocationData::Builder::setLatitude(double value) {
|
||||
_builder.setDataField<double>(
|
||||
1 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline double GpsLocationData::Reader::getLongitude() const {
|
||||
return _reader.getDataField<double>(
|
||||
2 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline double GpsLocationData::Builder::getLongitude() {
|
||||
return _builder.getDataField<double>(
|
||||
2 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void GpsLocationData::Builder::setLongitude(double value) {
|
||||
_builder.setDataField<double>(
|
||||
2 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline double GpsLocationData::Reader::getAltitude() const {
|
||||
return _reader.getDataField<double>(
|
||||
3 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline double GpsLocationData::Builder::getAltitude() {
|
||||
return _builder.getDataField<double>(
|
||||
3 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void GpsLocationData::Builder::setAltitude(double value) {
|
||||
_builder.setDataField<double>(
|
||||
3 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline float GpsLocationData::Reader::getSpeed() const {
|
||||
return _reader.getDataField<float>(
|
||||
1 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline float GpsLocationData::Builder::getSpeed() {
|
||||
return _builder.getDataField<float>(
|
||||
1 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void GpsLocationData::Builder::setSpeed(float value) {
|
||||
_builder.setDataField<float>(
|
||||
1 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline float GpsLocationData::Reader::getBearing() const {
|
||||
return _reader.getDataField<float>(
|
||||
8 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline float GpsLocationData::Builder::getBearing() {
|
||||
return _builder.getDataField<float>(
|
||||
8 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void GpsLocationData::Builder::setBearing(float value) {
|
||||
_builder.setDataField<float>(
|
||||
8 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline float GpsLocationData::Reader::getAccuracy() const {
|
||||
return _reader.getDataField<float>(
|
||||
9 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline float GpsLocationData::Builder::getAccuracy() {
|
||||
return _builder.getDataField<float>(
|
||||
9 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void GpsLocationData::Builder::setAccuracy(float value) {
|
||||
_builder.setDataField<float>(
|
||||
9 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline ::int64_t GpsLocationData::Reader::getTimestamp() const {
|
||||
return _reader.getDataField< ::int64_t>(
|
||||
5 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline ::int64_t GpsLocationData::Builder::getTimestamp() {
|
||||
return _builder.getDataField< ::int64_t>(
|
||||
5 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void GpsLocationData::Builder::setTimestamp( ::int64_t value) {
|
||||
_builder.setDataField< ::int64_t>(
|
||||
5 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline ::uint32_t CanData::Reader::getAddress() const {
|
||||
return _reader.getDataField< ::uint32_t>(
|
||||
0 * ::capnp::ELEMENTS);
|
||||
@@ -4106,6 +4439,66 @@ inline void ThermalData::Builder::setBat( ::uint32_t value) {
|
||||
3 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline float ThermalData::Reader::getFreeSpace() const {
|
||||
return _reader.getDataField<float>(
|
||||
4 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline float ThermalData::Builder::getFreeSpace() {
|
||||
return _builder.getDataField<float>(
|
||||
4 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void ThermalData::Builder::setFreeSpace(float value) {
|
||||
_builder.setDataField<float>(
|
||||
4 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline ::int16_t ThermalData::Reader::getBatteryPercent() const {
|
||||
return _reader.getDataField< ::int16_t>(
|
||||
10 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline ::int16_t ThermalData::Builder::getBatteryPercent() {
|
||||
return _builder.getDataField< ::int16_t>(
|
||||
10 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void ThermalData::Builder::setBatteryPercent( ::int16_t value) {
|
||||
_builder.setDataField< ::int16_t>(
|
||||
10 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline bool ThermalData::Reader::hasBatteryStatus() const {
|
||||
return !_reader.getPointerField(0 * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool ThermalData::Builder::hasBatteryStatus() {
|
||||
return !_builder.getPointerField(0 * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::capnp::Text::Reader ThermalData::Reader::getBatteryStatus() const {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(
|
||||
_reader.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::capnp::Text::Builder ThermalData::Builder::getBatteryStatus() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
inline void ThermalData::Builder::setBatteryStatus( ::capnp::Text::Reader value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::Text>::set(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::capnp::Text::Builder ThermalData::Builder::initBatteryStatus(unsigned int size) {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::init(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS), size);
|
||||
}
|
||||
inline void ThermalData::Builder::adoptBatteryStatus(
|
||||
::capnp::Orphan< ::capnp::Text>&& value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::Text>::adopt(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::capnp::Text> ThermalData::Builder::disownBatteryStatus() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline ::uint32_t HealthData::Reader::getVoltage() const {
|
||||
return _reader.getDataField< ::uint32_t>(
|
||||
0 * ::capnp::ELEMENTS);
|
||||
@@ -4176,6 +4569,20 @@ inline void HealthData::Builder::setGasInterceptorDetected(bool value) {
|
||||
66 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline bool HealthData::Reader::getStartedSignalDetected() const {
|
||||
return _reader.getDataField<bool>(
|
||||
67 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline bool HealthData::Builder::getStartedSignalDetected() {
|
||||
return _builder.getDataField<bool>(
|
||||
67 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void HealthData::Builder::setStartedSignalDetected(bool value) {
|
||||
_builder.setDataField<bool>(
|
||||
67 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline bool LiveUI::Reader::getRearViewCam() const {
|
||||
return _reader.getDataField<bool>(
|
||||
0 * ::capnp::ELEMENTS);
|
||||
@@ -4268,66 +4675,66 @@ inline void LiveUI::Builder::setAwarenessStatus(float value) {
|
||||
1 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline bool Live20Data::Reader::hasWarpMatrix() const {
|
||||
inline bool Live20Data::Reader::hasWarpMatrixDEPRECATED() const {
|
||||
return !_reader.getPointerField(0 * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool Live20Data::Builder::hasWarpMatrix() {
|
||||
inline bool Live20Data::Builder::hasWarpMatrixDEPRECATED() {
|
||||
return !_builder.getPointerField(0 * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::capnp::List<float>::Reader Live20Data::Reader::getWarpMatrix() const {
|
||||
inline ::capnp::List<float>::Reader Live20Data::Reader::getWarpMatrixDEPRECATED() const {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List<float>>::get(
|
||||
_reader.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::capnp::List<float>::Builder Live20Data::Builder::getWarpMatrix() {
|
||||
inline ::capnp::List<float>::Builder Live20Data::Builder::getWarpMatrixDEPRECATED() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List<float>>::get(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
inline void Live20Data::Builder::setWarpMatrix( ::capnp::List<float>::Reader value) {
|
||||
inline void Live20Data::Builder::setWarpMatrixDEPRECATED( ::capnp::List<float>::Reader value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::List<float>>::set(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline void Live20Data::Builder::setWarpMatrix(::kj::ArrayPtr<const float> value) {
|
||||
inline void Live20Data::Builder::setWarpMatrixDEPRECATED(::kj::ArrayPtr<const float> value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::List<float>>::set(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::capnp::List<float>::Builder Live20Data::Builder::initWarpMatrix(unsigned int size) {
|
||||
inline ::capnp::List<float>::Builder Live20Data::Builder::initWarpMatrixDEPRECATED(unsigned int size) {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List<float>>::init(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS), size);
|
||||
}
|
||||
inline void Live20Data::Builder::adoptWarpMatrix(
|
||||
inline void Live20Data::Builder::adoptWarpMatrixDEPRECATED(
|
||||
::capnp::Orphan< ::capnp::List<float>>&& value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::List<float>>::adopt(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::capnp::List<float>> Live20Data::Builder::disownWarpMatrix() {
|
||||
inline ::capnp::Orphan< ::capnp::List<float>> Live20Data::Builder::disownWarpMatrixDEPRECATED() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List<float>>::disown(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline float Live20Data::Reader::getAngleOffset() const {
|
||||
inline float Live20Data::Reader::getAngleOffsetDEPRECATED() const {
|
||||
return _reader.getDataField<float>(
|
||||
0 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline float Live20Data::Builder::getAngleOffset() {
|
||||
inline float Live20Data::Builder::getAngleOffsetDEPRECATED() {
|
||||
return _builder.getDataField<float>(
|
||||
0 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void Live20Data::Builder::setAngleOffset(float value) {
|
||||
inline void Live20Data::Builder::setAngleOffsetDEPRECATED(float value) {
|
||||
_builder.setDataField<float>(
|
||||
0 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline ::int8_t Live20Data::Reader::getCalStatus() const {
|
||||
inline ::int8_t Live20Data::Reader::getCalStatusDEPRECATED() const {
|
||||
return _reader.getDataField< ::int8_t>(
|
||||
4 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline ::int8_t Live20Data::Builder::getCalStatus() {
|
||||
inline ::int8_t Live20Data::Builder::getCalStatusDEPRECATED() {
|
||||
return _builder.getDataField< ::int8_t>(
|
||||
4 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void Live20Data::Builder::setCalStatus( ::int8_t value) {
|
||||
inline void Live20Data::Builder::setCalStatusDEPRECATED( ::int8_t value) {
|
||||
_builder.setDataField< ::int8_t>(
|
||||
4 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
@@ -4448,30 +4855,30 @@ inline void Live20Data::Builder::setFtMonoTime( ::uint64_t value) {
|
||||
3 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline ::int32_t Live20Data::Reader::getCalCycle() const {
|
||||
inline ::int32_t Live20Data::Reader::getCalCycleDEPRECATED() const {
|
||||
return _reader.getDataField< ::int32_t>(
|
||||
3 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline ::int32_t Live20Data::Builder::getCalCycle() {
|
||||
inline ::int32_t Live20Data::Builder::getCalCycleDEPRECATED() {
|
||||
return _builder.getDataField< ::int32_t>(
|
||||
3 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void Live20Data::Builder::setCalCycle( ::int32_t value) {
|
||||
inline void Live20Data::Builder::setCalCycleDEPRECATED( ::int32_t value) {
|
||||
_builder.setDataField< ::int32_t>(
|
||||
3 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline ::int8_t Live20Data::Reader::getCalPerc() const {
|
||||
inline ::int8_t Live20Data::Reader::getCalPercDEPRECATED() const {
|
||||
return _reader.getDataField< ::int8_t>(
|
||||
5 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline ::int8_t Live20Data::Builder::getCalPerc() {
|
||||
inline ::int8_t Live20Data::Builder::getCalPercDEPRECATED() {
|
||||
return _builder.getDataField< ::int8_t>(
|
||||
5 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void Live20Data::Builder::setCalPerc( ::int8_t value) {
|
||||
inline void Live20Data::Builder::setCalPercDEPRECATED( ::int8_t value) {
|
||||
_builder.setDataField< ::int8_t>(
|
||||
5 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
@@ -4912,16 +5319,16 @@ inline void Live100Data::Builder::setVEgo(float value) {
|
||||
0 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline float Live100Data::Reader::getAEgo() const {
|
||||
inline float Live100Data::Reader::getAEgoDEPRECATED() const {
|
||||
return _reader.getDataField<float>(
|
||||
1 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline float Live100Data::Builder::getAEgo() {
|
||||
inline float Live100Data::Builder::getAEgoDEPRECATED() {
|
||||
return _builder.getDataField<float>(
|
||||
1 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void Live100Data::Builder::setAEgo(float value) {
|
||||
inline void Live100Data::Builder::setAEgoDEPRECATED(float value) {
|
||||
_builder.setDataField<float>(
|
||||
1 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
@@ -5094,16 +5501,16 @@ inline void Live100Data::Builder::setAngleSteers(float value) {
|
||||
13 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline ::int32_t Live100Data::Reader::getHudLead() const {
|
||||
inline ::int32_t Live100Data::Reader::getHudLeadDEPRECATED() const {
|
||||
return _reader.getDataField< ::int32_t>(
|
||||
14 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline ::int32_t Live100Data::Builder::getHudLead() {
|
||||
inline ::int32_t Live100Data::Builder::getHudLeadDEPRECATED() {
|
||||
return _builder.getDataField< ::int32_t>(
|
||||
14 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void Live100Data::Builder::setHudLead( ::int32_t value) {
|
||||
inline void Live100Data::Builder::setHudLeadDEPRECATED( ::int32_t value) {
|
||||
_builder.setDataField< ::int32_t>(
|
||||
14 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
@@ -7246,6 +7653,162 @@ inline ::capnp::Orphan< ::cereal::AndroidLogEntry> Event::Builder::disownAndroid
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline bool Event::Reader::isGpsLocation() const {
|
||||
return which() == Event::GPS_LOCATION;
|
||||
}
|
||||
inline bool Event::Builder::isGpsLocation() {
|
||||
return which() == Event::GPS_LOCATION;
|
||||
}
|
||||
inline bool Event::Reader::hasGpsLocation() const {
|
||||
if (which() != Event::GPS_LOCATION) return false;
|
||||
return !_reader.getPointerField(0 * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool Event::Builder::hasGpsLocation() {
|
||||
if (which() != Event::GPS_LOCATION) return false;
|
||||
return !_builder.getPointerField(0 * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::cereal::GpsLocationData::Reader Event::Reader::getGpsLocation() const {
|
||||
KJ_IREQUIRE(which() == Event::GPS_LOCATION,
|
||||
"Must check which() before get()ing a union member.");
|
||||
return ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::get(
|
||||
_reader.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::cereal::GpsLocationData::Builder Event::Builder::getGpsLocation() {
|
||||
KJ_IREQUIRE(which() == Event::GPS_LOCATION,
|
||||
"Must check which() before get()ing a union member.");
|
||||
return ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::get(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
inline void Event::Builder::setGpsLocation( ::cereal::GpsLocationData::Reader value) {
|
||||
_builder.setDataField<Event::Which>(
|
||||
4 * ::capnp::ELEMENTS, Event::GPS_LOCATION);
|
||||
::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::set(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::cereal::GpsLocationData::Builder Event::Builder::initGpsLocation() {
|
||||
_builder.setDataField<Event::Which>(
|
||||
4 * ::capnp::ELEMENTS, Event::GPS_LOCATION);
|
||||
return ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::init(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
inline void Event::Builder::adoptGpsLocation(
|
||||
::capnp::Orphan< ::cereal::GpsLocationData>&& value) {
|
||||
_builder.setDataField<Event::Which>(
|
||||
4 * ::capnp::ELEMENTS, Event::GPS_LOCATION);
|
||||
::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::adopt(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::cereal::GpsLocationData> Event::Builder::disownGpsLocation() {
|
||||
KJ_IREQUIRE(which() == Event::GPS_LOCATION,
|
||||
"Must check which() before get()ing a union member.");
|
||||
return ::capnp::_::PointerHelpers< ::cereal::GpsLocationData>::disown(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline bool Event::Reader::isCarState() const {
|
||||
return which() == Event::CAR_STATE;
|
||||
}
|
||||
inline bool Event::Builder::isCarState() {
|
||||
return which() == Event::CAR_STATE;
|
||||
}
|
||||
inline bool Event::Reader::hasCarState() const {
|
||||
if (which() != Event::CAR_STATE) return false;
|
||||
return !_reader.getPointerField(0 * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool Event::Builder::hasCarState() {
|
||||
if (which() != Event::CAR_STATE) return false;
|
||||
return !_builder.getPointerField(0 * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::cereal::CarState::Reader Event::Reader::getCarState() const {
|
||||
KJ_IREQUIRE(which() == Event::CAR_STATE,
|
||||
"Must check which() before get()ing a union member.");
|
||||
return ::capnp::_::PointerHelpers< ::cereal::CarState>::get(
|
||||
_reader.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::cereal::CarState::Builder Event::Builder::getCarState() {
|
||||
KJ_IREQUIRE(which() == Event::CAR_STATE,
|
||||
"Must check which() before get()ing a union member.");
|
||||
return ::capnp::_::PointerHelpers< ::cereal::CarState>::get(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
inline void Event::Builder::setCarState( ::cereal::CarState::Reader value) {
|
||||
_builder.setDataField<Event::Which>(
|
||||
4 * ::capnp::ELEMENTS, Event::CAR_STATE);
|
||||
::capnp::_::PointerHelpers< ::cereal::CarState>::set(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::cereal::CarState::Builder Event::Builder::initCarState() {
|
||||
_builder.setDataField<Event::Which>(
|
||||
4 * ::capnp::ELEMENTS, Event::CAR_STATE);
|
||||
return ::capnp::_::PointerHelpers< ::cereal::CarState>::init(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
inline void Event::Builder::adoptCarState(
|
||||
::capnp::Orphan< ::cereal::CarState>&& value) {
|
||||
_builder.setDataField<Event::Which>(
|
||||
4 * ::capnp::ELEMENTS, Event::CAR_STATE);
|
||||
::capnp::_::PointerHelpers< ::cereal::CarState>::adopt(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::cereal::CarState> Event::Builder::disownCarState() {
|
||||
KJ_IREQUIRE(which() == Event::CAR_STATE,
|
||||
"Must check which() before get()ing a union member.");
|
||||
return ::capnp::_::PointerHelpers< ::cereal::CarState>::disown(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline bool Event::Reader::isCarControl() const {
|
||||
return which() == Event::CAR_CONTROL;
|
||||
}
|
||||
inline bool Event::Builder::isCarControl() {
|
||||
return which() == Event::CAR_CONTROL;
|
||||
}
|
||||
inline bool Event::Reader::hasCarControl() const {
|
||||
if (which() != Event::CAR_CONTROL) return false;
|
||||
return !_reader.getPointerField(0 * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool Event::Builder::hasCarControl() {
|
||||
if (which() != Event::CAR_CONTROL) return false;
|
||||
return !_builder.getPointerField(0 * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::cereal::CarControl::Reader Event::Reader::getCarControl() const {
|
||||
KJ_IREQUIRE(which() == Event::CAR_CONTROL,
|
||||
"Must check which() before get()ing a union member.");
|
||||
return ::capnp::_::PointerHelpers< ::cereal::CarControl>::get(
|
||||
_reader.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::cereal::CarControl::Builder Event::Builder::getCarControl() {
|
||||
KJ_IREQUIRE(which() == Event::CAR_CONTROL,
|
||||
"Must check which() before get()ing a union member.");
|
||||
return ::capnp::_::PointerHelpers< ::cereal::CarControl>::get(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
inline void Event::Builder::setCarControl( ::cereal::CarControl::Reader value) {
|
||||
_builder.setDataField<Event::Which>(
|
||||
4 * ::capnp::ELEMENTS, Event::CAR_CONTROL);
|
||||
::capnp::_::PointerHelpers< ::cereal::CarControl>::set(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::cereal::CarControl::Builder Event::Builder::initCarControl() {
|
||||
_builder.setDataField<Event::Which>(
|
||||
4 * ::capnp::ELEMENTS, Event::CAR_CONTROL);
|
||||
return ::capnp::_::PointerHelpers< ::cereal::CarControl>::init(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
inline void Event::Builder::adoptCarControl(
|
||||
::capnp::Orphan< ::cereal::CarControl>&& value) {
|
||||
_builder.setDataField<Event::Which>(
|
||||
4 * ::capnp::ELEMENTS, Event::CAR_CONTROL);
|
||||
::capnp::_::PointerHelpers< ::cereal::CarControl>::adopt(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::cereal::CarControl> Event::Builder::disownCarControl() {
|
||||
KJ_IREQUIRE(which() == Event::CAR_CONTROL,
|
||||
"Must check which() before get()ing a union member.");
|
||||
return ::capnp::_::PointerHelpers< ::cereal::CarControl>::disown(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif // CAPNP_INCLUDED_f3b1f17e25a4285b_
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using Cxx = import "c++.capnp";
|
||||
$Cxx.namespace("cereal");
|
||||
|
||||
using Car = import "car.capnp";
|
||||
|
||||
@0xf3b1f17e25a4285b;
|
||||
|
||||
const logVersion :Int32 = 1;
|
||||
@@ -39,11 +41,47 @@ struct SensorEventData {
|
||||
orientation @6 :SensorVec;
|
||||
gyro @7 :SensorVec;
|
||||
}
|
||||
source @8 :SensorSource;
|
||||
|
||||
struct SensorVec {
|
||||
v @0 :List(Float32);
|
||||
status @1 :Int8;
|
||||
}
|
||||
|
||||
enum SensorSource {
|
||||
android @0;
|
||||
iOS @1;
|
||||
fiber @2;
|
||||
velodyne @3; # Velodyne IMU
|
||||
}
|
||||
}
|
||||
|
||||
# android struct GpsLocation
|
||||
struct GpsLocationData {
|
||||
# Contains GpsLocationFlags bits.
|
||||
flags @0 :UInt16;
|
||||
|
||||
# Represents latitude in degrees.
|
||||
latitude @1 :Float64;
|
||||
|
||||
# Represents longitude in degrees.
|
||||
longitude @2 :Float64;
|
||||
|
||||
# Represents altitude in meters above the WGS 84 reference ellipsoid.
|
||||
altitude @3 :Float64;
|
||||
|
||||
# Represents speed in meters per second.
|
||||
speed @4 :Float32;
|
||||
|
||||
# Represents heading in degrees.
|
||||
bearing @5 :Float32;
|
||||
|
||||
# Represents expected accuracy in meters.
|
||||
accuracy @6 :Float32;
|
||||
|
||||
# Timestamp for the location fix.
|
||||
# Milliseconds since January 1, 1970.
|
||||
timestamp @7 :Int64;
|
||||
}
|
||||
|
||||
struct CanData {
|
||||
@@ -61,6 +99,11 @@ struct ThermalData {
|
||||
mem @4 :UInt16;
|
||||
gpu @5 :UInt16;
|
||||
bat @6 :UInt32;
|
||||
|
||||
# not thermal
|
||||
freeSpace @7 :Float32;
|
||||
batteryPercent @8 :Int16;
|
||||
batteryStatus @9: Text;
|
||||
}
|
||||
|
||||
struct HealthData {
|
||||
@@ -70,6 +113,7 @@ struct HealthData {
|
||||
started @2 :Bool;
|
||||
controlsAllowed @3 :Bool;
|
||||
gasInterceptorDetected @4 :Bool;
|
||||
startedSignalDetected @5 :Bool;
|
||||
}
|
||||
|
||||
struct LiveUI {
|
||||
@@ -268,5 +312,8 @@ struct Event {
|
||||
logMessage @18 :Text;
|
||||
liveCalibration @19 :LiveCalibrationData;
|
||||
androidLogEntry @20 :AndroidLogEntry;
|
||||
gpsLocation @21 :GpsLocationData;
|
||||
carState @22 :Car.CarState;
|
||||
carControl @23 :Car.CarControl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,8 @@ DBCSignal = namedtuple(
|
||||
|
||||
class dbc(object):
|
||||
def __init__(self, fn):
|
||||
self.txt = open(fn).read().split("\n")
|
||||
with open(fn) as f:
|
||||
self.txt = f.read().split("\n")
|
||||
self._warned_addresses = set()
|
||||
|
||||
# regexps from https://github.com/ebroecker/canmatrix/blob/master/canmatrix/importdbc.py
|
||||
|
||||
26
common/profiler.py
Normal file
26
common/profiler.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from common.realtime import sec_since_boot
|
||||
|
||||
class Profiler(object):
|
||||
def __init__(self, enabled=False):
|
||||
self.enabled = enabled
|
||||
self.cp = []
|
||||
self.start_time = sec_since_boot()
|
||||
self.last_time = self.start_time
|
||||
|
||||
def checkpoint(self, name):
|
||||
if not self.enabled:
|
||||
return
|
||||
tt = sec_since_boot()
|
||||
self.cp.append((name, tt - self.last_time))
|
||||
self.last_time = tt
|
||||
|
||||
def display(self):
|
||||
if not self.enabled:
|
||||
return
|
||||
print "******* Profiling *******"
|
||||
tot = 0.0
|
||||
for n, ms in self.cp:
|
||||
print "%30s: %7.2f" % (n, ms*1000.0)
|
||||
tot += ms
|
||||
print " TOTAL: %7.2f" % (tot*1000.0)
|
||||
|
||||
@@ -6,6 +6,9 @@ import subprocess
|
||||
import multiprocessing
|
||||
import os
|
||||
|
||||
from ctypes.util import find_library
|
||||
|
||||
|
||||
CLOCK_MONOTONIC_RAW = 4 # see <linux/time.h>
|
||||
CLOCK_BOOTTIME = 7
|
||||
|
||||
@@ -15,28 +18,30 @@ class timespec(ctypes.Structure):
|
||||
('tv_nsec', ctypes.c_long),
|
||||
]
|
||||
|
||||
libc_name = find_library('c')
|
||||
if libc_name is None:
|
||||
platform_name = platform.system()
|
||||
if platform_name.startswith('linux'):
|
||||
libc_name = 'libc.so.6'
|
||||
if platform_name.startswith(('freebsd', 'netbsd')):
|
||||
libc_name = 'libc.so'
|
||||
elif platform_name.lower() == 'darwin':
|
||||
libc_name = 'libc.dylib'
|
||||
|
||||
try:
|
||||
libc = ctypes.CDLL('libc.so', use_errno=True)
|
||||
libc = ctypes.CDLL(libc_name, use_errno=True)
|
||||
except OSError:
|
||||
try:
|
||||
libc = ctypes.CDLL('libc.so.6', use_errno=True)
|
||||
except OSError:
|
||||
libc = None
|
||||
libc = None
|
||||
|
||||
if libc is not None:
|
||||
libc.clock_gettime.argtypes = [ctypes.c_int, ctypes.POINTER(timespec)]
|
||||
|
||||
def clock_gettime(clk_id):
|
||||
if platform.system() == "darwin":
|
||||
# TODO: fix this
|
||||
return time.time()
|
||||
else:
|
||||
t = timespec()
|
||||
if libc.clock_gettime(clk_id, ctypes.pointer(t)) != 0:
|
||||
errno_ = ctypes.get_errno()
|
||||
raise OSError(errno_, os.strerror(errno_))
|
||||
return t.tv_sec + t.tv_nsec * 1e-9
|
||||
t = timespec()
|
||||
if libc.clock_gettime(clk_id, ctypes.pointer(t)) != 0:
|
||||
errno_ = ctypes.get_errno()
|
||||
raise OSError(errno_, os.strerror(errno_))
|
||||
return t.tv_sec + t.tv_nsec * 1e-9
|
||||
|
||||
def monotonic_time():
|
||||
return clock_gettime(CLOCK_MONOTONIC_RAW)
|
||||
@@ -47,7 +52,7 @@ def sec_since_boot():
|
||||
|
||||
def set_realtime_priority(level):
|
||||
if os.getuid() != 0:
|
||||
print "not setting priority, not root"
|
||||
print("not setting priority, not root")
|
||||
return
|
||||
if platform.machine() == "x86_64":
|
||||
NR_gettid = 186
|
||||
@@ -80,15 +85,19 @@ class Ratekeeper(object):
|
||||
|
||||
# Maintain loop rate by calling this at the end of each loop
|
||||
def keep_time(self):
|
||||
self.monitor_time()
|
||||
lagged = self.monitor_time()
|
||||
if self._remaining > 0:
|
||||
time.sleep(self._remaining)
|
||||
return lagged
|
||||
|
||||
# this only monitor the cumulative lag, but does not enforce a rate
|
||||
def monitor_time(self):
|
||||
lagged = False
|
||||
remaining = self._next_frame_time - sec_since_boot()
|
||||
self._next_frame_time += self._interval
|
||||
if remaining < -self._print_delay_threshold:
|
||||
print self._process_name, "lagging by", round(-remaining * 1000, 2), "ms"
|
||||
print("%s lagging by %.2f ms" % (self._process_name, -remaining * 1000))
|
||||
lagged = True
|
||||
self._frame += 1
|
||||
self._remaining = remaining
|
||||
return lagged
|
||||
|
||||
@@ -33,6 +33,9 @@ service_list = {
|
||||
"logMessage": Service(8018, True),
|
||||
"liveCalibration": Service(8019, True),
|
||||
"androidLog": Service(8020, True),
|
||||
"carState": Service(8021, True),
|
||||
# 8022 is reserved for sshd
|
||||
"carControl": Service(8023, True),
|
||||
}
|
||||
|
||||
# manager -- base process to manage starting and stopping of all others
|
||||
@@ -56,7 +59,7 @@ service_list = {
|
||||
|
||||
# controlsd -- actually drives the car
|
||||
# subscribes: can, thermal, model, live20
|
||||
# publishes: sendcan, live100
|
||||
# publishes: carState, carControl, sendcan, live100
|
||||
|
||||
# radard -- processes the radar data
|
||||
# subscribes: can, live100, model
|
||||
|
||||
@@ -15,7 +15,7 @@ NS_ :
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
@@ -33,263 +33,292 @@ NS_ :
|
||||
|
||||
BS_:
|
||||
|
||||
BO_ 0x039 XXX: 3 XXX
|
||||
|
||||
BO_ 0x091 XXX: 8 XXX
|
||||
SG_ LAT_ACCEL : 0|10@1+ (0.02,-512) [-20|20] "m/s2" Vector__XXX
|
||||
|
||||
BO_ 0x0E4 STEERING_CONTROL: 5 ADAS
|
||||
SG_ STEER_TORQUE : 0|16@1- (1,0) [-3840|3840] "" Vector__XXX
|
||||
SG_ STEER_TORQUE_REQUEST : 16|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ SET_ME_X00 : 17|7@1+ (1,0) [0|127] "" Vector__XXX
|
||||
SG_ SET_ME_X00 : 24|8@1+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ COUNTER : 34|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 36|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x130 GAS_PEDAL2: 8 PCM
|
||||
SG_ ENGINE_TORQUE_ESTIMATE : 0|16@1- (1,0) [-1000|1000] "Nm" Vector__XXX
|
||||
SG_ ENGINE_TORQUE_REQUEST : 16|16@1- (1,0) [-1000|1000] "Nm" Vector__XXX
|
||||
SG_ CAR_GAS : 32|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
|
||||
BO_ 0x13C GAS_PEDAL: 8 PCM
|
||||
SG_ CAR_GAS : 32|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
|
||||
BO_ 0x156 STEERING_SENSORS: 6 EPS
|
||||
SG_ STEER_ANGLE : 0|16@1- (-0.1,0) [-500|500] "deg" Vector__XXX
|
||||
SG_ STEER_ANGLE_RATE : 16|16@1- (1,0) [-3000|3000] "deg/s" Vector__XXX
|
||||
SG_ COUNTER : 42|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 44|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x158 POWERTRAIN_DATA: 8 PCM
|
||||
SG_ XMISSION_SPEED : 0|16@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ ENGINE_RPM : 16|16@1+ (1,0) [0|15000] "rpm" Vector__XXX
|
||||
SG_ XMISSION_SPEED2 : 32|16@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x17C POWERTRAIN_DATA2: 8 PCM
|
||||
SG_ PEDAL_GAS : 0|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ ENGINE_RPM : 16|16@1+ (1,0) [0|15000] "rpm" Vector__XXX
|
||||
SG_ GAS_PRESSED : 32|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ ACC_STATUS : 33|1@1+ (1,0) [0|1] "rpm" Vector__XXX
|
||||
SG_ BOH_17C : 34|5@1+ (1,0) [0|1] "rpm" Vector__XXX
|
||||
SG_ BRAKE_LIGHTS_ON : 39|1@1+ (1,0) [0|1] "rpm" Vector__XXX
|
||||
SG_ BOH2_17C : 40|10@1+ (1,0) [0|1] "rpm" Vector__XXX
|
||||
SG_ BRAKE_PRESSED : 50|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BOH3_17C : 51|5@1+ (1,0) [0|1] "rpm" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x18E XXX: 3 XXX
|
||||
|
||||
BO_ 0x18F STEER_STATUS: 7 EPS
|
||||
SG_ STEER_TORQUE_SENSOR : 0|16@1- (1,0) [-31000|31000] "tbd" Vector__XXX
|
||||
SG_ STEER_TORQUE_MOTOR : 16|16@1- (1,0) [-31000|31000] "tbd" Vector__XXX
|
||||
SG_ STEER_STATUS : 32|4@1+ (1,0) [0|15] "" Vector__XXX
|
||||
SG_ STEER_CONTROL_ACTIVE : 36|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 50|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 52|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x1A3 GEARBOX: 8 PCM
|
||||
SG_ GEAR : 0|8@1+ (1,0) [0|256] "" Vector__XXX
|
||||
SG_ GEAR_SHIFTER : 36|4@1+ (1,0) [0|15] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x1A4 VSA_STATUS: 8 VSA
|
||||
SG_ USER_BRAKE : 0|16@1+ (0.015625,-103) [0|1000] "" Vector__XXX
|
||||
SG_ ESP_DISABLED : 27|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x1A6 SCM_BUTTONS: 8 SCM
|
||||
SG_ CRUISE_BUTTONS : 0|3@1+ (1,0) [0|7] "" Vector__XXX
|
||||
SG_ LIGHTS_SETTING : 6|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ MAIN_ON : 40|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_SETTING : 44|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x1AC XXX: 8 XXX
|
||||
|
||||
BO_ 0x1B0 STANDSTILL: 7 VSA
|
||||
SG_ WHEELS_MOVING : 11|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BRAKE_ERROR_1 : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BRAKE_ERROR_2 : 14|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 50|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 52|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x1D0 WHEEL_SPEEDS: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 0|15@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ WHEEL_SPEED_FR : 15|15@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ WHEEL_SPEED_RL : 30|15@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ WHEEL_SPEED_RR : 45|15@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x1DC XXX: 4 XXX
|
||||
|
||||
BO_ 0x1EA VEHICLE_DYNAMICS: 8 VSA
|
||||
SG_ LONG_ACCEL : 16|16@1- (0.0015384,0) [-20|20] "m/s2" Vector__XXX
|
||||
|
||||
BO_ 0x1FA BRAKE_COMMAND: 8 ADAS
|
||||
SG_ COMPUTER_BRAKE : 0|10@1+ (0.003906248,0) [0|1] "" Vector__XXX
|
||||
SG_ ZEROS_BOH : 10|5@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COMPUTER_BRAKE_REQUEST : 15|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_BOH2 : 16|3@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_OVERRIDE : 19|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_BOH3 : 20|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_FAULT_CMD : 21|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_CANCEL_CMD : 22|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COMPUTER_BRAKE_REQUEST_2 : 23|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_BOH4 : 24|8@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BRAKE_LIGHTS : 32|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_BOH5 : 33|7@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CHIME : 40|3@1+ (1,0) [0|7] "" Vector__XXX
|
||||
SG_ CRUISE_BOH6 : 43|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ FCW : 44|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CRUISE_BOH7 : 46|10@1+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x200 GAS_COMMAND: 3 ADAS
|
||||
SG_ GAS_COMMAND : 0|16@1+ (0.253984064,-328) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 18|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 20|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x201 GAS_SENSOR: 5 ADAS
|
||||
SG_ INTERCEPTOR_GAS : 0|16@1+ (0.253984064,-328) [0|1] "" Vector__XXX
|
||||
SG_ INTERCEPTOR_GAS2 : 16|16@1+ (0.126992032,-656) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 34|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 36|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x21E XXX: 7 XXX
|
||||
BO_ 0x221 XXX: 4 XXX
|
||||
|
||||
BO_ 0x255 ROUGH_WHEEL_SPEED: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 0|8@1+ (1,0) [0|255] "mph" Vector__XXX
|
||||
SG_ WHEEL_SPEED_FR : 8|8@1+ (1,0) [0|255] "mph" Vector__XXX
|
||||
SG_ WHEEL_SPEED_RL : 16|8@1+ (1,0) [0|255] "mph" Vector__XXX
|
||||
SG_ WHEEL_SPEED_RR : 24|8@1+ (1,0) [0|255] "mph" Vector__XXX
|
||||
SG_ SET_TO_X55 : 32|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ SET_TO_X55 : 40|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
|
||||
BO_ 0x294 SCM_COMMANDS: 8 SCM
|
||||
SG_ RIGHT_BLINKER : 1|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LEFT_BLINKER : 2|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ WIPERS_SPEED : 3|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x305 SEATBELT_STATUS: 7 BDY
|
||||
SG_ SEATBELT_DRIVER_LAMP : 0|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ SEATBELT_DRIVER_LATCHED : 10|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 50|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 52|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x309 XXX: 8 XXX
|
||||
|
||||
BO_ 0x30C ACC_HUD: 8 ADAS
|
||||
SG_ PCM_SPEED : 0|16@1+ (0.002763889,0) [0|100] "m/s" Vector__XXX
|
||||
SG_ PCM_GAS : 16|7@1+ (1,0) [0|127] "" Vector__XXX
|
||||
SG_ ZEROS_BOH : 23|1@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ CRUISE_SPEED : 24|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ DTC_MODE : 32|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BOH : 33|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ ACC_PROBLEM : 34|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ FCM_OFF : 35|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BOH_2 : 36|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ FCM_PROBLEM : 37|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ RADAR_OBSTRUCTED : 38|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ ENABLE_MINI_CAR : 39|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ SET_ME_X03 : 40|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ HUD_LEAD : 42|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ BOH_3 : 44|1@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ BOH_4 : 45|1@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ BOH_5 : 46|1@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CRUISE_CONTROL_LABEL : 47|1@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ HUD_DISTANCE_3 : 51|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x320 XXX: 8 XXX
|
||||
|
||||
BO_ 0x324 CRUISE: 8 PCM
|
||||
SG_ ENGINE_TEMPERATURE : 0|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ BOH : 8|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ TRIP_FUEL_CONSUMED : 16|16@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ CRUISE_SPEED_PCM : 32|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ BOH2 : 40|8@1- (1,0) [0|255] "" Vector__XXX
|
||||
SG_ BOH3 : 48|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x328 XXX: 8 XXX
|
||||
BO_ 0x333 XXX: 7 XXX
|
||||
BO_ 0x335 XXX: 5 XXX
|
||||
|
||||
BO_ 0x33D LKAS_HUD_2: 5 ADAS
|
||||
SG_ CAM_TEMP_HIGH : 0|1@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ BOH : 1|7@1+ (1,0) [0|127] "" Vector__XXX
|
||||
SG_ DASHED_LANES : 9|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ DTC : 10|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LKAS_PROBLEM : 11|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LKAS_OFF : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ SOLID_LANES : 13|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LDW_RIGHT : 14|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ STEERING_REQUIRED : 15|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BOH : 16|2@1+ (1,0) [0|4] "" Vector__XXX
|
||||
SG_ LDW_PROBLEM : 18|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BEEP : 22|2@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LDW_ON : 27|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LDW_OFF : 28|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CLEAN_WINDSHIELD : 29|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ SET_ME_X48 : 24|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ COUNTER : 34|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 36|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BU_: INTERCEPTOR EBCM NEO ADAS PCM EPS VSA SCM BDY XXX
|
||||
|
||||
|
||||
BO_ 0x372 XXX: 2 XXX
|
||||
BO_ 57 XXX_1: 3 XXX
|
||||
|
||||
BO_ 0x374 XXX: 7 XXX
|
||||
BO_ 0x377 XXX: 8 XXX
|
||||
BO_ 0x378 XXX: 8 XXX
|
||||
BO_ 0x37C XXX: 8 XXX
|
||||
BO_ 0x39B XXX: 2 XXX
|
||||
BO_ 0x3A1 XXX: 4 XXX
|
||||
BO_ 0x3D7 XXX: 8 XXX
|
||||
BO_ 0x3D9 XXX: 3 XXX
|
||||
BO_ 0x400 XXX: 5 XXX
|
||||
BO_ 0x403 XXX: 5 XXX
|
||||
BO_ 145 XXX_2: 8 XXX
|
||||
SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" NEO
|
||||
|
||||
BO_ 0x405 DOORS_STATUS: 8 BDY
|
||||
SG_ DOOR_OPEN_FL : 34|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ DOOR_OPEN_FR : 33|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ DOOR_OPEN_RL : 32|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ DOOR_OPEN_RR : 47|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 228 STEERING_CONTROL: 5 ADAS
|
||||
SG_ STEER_TORQUE : 7|16@0- (1,0) [-3840|3840] "" EPS
|
||||
SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS
|
||||
SG_ SET_ME_X00 : 22|7@0+ (1,0) [0|127] "" EPS
|
||||
SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|0] "" EPS
|
||||
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" EPS
|
||||
SG_ CHECKSUM : 35|4@0+ (1,0) [0|3] "" EPS
|
||||
|
||||
BO_ 0x406 XXX: 5 VSA
|
||||
BO_ 0x40A XXX: 5 XXX
|
||||
BO_ 0x40C XXX: 8 XXX
|
||||
BO_ 0x40F XXX: 8 XXX
|
||||
BO_ 0x421 XXX: 5 EPS
|
||||
BO_ 0x428 XXX: 7 XXX
|
||||
BO_ 0x454 XXX: 8 XXX
|
||||
BO_ 0x555 XXX: 5 XXX
|
||||
BO_ 0x640 XXX: 5 XXX
|
||||
BO_ 0x641 XXX: 8 XXX
|
||||
BO_ 304 GAS_PEDAL2: 8 PCM
|
||||
SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" NEO
|
||||
SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" NEO
|
||||
SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" NEO
|
||||
|
||||
VAL_ 0x1A6 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none";
|
||||
VAL_ 0x1A6 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none";
|
||||
VAL_ 0x30C HUD_LEAD 3 "no_car" 2 "solid_car" 1 "dashed_car" 0 "no_car";
|
||||
VAL_ 0x1A6 LIGHTS_SETTING 3 "high_beam" 2 "low_beam" 1 "position" 0 "no_lights";
|
||||
VAL_ 0x18F STEER_STATUS 5 "fault" 4 "no_torque_alert_2" 2 "no_torque_alert_1" 0 "normal";
|
||||
VAL_ 0x1A3 GEAR_SHIFTER 10 "S" 4 "D" 3 "N" 2 "R" 1 "P";
|
||||
VAL_ 0x33D BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep";
|
||||
VAL_ 0x1FA CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime";
|
||||
VAL_ 0x1FA FCW 3 "fcw" 2 "fcw" 1 "fcw" 0 "no_fcw";
|
||||
BO_ 316 GAS_PEDAL: 8 PCM
|
||||
SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" NEO
|
||||
|
||||
BO_ 342 STEERING_SENSORS: 6 EPS
|
||||
SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" NEO
|
||||
SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" NEO
|
||||
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 43|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 344 POWERTRAIN_DATA: 8 PCM
|
||||
SG_ XMISSION_SPEED : 7|16@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" NEO
|
||||
SG_ XMISSION_SPEED2 : 39|16@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 380 POWERTRAIN_DATA2: 8 PCM
|
||||
SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" NEO
|
||||
SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "rpm" NEO
|
||||
SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "rpm" NEO
|
||||
SG_ BRAKE_LIGHTS_ON : 32|1@0+ (1,0) [0|1] "rpm" NEO
|
||||
SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "rpm" NEO
|
||||
SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "rpm" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 398 XXX_3: 3 XXX
|
||||
|
||||
BO_ 399 STEER_STATUS: 7 EPS
|
||||
SG_ STEER_TORQUE_SENSOR : 7|16@0- (1,0) [-31000|31000] "tbd" NEO
|
||||
SG_ STEER_TORQUE_MOTOR : 23|16@0- (1,0) [-31000|31000] "tbd" NEO
|
||||
SG_ STEER_STATUS : 39|4@0+ (1,0) [0|15] "" NEO
|
||||
SG_ STEER_CONTROL_ACTIVE : 35|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 419 GEARBOX: 8 PCM
|
||||
SG_ GEAR : 7|8@0+ (1,0) [0|256] "" NEO
|
||||
SG_ GEAR_SHIFTER : 35|4@0+ (1,0) [0|15] "" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 420 VSA_STATUS: 8 VSA
|
||||
SG_ USER_BRAKE : 7|16@0+ (0.015625,-103) [0|1000] "" NEO
|
||||
SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 422 SCM_BUTTONS: 8 SCM
|
||||
SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" NEO
|
||||
SG_ LIGHTS_SETTING : 1|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ MAIN_ON : 47|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ CRUISE_SETTING : 43|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 428 XXX_4: 8 XXX
|
||||
|
||||
BO_ 432 STANDSTILL: 7 VSA
|
||||
SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 464 WHEEL_SPEEDS: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 7|15@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ WHEEL_SPEED_FR : 8|15@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ WHEEL_SPEED_RL : 25|15@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ WHEEL_SPEED_RR : 42|15@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 476 XXX_5: 4 XXX
|
||||
|
||||
BO_ 490 VEHICLE_DYNAMICS: 8 VSA
|
||||
SG_ LONG_ACCEL : 23|16@0- (0.0015384,0) [-20|20] "m/s2" NEO
|
||||
|
||||
BO_ 506 BRAKE_COMMAND: 8 ADAS
|
||||
SG_ COMPUTER_BRAKE : 7|10@0+ (0.003906248,0) [0|1] "" EBCM
|
||||
SG_ ZEROS_BOH : 13|5@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ COMPUTER_BRAKE_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_BOH2 : 23|3@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_BOH3 : 19|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ COMPUTER_BRAKE_REQUEST_2 : 16|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_BOH4 : 31|8@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_BOH5 : 38|7@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CHIME : 47|3@0+ (1,0) [0|7] "" EBCM
|
||||
SG_ CRUISE_BOH6 : 44|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ FCW : 43|2@0+ (1,0) [0|3] "" EBCM
|
||||
SG_ CRUISE_BOH7 : 41|10@0+ (1,0) [0|0] "" EBCM
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EBCM
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EBCM
|
||||
|
||||
BO_ 512 GAS_COMMAND: 3 NEO
|
||||
SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-328) [0|1] "" INTERCEPTOR
|
||||
SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" INTERCEPTOR
|
||||
SG_ CHECKSUM : 19|4@0+ (1,0) [0|3] "" INTERCEPTOR
|
||||
|
||||
BO_ 513 GAS_SENSOR: 5 INTERCEPTOR
|
||||
SG_ INTERCEPTOR_GAS : 7|16@0+ (0.253984064,-328) [0|1] "" NEO
|
||||
SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.126992032,-656) [0|1] "" NEO
|
||||
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 35|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 542 XXX_6: 7 XXX
|
||||
|
||||
BO_ 545 XXX_7: 4 XXX
|
||||
|
||||
BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" NEO
|
||||
SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" NEO
|
||||
SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" NEO
|
||||
SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" NEO
|
||||
SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ SET_TO_X55 : 47|8@0+ (1,0) [0|255] "" NEO
|
||||
|
||||
BO_ 660 SCM_COMMANDS: 8 SCM
|
||||
SG_ RIGHT_BLINKER : 6|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LEFT_BLINKER : 5|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ WIPERS_SPEED : 4|2@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 773 SEATBELT_STATUS: 7 BDY
|
||||
SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 777 XXX_8: 8 XXX
|
||||
|
||||
BO_ 780 ACC_HUD: 8 ADAS
|
||||
SG_ PCM_SPEED : 7|16@0+ (0.002763889,0) [0|100] "m/s" BDY
|
||||
SG_ PCM_GAS : 23|7@0+ (1,0) [0|127] "" BDY
|
||||
SG_ ZEROS_BOH : 16|1@0+ (1,0) [0|255] "" BDY
|
||||
SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "" BDY
|
||||
SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ FCM_OFF : 36|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH_2 : 35|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_ME_X03 : 47|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ HUD_DISTANCE_3 : 52|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" BDY
|
||||
|
||||
BO_ 800 XXX_9: 8 XXX
|
||||
|
||||
BO_ 804 CRUISE: 8 PCM
|
||||
SG_ ENGINE_TEMPERATURE : 7|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ BOH : 15|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" NEO
|
||||
SG_ CRUISE_SPEED_PCM : 39|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ BOH2 : 47|8@0- (1,0) [0|255] "" NEO
|
||||
SG_ BOH3 : 55|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 808 XXX_10: 8 XXX
|
||||
|
||||
BO_ 819 XXX_11: 7 XXX
|
||||
|
||||
BO_ 821 XXX_12: 5 XXX
|
||||
|
||||
BO_ 829 LKAS_HUD_2: 5 ADAS
|
||||
SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
|
||||
SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
|
||||
SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
|
||||
SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY
|
||||
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CHECKSUM : 35|4@0+ (1,0) [0|3] "" BDY
|
||||
|
||||
BO_ 882 XXX_13: 2 XXX
|
||||
|
||||
BO_ 884 XXX_14: 7 XXX
|
||||
|
||||
BO_ 887 XXX_15: 8 XXX
|
||||
|
||||
BO_ 888 XXX_16: 8 XXX
|
||||
|
||||
BO_ 892 XXX_17: 8 XXX
|
||||
|
||||
BO_ 923 XXX_18: 2 XXX
|
||||
|
||||
BO_ 929 XXX_19: 4 XXX
|
||||
|
||||
BO_ 983 XXX_20: 8 XXX
|
||||
|
||||
BO_ 985 XXX_21: 3 XXX
|
||||
|
||||
BO_ 1024 XXX_22: 5 XXX
|
||||
|
||||
BO_ 1027 XXX_23: 5 XXX
|
||||
|
||||
BO_ 1029 DOORS_STATUS: 8 BDY
|
||||
SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 1030 XXX_24: 5 VSA
|
||||
|
||||
BO_ 1034 XXX_25: 5 XXX
|
||||
|
||||
BO_ 1036 XXX_26: 8 XXX
|
||||
|
||||
BO_ 1039 XXX_27: 8 XXX
|
||||
|
||||
BO_ 1057 XXX_28: 5 EPS
|
||||
|
||||
BO_ 1064 XXX_29: 7 XXX
|
||||
|
||||
BO_ 1108 XXX_30: 8 XXX
|
||||
|
||||
BO_ 1365 XXX_31: 5 XXX
|
||||
|
||||
BO_ 1600 XXX_32: 5 XXX
|
||||
|
||||
BO_ 1601 XXX_33: 8 XXX
|
||||
|
||||
BO_TX_BU_ 228 : NEO,ADAS;
|
||||
BO_TX_BU_ 506 : NEO,ADAS;
|
||||
BO_TX_BU_ 780 : NEO,ADAS;
|
||||
BO_TX_BU_ 829 : NEO,ADAS;
|
||||
|
||||
|
||||
CM_ SG_ 419 GEAR "10 = reverse, 11 = transition";
|
||||
CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping";
|
||||
CM_ SG_ 780 CRUISE_SPEED "255 = no speed";
|
||||
CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed";
|
||||
CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc...";
|
||||
VAL_ 399 STEER_STATUS 5 "fault" 4 "no_torque_alert_2" 2 "no_torque_alert_1" 0 "normal" ;
|
||||
VAL_ 419 GEAR_SHIFTER 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ;
|
||||
VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;
|
||||
VAL_ 422 LIGHTS_SETTING 3 "high_beam" 2 "low_beam" 1 "position" 0 "no_lights" ;
|
||||
VAL_ 422 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none" ;
|
||||
VAL_ 506 CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime" ;
|
||||
VAL_ 506 FCW 3 "fcw" 2 "fcw" 1 "fcw" 0 "no_fcw" ;
|
||||
VAL_ 780 HUD_LEAD 3 "no_car" 2 "solid_car" 1 "dashed_car" 0 "no_car" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
|
||||
CM_ SG_ 0x1A3 GEAR "10 = reverse, 11 = transition";
|
||||
CM_ SG_ 0x324 CRUISE_SPEED_ECHO "255 = no speed";
|
||||
CM_ SG_ 0x33D CRUISE_SPEED "255 = no speed";
|
||||
CM_ SG_ 0x1EA LONG_ACCEL "wheel speed derivative, noisy and zero snapping";
|
||||
CM_ SG_ 0x33D BEEP "beeps are pleasant, chimes are for warnngs etc...";
|
||||
|
||||
@@ -15,7 +15,7 @@ NS_ :
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
@@ -33,143 +33,151 @@ NS_ :
|
||||
|
||||
BS_:
|
||||
|
||||
BU_: ADAS RADAR NEO XXX
|
||||
|
||||
BO_ 0x300 VEHICLE_STATE: 8 ADAS
|
||||
SG_ SET_ME_XF9 : 0|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ VEHICLE_SPEED : 8|8@1+ (1,0) [0|255] "kph" Vector__XXX
|
||||
|
||||
BO_ 0x301 VEHICLE_STATE2: 8 ADAS
|
||||
SG_ SET_ME_0F18510 : 0|28@1+ (1,0) [0|268435455] "" Vector__XXX
|
||||
SG_ SET_ME_25A0000 : 28|28@1+ (1,0) [0|268435455] "" Vector__XXX
|
||||
BO_ 768 VEHICLE_STATE: 8 ADAS
|
||||
SG_ SET_ME_XF9 : 7|8@0+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ VEHICLE_SPEED : 15|8@0+ (1,0) [0|255] "kph" Vector__XXX
|
||||
|
||||
BO_ 0x400 XXX: 8 RADAR
|
||||
BO_ 769 VEHICLE_STATE2: 8 ADAS
|
||||
SG_ SET_ME_0F18510 : 7|28@0+ (1,0) [0|268435455] "" Vector__XXX
|
||||
SG_ SET_ME_25A0000 : 27|28@0+ (1,0) [0|268435455] "" Vector__XXX
|
||||
|
||||
BO_ 0x410 XXX: 8 RADAR
|
||||
BO_ 1024 XXX_100: 8 RADAR
|
||||
|
||||
BO_ 0x411 XXX: 8 RADAR
|
||||
BO_ 1040 XXX_101: 8 RADAR
|
||||
|
||||
BO_ 0x412 XXX: 8 RADAR
|
||||
BO_ 1041 XXX_102: 8 RADAR
|
||||
|
||||
BO_ 0x413 XXX: 8 RADAR
|
||||
BO_ 1042 XXX_103: 8 RADAR
|
||||
|
||||
BO_ 0x414 XXX: 8 RADAR
|
||||
BO_ 1043 XXX_104: 8 RADAR
|
||||
|
||||
BO_ 0x415 XXX: 8 RADAR
|
||||
BO_ 1044 XXX_105: 8 RADAR
|
||||
|
||||
BO_ 0x416 XXX: 8 RADAR
|
||||
BO_ 1045 XXX_106: 8 RADAR
|
||||
|
||||
BO_ 0x417 XXX: 8 RADAR
|
||||
BO_ 1046 XXX_107: 8 RADAR
|
||||
|
||||
BO_ 0x420 XXX: 8 RADAR
|
||||
BO_ 1047 XXX_108: 8 RADAR
|
||||
|
||||
BO_ 0x421 XXX: 8 RADAR
|
||||
BO_ 1056 XXX_109: 8 RADAR
|
||||
|
||||
BO_ 0x422 XXX: 8 RADAR
|
||||
BO_ 1057 XXX_110: 8 RADAR
|
||||
|
||||
BO_ 0x423 XXX: 8 RADAR
|
||||
BO_ 1058 XXX_111: 8 RADAR
|
||||
|
||||
BO_ 0x424 XXX: 8 RADAR
|
||||
BO_ 1059 XXX_112: 8 RADAR
|
||||
|
||||
BO_ 0x430 TRACK_0: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1060 XXX_113: 8 RADAR
|
||||
|
||||
BO_ 0x431 TRACK_1: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1072 TRACK_0: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x432 TRACK_2: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1073 TRACK_1: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x433 TRACK_3: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1074 TRACK_2: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x434 TRACK_4: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1075 TRACK_3: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x435 TRACK_5: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1076 TRACK_4: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x436 TRACK_6: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1077 TRACK_5: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x437 TRACK_7: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1078 TRACK_6: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x438 TRACK_8: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1079 TRACK_7: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x439 TRACK_9: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1080 TRACK_8: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x440 TRACK_10: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1081 TRACK_9: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x441 TRACK_11: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1088 TRACK_10: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x442 TRACK_12: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1089 TRACK_11: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x443 TRACK_13: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1090 TRACK_12: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x444 TRACK_14: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1091 TRACK_13: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x445 TRACK_15: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1092 TRACK_14: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x4FF XXX: 8 RADAR
|
||||
BO_ 1093 TRACK_15: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 1279 XXX_114: 8 RADAR
|
||||
|
||||
BO_ 1280 XXX_115: 8 RADAR
|
||||
|
||||
BO_ 1296 XXX_116: 8 RADAR
|
||||
|
||||
BO_ 1297 XXX_117: 8 RADAR
|
||||
|
||||
BO_TX_BU_ 768 : NEO,ADAS;
|
||||
BO_TX_BU_ 769 : NEO,ADAS;
|
||||
|
||||
BO_ 0x500 XXX: 8 RADAR
|
||||
|
||||
BO_ 0x510 XXX: 8 RADAR
|
||||
|
||||
BO_ 0x511 XXX: 8 RADAR
|
||||
|
||||
@@ -15,7 +15,7 @@ NS_ :
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
@@ -33,287 +33,311 @@ NS_ :
|
||||
|
||||
BS_:
|
||||
|
||||
BO_ 0x039 XXX: 3 XXX
|
||||
BU_: INTERCEPTOR EBCM NEO ADAS PCM EPS VSA SCM BDY XXX EPB
|
||||
|
||||
BO_ 0x94 XXX: 8 XXX
|
||||
SG_ LAT_ACCEL : 0|10@1+ (0.02,-512) [-20|20] "m/s2" Vector__XXX
|
||||
SG_ LONG_ACCEL : 31|9@1- (-0.02,0) [-20|20] "m/s2" Vector__XXX
|
||||
|
||||
BO_ 0x0E4 STEERING_CONTROL: 5 ADAS
|
||||
SG_ STEER_TORQUE : 0|16@1- (1,0) [-3840|3840] "" Vector__XXX
|
||||
SG_ STEER_TORQUE_REQUEST : 16|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ SET_ME_X00 : 17|7@1+ (1,0) [0|127] "" Vector__XXX
|
||||
SG_ SET_ME_X00_2 : 24|8@1+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ CHECKSUM : 32|4@1+ (1,0) [0|15] "" Vector__XXX
|
||||
SG_ COUNTER : 38|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 57 XXX_1: 3 XXX
|
||||
|
||||
BO_ 0x130 GAS_PEDAL2: 8 PCM
|
||||
SG_ ENGINE_TORQUE_ESTIMATE : 0|16@1- (1,0) [-1000|1000] "Nm" Vector__XXX
|
||||
SG_ ENGINE_TORQUE_REQUEST : 16|16@1- (1,0) [-1000|1000] "Nm" Vector__XXX
|
||||
SG_ CAR_GAS : 32|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
BO_ 148 XXX_2: 8 XXX
|
||||
SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" NEO
|
||||
SG_ LONG_ACCEL : 24|9@0- (-0.02,0) [-20|20] "m/s2" NEO
|
||||
|
||||
BO_ 0x14A STEERING_SENSORS: 8 EPS
|
||||
SG_ STEER_ANGLE : 0|16@1- (-0.1,0) [-500|500] "deg" Vector__XXX
|
||||
SG_ STEER_ANGLE_RATE : 16|16@1- (-1,0) [-3000|3000] "deg/s" Vector__XXX
|
||||
SG_ STEER_ANGLE_OFFSET : 32|8@1- (-0.1,0) [-128|127] "deg" Vector__XXX
|
||||
SG_ STEER_WHEEL_ANGLE : 40|16@1- (-0.1,0) [-500|500] "deg" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 228 STEERING_CONTROL: 5 ADAS
|
||||
SG_ STEER_TORQUE : 7|16@0- (1,0) [-3840|3840] "" EPS
|
||||
SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS
|
||||
SG_ SET_ME_X00 : 22|7@0+ (1,0) [0|127] "" EPS
|
||||
SG_ SET_ME_X00_2 : 31|8@0+ (1,0) [0|0] "" EPS
|
||||
SG_ CHECKSUM : 39|4@0+ (1,0) [0|15] "" EPS
|
||||
SG_ COUNTER : 33|2@0+ (1,0) [0|3] "" EPS
|
||||
|
||||
BO_ 0x158 POWERTRAIN_DATA: 8 PCM
|
||||
SG_ XMISSION_SPEED : 0|16@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ ENGINE_RPM : 16|16@1+ (1,0) [0|15000] "rpm" Vector__XXX
|
||||
SG_ XMISSION_SPEED2 : 32|16@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 304 GAS_PEDAL2: 8 PCM
|
||||
SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" NEO
|
||||
SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" NEO
|
||||
SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" NEO
|
||||
|
||||
BO_ 0x17C POWERTRAIN_DATA2: 8 PCM
|
||||
SG_ PEDAL_GAS : 0|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ ENGINE_RPM : 16|16@1+ (1,0) [0|15000] "rpm" Vector__XXX
|
||||
SG_ GAS_PRESSED : 32|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ ACC_STATUS : 33|1@1+ (1,0) [0|1] "rpm" Vector__XXX
|
||||
SG_ BOH_17C : 34|5@1+ (1,0) [0|1] "rpm" Vector__XXX
|
||||
SG_ BRAKE_LIGHTS_ON : 39|1@1+ (1,0) [0|1] "rpm" Vector__XXX
|
||||
SG_ BOH2_17C : 40|10@1+ (1,0) [0|1] "rpm" Vector__XXX
|
||||
SG_ BRAKE_PRESSED : 50|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BOH3_17C : 51|5@1+ (1,0) [0|1] "rpm" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 330 STEERING_SENSORS: 8 EPS
|
||||
SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" NEO
|
||||
SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" NEO
|
||||
SG_ STEER_ANGLE_OFFSET : 39|8@0- (-0.1,0) [-128|127] "deg" NEO
|
||||
SG_ STEER_WHEEL_ANGLE : 47|16@0- (-0.1,0) [-500|500] "deg" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x18F STEER_STATUS: 7 EPS
|
||||
SG_ STEER_TORQUE_SENSOR : 0|16@1- (1,0) [-31000|31000] "tbd" Vector__XXX
|
||||
SG_ STEER_TORQUE_MOTOR : 16|16@1- (1,0) [-31000|31000] "tbd" Vector__XXX
|
||||
SG_ STEER_STATUS : 32|4@1+ (1,0) [0|15] "" Vector__XXX
|
||||
SG_ STEER_CONTROL_ACTIVE : 36|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 50|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 52|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 344 POWERTRAIN_DATA: 8 PCM
|
||||
SG_ XMISSION_SPEED : 7|16@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" NEO
|
||||
SG_ XMISSION_SPEED2 : 39|16@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x191 GEARBOX: 8 PCM
|
||||
SG_ GEAR_SHIFTER : 2|6@1+ (1,0) [0|63] "" Vector__XXX
|
||||
SG_ GEAR : 36|4@1+ (1,0) [0|15] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 380 POWERTRAIN_DATA2: 8 PCM
|
||||
SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" NEO
|
||||
SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "rpm" NEO
|
||||
SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "rpm" NEO
|
||||
SG_ BRAKE_LIGHTS_ON : 32|1@0+ (1,0) [0|1] "rpm" NEO
|
||||
SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "rpm" NEO
|
||||
SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "rpm" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x1A4 VSA_STATUS: 8 VSA
|
||||
SG_ USER_BRAKE : 0|16@1+ (0.015625,-103) [0|1000] "" Vector__XXX
|
||||
SG_ ESP_DISABLED : 27|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 399 STEER_STATUS: 7 EPS
|
||||
SG_ STEER_TORQUE_SENSOR : 7|16@0- (1,0) [-31000|31000] "tbd" NEO
|
||||
SG_ STEER_TORQUE_MOTOR : 23|16@0- (1,0) [-31000|31000] "tbd" NEO
|
||||
SG_ STEER_STATUS : 39|4@0+ (1,0) [0|15] "" NEO
|
||||
SG_ STEER_CONTROL_ACTIVE : 35|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x1AB XXX: 3 VSA
|
||||
BO_ 401 GEARBOX: 8 PCM
|
||||
SG_ GEAR_SHIFTER : 5|6@0+ (1,0) [0|63] "" NEO
|
||||
SG_ GEAR : 35|4@0+ (1,0) [0|15] "" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x1AC XXX: 8 XXX
|
||||
BO_ 420 VSA_STATUS: 8 VSA
|
||||
SG_ USER_BRAKE : 7|16@0+ (0.015625,-103) [0|1000] "" NEO
|
||||
SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x1B0 STANDSTILL: 7 VSA
|
||||
SG_ WHEELS_MOVING : 11|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BRAKE_ERROR_1 : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BRAKE_ERROR_2 : 14|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 50|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 52|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 427 XXX_3: 3 VSA
|
||||
|
||||
BO_ 0x1C2 XXX: 8 EPB
|
||||
SG_ EPB_ACTIVE : 4|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ EPB_STATE : 26|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 428 XXX_4: 8 XXX
|
||||
|
||||
BO_ 0x1D0 WHEEL_SPEEDS: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 0|15@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ WHEEL_SPEED_FR : 15|15@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ WHEEL_SPEED_RL : 30|15@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ WHEEL_SPEED_RR : 45|15@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 432 STANDSTILL: 7 VSA
|
||||
SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x1D6 XXX: 2 VSA
|
||||
BO_ 450 XXX_5: 8 EPB
|
||||
SG_ EPB_ACTIVE : 3|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ EPB_STATE : 29|2@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x1DC XXX: 7 XXX
|
||||
BO_ 464 WHEEL_SPEEDS: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 7|15@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ WHEEL_SPEED_FR : 8|15@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ WHEEL_SPEED_RL : 25|15@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ WHEEL_SPEED_RR : 42|15@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x1E7 XXX: 4 VSA
|
||||
SG_ BRAKE_PRESSURE1 : 0|10@1+ (0.015625,-103) [0|1000] "" Vector__XXX
|
||||
SG_ BRAKE_PRESSURE2 : 14|10@1+ (0.015625,-103) [0|1000] "" Vector__XXX
|
||||
BO_ 470 XXX_6: 2 VSA
|
||||
|
||||
BO_ 0x1EA VEHICLE_DYNAMICS: 8 VSA
|
||||
SG_ LONG_ACCEL : 16|16@1- (0.0015384,0) [-20|20] "m/s2" Vector__XXX
|
||||
BO_ 476 XXX_7: 7 XXX
|
||||
|
||||
BO_ 0x1ED XXX: 5 VSA
|
||||
BO_ 487 XXX_8: 4 VSA
|
||||
SG_ BRAKE_PRESSURE1 : 7|10@0+ (0.015625,-103) [0|1000] "" NEO
|
||||
SG_ BRAKE_PRESSURE2 : 9|10@0+ (0.015625,-103) [0|1000] "" NEO
|
||||
|
||||
BO_ 0x1FA BRAKE_COMMAND: 8 ADAS
|
||||
SG_ COMPUTER_BRAKE : 0|10@1+ (0.003906248,0) [0|1.0] "" Vector__XXX
|
||||
SG_ ZEROS_BOH : 10|5@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COMPUTER_BRAKE_REQUEST : 15|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_BOH2 : 16|3@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_OVERRIDE : 19|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_BOH3 : 20|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_FAULT_CMD : 21|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_CANCEL_CMD : 22|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COMPUTER_BRAKE_REQUEST_2 : 23|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ SET_ME_0X80 : 24|8@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BRAKE_LIGHTS : 32|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_STATES : 33|7@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CHIME : 40|3@1+ (1,0) [0|7] "" Vector__XXX
|
||||
SG_ ZEROS_BOH6 : 43|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ FCW : 44|1@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ ZEROS_BOH3 : 45|2@1+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ FCW2 : 47|1@1+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ ZEROS_BOH4 : 48|8@1+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 490 VEHICLE_DYNAMICS: 8 VSA
|
||||
SG_ LONG_ACCEL : 23|16@0- (0.0015384,0) [-20|20] "m/s2" NEO
|
||||
|
||||
BO_ 0x200 GAS_COMMAND: 3 ADAS
|
||||
SG_ GAS_COMMAND : 0|16@1+ (0.253984064,-328) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 18|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 20|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 493 XXX_9: 5 VSA
|
||||
|
||||
BO_ 0x201 GAS_SENSOR: 5 ADAS
|
||||
SG_ INTERCEPTOR_GAS : 0|16@1+ (0.253984064,-328) [0|1] "" Vector__XXX
|
||||
SG_ INTERCEPTOR_GAS2 : 16|16@1+ (0.126992032,-656) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 34|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 36|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 506 BRAKE_COMMAND: 8 ADAS
|
||||
SG_ COMPUTER_BRAKE : 7|10@0+ (0.003906248,0) [0|1] "" EBCM
|
||||
SG_ ZEROS_BOH : 13|5@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ COMPUTER_BRAKE_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_BOH2 : 23|3@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_BOH3 : 19|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ COMPUTER_BRAKE_REQUEST_2 : 16|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ SET_ME_0X80 : 31|8@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CHIME : 47|3@0+ (1,0) [0|7] "" EBCM
|
||||
SG_ ZEROS_BOH6 : 44|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ FCW : 43|1@0+ (1,0) [0|3] "" EBCM
|
||||
SG_ ZEROS_BOH3 : 42|2@0+ (1,0) [0|0] "" EBCM
|
||||
SG_ FCW2 : 40|1@0+ (1,0) [0|0] "" EBCM
|
||||
SG_ ZEROS_BOH4 : 55|8@0+ (1,0) [0|0] "" EBCM
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EBCM
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EBCM
|
||||
|
||||
BO_ 0x221 XXX: 6 XXX
|
||||
BO_ 512 GAS_COMMAND: 3 NEO
|
||||
SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-328) [0|1] "" INTERCEPTOR
|
||||
SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" INTERCEPTOR
|
||||
SG_ CHECKSUM : 19|4@0+ (1,0) [0|3] "" INTERCEPTOR
|
||||
|
||||
BO_ 0x255 ROUGH_WHEEL_SPEED: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 0|8@1+ (1,0) [0|255] "mph" Vector__XXX
|
||||
SG_ WHEEL_SPEED_FR : 8|8@1+ (1,0) [0|255] "mph" Vector__XXX
|
||||
SG_ WHEEL_SPEED_RL : 16|8@1+ (1,0) [0|255] "mph" Vector__XXX
|
||||
SG_ WHEEL_SPEED_RR : 24|8@1+ (1,0) [0|255] "mph" Vector__XXX
|
||||
SG_ SET_TO_X55 : 32|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ SET_TO_X55 : 40|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
BO_ 513 GAS_SENSOR: 5 INTERCEPTOR
|
||||
SG_ INTERCEPTOR_GAS : 7|16@0+ (0.253984064,-328) [0|1] "" NEO
|
||||
SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.126992032,-656) [0|1] "" NEO
|
||||
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 35|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x296 CRUISE_BUTTONS: 4 SCM
|
||||
SG_ CRUISE_BUTTONS : 0|3@1+ (1,0) [0|7] "" Vector__XXX
|
||||
SG_ CRUISE_SETTING : 4|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 545 XXX_10: 6 XXX
|
||||
|
||||
BO_ 0x305 SEATBELT_STATUS: 7 BDY
|
||||
SG_ SEATBELT_DRIVER_LAMP : 0|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ SEATBELT_DRIVER_LATCHED : 10|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 50|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 52|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" NEO
|
||||
SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" NEO
|
||||
SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" NEO
|
||||
SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" NEO
|
||||
SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ SET_TO_X55 : 47|8@0+ (1,0) [0|255] "" NEO
|
||||
|
||||
BO_ 0x309 XXX: 8 XXX
|
||||
BO_ 662 CRUISE_BUTTONS: 4 SCM
|
||||
SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" NEO
|
||||
SG_ CRUISE_SETTING : 3|2@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x30C ACC_HUD: 8 ADAS
|
||||
SG_ PCM_SPEED : 0|16@1+ (0.002763889,0) [0|100] "m/s" Vector__XXX
|
||||
SG_ PCM_GAS : 16|7@1+ (1,0) [0|127] "" Vector__XXX
|
||||
SG_ ZEROS_BOH : 23|1@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ CRUISE_SPEED : 24|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ DTC_MODE : 32|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BOH : 33|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ ACC_PROBLEM : 34|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ FCM_OFF : 35|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BOH_2 : 36|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ FCM_PROBLEM : 37|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ RADAR_OBSTRUCTED : 38|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ ENABLE_MINI_CAR : 39|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ HUD_DISTANCE : 40|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ HUD_LEAD : 42|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ BOH_3 : 44|1@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ BOH_4 : 45|1@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ BOH_5 : 46|1@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CRUISE_CONTROL_LABEL : 47|1@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 773 SEATBELT_STATUS: 7 BDY
|
||||
SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x31B XXX: 8 XXX
|
||||
BO_ 777 XXX_11: 8 XXX
|
||||
|
||||
BO_ 0x320 XXX: 8 XXX
|
||||
BO_ 780 ACC_HUD: 8 ADAS
|
||||
SG_ PCM_SPEED : 7|16@0+ (0.002763889,0) [0|100] "m/s" BDY
|
||||
SG_ PCM_GAS : 23|7@0+ (1,0) [0|127] "" BDY
|
||||
SG_ ZEROS_BOH : 16|1@0+ (1,0) [0|255] "" BDY
|
||||
SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "" BDY
|
||||
SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ FCM_OFF : 36|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH_2 : 35|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ HUD_DISTANCE : 47|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" BDY
|
||||
|
||||
BO_ 0x324 CRUISE: 8 PCM
|
||||
SG_ ENGINE_TEMPERATURE : 0|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ BOH : 8|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ TRIP_FUEL_CONSUMED : 16|16@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ CRUISE_SPEED_PCM : 32|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ BOH2 : 40|8@1- (1,0) [0|255] "" Vector__XXX
|
||||
SG_ BOH3 : 48|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 795 XXX_12: 8 XXX
|
||||
|
||||
BO_ 0x326 SCM_FEEDBACK: 8 SCM
|
||||
SG_ CMBS_BUTTON : 17|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ MAIN_ON : 27|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ RIGHT_BLINKER : 28|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LEFT_BLINKER : 29|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
|
||||
BO_ 800 XXX_13: 8 XXX
|
||||
|
||||
BO_ 0x328 XXX: 8 XXX
|
||||
BO_ 804 CRUISE: 8 PCM
|
||||
SG_ ENGINE_TEMPERATURE : 7|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ BOH : 15|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" NEO
|
||||
SG_ CRUISE_SPEED_PCM : 39|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ BOH2 : 47|8@0- (1,0) [0|255] "" NEO
|
||||
SG_ BOH3 : 55|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x33D LKAS_HUD_2: 5 ADAS
|
||||
SG_ CAM_TEMP_HIGH : 0|1@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ BOH : 1|7@1+ (1,0) [0|127] "" Vector__XXX
|
||||
SG_ DASHED_LANES : 9|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ DTC : 10|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LKAS_PROBLEM : 11|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LKAS_OFF : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ SOLID_LANES : 13|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LDW_RIGHT : 14|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ STEERING_REQUIRED : 15|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BOH : 16|2@1+ (1,0) [0|4] "" Vector__XXX
|
||||
SG_ LDW_PROBLEM : 18|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BEEP : 22|2@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LDW_ON : 27|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LDW_OFF : 28|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CLEAN_WINDSHIELD : 29|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ SET_ME_X48 : 24|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ COUNTER : 34|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 36|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 806 SCM_FEEDBACK: 8 SCM
|
||||
SG_ CMBS_BUTTON : 22|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ MAIN_ON : 28|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ RIGHT_BLINKER : 27|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LEFT_BLINKER : 26|1@0+ (1,0) [0|1] "" NEO
|
||||
|
||||
BO_ 0x35E XXX: 8 ADAS
|
||||
SG_ UI_ALERTS : 0|56@1+ (1,0) [0|127] "" Vector__XXX
|
||||
BO_ 808 XXX_14: 8 XXX
|
||||
|
||||
BO_ 0x374 XXX: 8 XXX
|
||||
BO_ 0x37B XXX: 8 XXX
|
||||
BO_ 0x37C XXX: 8 XXX
|
||||
BO_ 829 LKAS_HUD_2: 5 ADAS
|
||||
SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
|
||||
SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
|
||||
SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
|
||||
SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY
|
||||
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CHECKSUM : 35|4@0+ (1,0) [0|3] "" BDY
|
||||
|
||||
BO_ 0x39F XXX: 8 ADAS
|
||||
SG_ ZEROS_BOH : 0|17@1+ (1,0) [0|127] "" Vector__XXX
|
||||
SG_ APPLY_BRAKES_FOR_CANC : 16|1@1+ (1,0) [0|15] "" Vector__XXX
|
||||
SG_ ZEROS_BOH2 : 17|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ RESUME_INSTRUCTION : 18|1@1+ (1,0) [0|15] "" Vector__XXX
|
||||
SG_ ACC_ALERTS : 19|5@1+ (1,0) [0|15] "" Vector__XXX
|
||||
SG_ ZEROS_BOH2 : 24|8@1+ (1,0) [0|127] "" Vector__XXX
|
||||
SG_ LEAD_SPEED : 32|9@1+ (1,0) [0|127] "" Vector__XXX
|
||||
SG_ LEAD_STATE : 41|3@1+ (1,0) [0|127] "" Vector__XXX
|
||||
SG_ LEAD_DISTANCE : 44|5@1+ (1,0) [0|31] "" Vector__XXX
|
||||
SG_ ZEROS_BOH3 : 49|7@1+ (1,0) [0|127] "" Vector__XXX
|
||||
BO_ 862 XXX_15: 8 ADAS
|
||||
SG_ UI_ALERTS : 7|56@0+ (1,0) [0|127] "" BDY
|
||||
|
||||
BO_ 0x3A1 XXX: 8 XXX
|
||||
BO_ 0x3D9 XXX: 3 XXX
|
||||
BO_ 0x400 XXX: 5 XXX
|
||||
BO_ 0x403 XXX: 5 XXX
|
||||
BO_ 884 XXX_16: 8 XXX
|
||||
|
||||
BO_ 0x405 DOORS_STATUS: 8 BDY
|
||||
SG_ DOOR_OPEN_FL : 34|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ DOOR_OPEN_FR : 33|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ DOOR_OPEN_RL : 32|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ DOOR_OPEN_RR : 47|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 891 XXX_17: 8 XXX
|
||||
|
||||
BO_ 0x40C XXX: 8 XXX
|
||||
BO_ 0x40F XXX: 8 XXX
|
||||
BO_ 0x454 XXX: 8 XXX
|
||||
BO_ 0x516 XXX: 8 XXX
|
||||
BO_ 0x52A XXX: 5 XXX
|
||||
BO_ 0x551 XXX: 5 XXX
|
||||
BO_ 0x555 XXX: 5 XXX
|
||||
BO_ 0x590 XXX: 5 XXX
|
||||
BO_ 0x640 XXX: 5 XXX
|
||||
BO_ 0x641 XXX: 8 XXX
|
||||
BO_ 0x661 XXX: 8 XXX
|
||||
BO_ 892 XXX_18: 8 XXX
|
||||
|
||||
VAL_ 0x296 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none";
|
||||
VAL_ 0x296 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none";
|
||||
VAL_ 0x33D HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car";
|
||||
VAL_ 0x1A6 LIGHTS_SETTING 3 "high_beam" 2 "low_beam" 1 "position" 0 "no_lights";
|
||||
VAL_ 0x18F STEER_STATUS 5 "fault" 4 "no_torque_alert_2" 2 "no_torque_alert_1" 0 "normal";
|
||||
VAL_ 0x191 GEAR_SHIFTER 32 "L" 16 "S" 8 "D" 4 "N" 2 "R" 1 "P";
|
||||
VAL_ 0x33D BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep";
|
||||
VAL_ 0x1FA CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime";
|
||||
VAL_ 0x1C2 EPB_STATE 3 "engaged" 2 "disengaging" 1 "engaging" 0 "disengaged";
|
||||
VAL_ 0x326 CMBS_BUTTON 3 "pressed" 0 "released";
|
||||
VAL_ 0x39F ACC_ALERTS 29 "esp_active_acc_canceled" 10 "b_pedal_applied" 9 "speed_too_low" 8 "speed_too_high" 7 "p_brake_applied" 6 "gear_no_d" 5 "seatbelt" 4 "too_steep_downhill" 3 "too_steep_uphill" 2 "too_close" 1 "no_vehicle_ahead";
|
||||
VAL_ 0x30C CRUISE_SPEED 255 "no_speed" 252 "stopped";
|
||||
BO_ 927 XXX_19: 8 ADAS
|
||||
SG_ ZEROS_BOH : 7|17@0+ (1,0) [0|127] "" BDY
|
||||
SG_ APPLY_BRAKES_FOR_CANC : 23|1@0+ (1,0) [0|15] "" BDY
|
||||
SG_ ZEROS_BOH2 : 22|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ RESUME_INSTRUCTION : 21|1@0+ (1,0) [0|15] "" BDY
|
||||
SG_ ACC_ALERTS : 20|5@0+ (1,0) [0|15] "" BDY
|
||||
SG_ ZEROS_BOH2 : 31|8@0+ (1,0) [0|127] "" BDY
|
||||
SG_ LEAD_SPEED : 39|9@0+ (1,0) [0|127] "" BDY
|
||||
SG_ LEAD_STATE : 46|3@0+ (1,0) [0|127] "" BDY
|
||||
SG_ LEAD_DISTANCE : 43|5@0+ (1,0) [0|31] "" BDY
|
||||
SG_ ZEROS_BOH3 : 54|7@0+ (1,0) [0|127] "" BDY
|
||||
|
||||
BO_ 929 XXX_20: 8 XXX
|
||||
|
||||
BO_ 985 XXX_21: 3 XXX
|
||||
|
||||
BO_ 1024 XXX_22: 5 XXX
|
||||
|
||||
BO_ 1027 XXX_23: 5 XXX
|
||||
|
||||
BO_ 1029 DOORS_STATUS: 8 BDY
|
||||
SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 1036 XXX_24: 8 XXX
|
||||
|
||||
BO_ 1039 XXX_25: 8 XXX
|
||||
|
||||
BO_ 1108 XXX_26: 8 XXX
|
||||
|
||||
BO_ 1302 XXX_27: 8 XXX
|
||||
|
||||
BO_ 1322 XXX_28: 5 XXX
|
||||
|
||||
BO_ 1361 XXX_29: 5 XXX
|
||||
|
||||
BO_ 1365 XXX_30: 5 XXX
|
||||
|
||||
BO_ 1424 XXX_31: 5 XXX
|
||||
|
||||
BO_ 1600 XXX_32: 5 XXX
|
||||
|
||||
BO_ 1601 XXX_33: 8 XXX
|
||||
|
||||
BO_ 1633 XXX_34: 8 XXX
|
||||
|
||||
BO_TX_BU_ 228 : NEO,ADAS;
|
||||
BO_TX_BU_ 506 : NEO,ADAS;
|
||||
BO_TX_BU_ 780 : NEO,ADAS;
|
||||
BO_TX_BU_ 829 : NEO,ADAS;
|
||||
BO_TX_BU_ 862 : NEO,ADAS;
|
||||
BO_TX_BU_ 927 : NEO,ADAS;
|
||||
|
||||
|
||||
CM_ SG_ 401 GEAR "10 = reverse, 11 = transition";
|
||||
CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping";
|
||||
CM_ SG_ 780 CRUISE_SPEED "255 = no speed";
|
||||
CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed";
|
||||
CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc...";
|
||||
VAL_ 399 STEER_STATUS 5 "fault" 4 "no_torque_alert_2" 2 "no_torque_alert_1" 0 "normal" ;
|
||||
VAL_ 401 GEAR_SHIFTER 32 "L" 16 "S" 8 "D" 4 "N" 2 "R" 1 "P" ;
|
||||
VAL_ 450 EPB_STATE 3 "engaged" 2 "disengaging" 1 "engaging" 0 "disengaged" ;
|
||||
VAL_ 506 CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime" ;
|
||||
VAL_ 662 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;
|
||||
VAL_ 662 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none" ;
|
||||
VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped" ;
|
||||
VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car" ;
|
||||
VAL_ 806 CMBS_BUTTON 3 "pressed" 0 "released" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
VAL_ 927 ACC_ALERTS 29 "esp_active_acc_canceled" 10 "b_pedal_applied" 9 "speed_too_low" 8 "speed_too_high" 7 "p_brake_applied" 6 "gear_no_d" 5 "seatbelt" 4 "too_steep_downhill" 3 "too_steep_uphill" 2 "too_close" 1 "no_vehicle_ahead" ;
|
||||
|
||||
CM_ SG_ 0x1A3 GEAR "10 = reverse, 11 = transition";
|
||||
CM_ SG_ 0x324 CRUISE_SPEED_PCM "255 = no speed";
|
||||
CM_ SG_ 0x30C CRUISE_SPEED "255 = no speed";
|
||||
CM_ SG_ 0x1EA LONG_ACCEL "wheel speed derivative, noisy and zero snapping";
|
||||
CM_ SG_ 0x33D BEEP "beeps are pleasant, chimes are for warnngs etc...";
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# enable wifi access point for debugging only!
|
||||
#service call wifi 37 i32 0 i32 1 # WifiService.setWifiApEnabled(null, true)
|
||||
|
||||
# use the openpilot ro key
|
||||
export GIT_SSH_COMMAND="ssh -i /data/data/com.termux/files/id_rsa_openpilot_ro"
|
||||
|
||||
# check out the openpilot repo
|
||||
if [ ! -d /data/openpilot ]; then
|
||||
cd /tmp
|
||||
git clone git@github.com:commaai/openpilot.git -b release
|
||||
mv /tmp/openpilot /data/openpilot
|
||||
fi
|
||||
|
||||
# enter openpilot directory
|
||||
cd /data/openpilot
|
||||
|
||||
# removed automatic update from openpilot
|
||||
#git pull
|
||||
|
||||
# start manager
|
||||
cd selfdrive
|
||||
mkdir -p /sdcard/realdata
|
||||
PYTHONPATH=/data/openpilot ./manager.py
|
||||
|
||||
# if broken, keep on screen error
|
||||
while true; do sleep 1; done
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEpAIBAAKCAQEAy/ZlYE/iHHjhbSvCnBm5Zsq5GPpVugLXFHai/doqyfRxErop
|
||||
/g1TIRhzK3mkHRYRN7H0L9whogwoIVr5CldoxU49FDnNbVHNimScNrL4LprRWjq6
|
||||
dRmCVoxMpLHZTyX1jIkcHsMr7klcUnssyeQO2pWvZv0ZC67wM7G20r7+ZLdEa0Ck
|
||||
MBh8JYhDaZx2xvYtTnt6vKMmFVE5+zW/+wDVma3a4r9pG9s0+r0wCl8CUuJ+yDhR
|
||||
mzNkPJ5mJCMx99AI6k4Gq9Vsng8/35b6Azh3TucPaXOLK7yPnL3YBKUa0PpR7IRH
|
||||
+OKkVCH+LL7tcPFSqPPVy/pUTBdEUROjJdSHxwIDAQABAoIBAQCxBgUM56h3T89Q
|
||||
AoghFg6dkdu/Ox8GmAp231UuAJncuMUfHObvcj8xXVgwZp4zBIEjFte6ZlPmoqh9
|
||||
8sht2lm7zeEjWdvbQwGjWRlgPEs9n++OYaSNl/tRBOpMk3Ppxydst1/prznE0nVH
|
||||
vVKtU7w0qXAYchm30zj1lQv5s/12CTGmnpQatbo5X488RfCfv2zFX1h+lEWF8ycL
|
||||
eZRi8z6l8h2Y+JLyEwPCmR+gR6XtosZ/ECQcTknavqLqdr7NbYYfOo3JfHCUtpJa
|
||||
8s7m0VFhMuxFFCl1sV0eMzAynJYNVz45DyaKpr2b/2YAGY8fn96FxaWv1xw1xTkK
|
||||
c5+wStwJAoGBAOjQpLZ1qGa4GwXzeHoDsGFpGgY9ug6af0M23c8O42fJHAwYkk7r
|
||||
Qeo4SSBddoSfo3jdchFLo59+m3qyTKpjkph7NBBCEwaCvX3heStDIMZEWX0IOV5y
|
||||
iJD/D6EXSqFmXCUUaudX2OxlaHguA0yOEx9s/5uUJrvaIHbBAOpYyar1AoGBAOBG
|
||||
MJp+EA3e1Zx/VszD2Tdxn8V0DAwvy9WIEqZuG689S/Sk5GnA4m2L8Txv0xAHFvLv
|
||||
JpF7Zn9AoFXGpjf9P0FF53cpjEYn9f+uK84j1HOL/6R7Nj9rcS5yL2PCP1ZHymw6
|
||||
xOXl3oZa1YtYE6jfvXUaOb8Z7y8gaStP763sXmpLAoGBAM1WSBANUcvXES58gIPN
|
||||
ASHJGwTqKFF8/kV//L4EuZjuDWi1u0UTxX0Yy5ZaGI/8ZKfTWCnc9qFTfzoGTAvz
|
||||
6nXGJDM6s6EIaqy90qrPd/amje7y8/ZTOhP4ggZojpAvwZGKoocMOey1vCBTJOG+
|
||||
ZStQbVkAn/EK/5r9uxr12FiJAoGAH9UWlPcLpExamWnhkhLCRAJWoRoFk708+0Pj
|
||||
EchTGZ5jp4e3++KqwM26Ic/lb0LyWOzk1oVjWPB9UW9urEe/sK4RWnKFPHfzjKTW
|
||||
Bt5DC1t1n4z1eC7x05vVah1qC/8IljAJPnBQE1XVNX/82l1XcMWWKK+vqUq6YrFn
|
||||
3ZHNHN0CgYA3uUVWqW37vfJuk0MJBkQSqMo5Y5TPlCt4b1ebkdhlM4v/N+iuiPiC
|
||||
PBhjP1MLeudkJvzllt4YvNWLerCKpMWuw7Zvy5uzFEsqOrVlzfnyWqqqYbYjHe9f
|
||||
Ef0/yXKuGJajs54Ts6Xrm0+elVUu//pEuf6NI96Ehctqz8/BqGqAtw==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# move files into place
|
||||
adb push files/id_rsa_openpilot_ro /tmp/id_rsa_openpilot_ro
|
||||
adb shell mv /tmp/id_rsa_openpilot_ro /data/data/com.termux/files/
|
||||
|
||||
# moving continue into place runs the continue script
|
||||
adb push files/continue.sh /tmp/continue.sh
|
||||
adb shell mv /tmp/continue.sh /data/data/com.termux/files/
|
||||
|
||||
1381
phonelibs/json/src/json.c
Normal file
1381
phonelibs/json/src/json.c
Normal file
File diff suppressed because it is too large
Load Diff
117
phonelibs/json/src/json.h
Normal file
117
phonelibs/json/src/json.h
Normal file
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
Copyright (C) 2011 Joseph A. Adams (joeyadams3.14159@gmail.com)
|
||||
All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef CCAN_JSON_H
|
||||
#define CCAN_JSON_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
|
||||
typedef enum {
|
||||
JSON_NULL,
|
||||
JSON_BOOL,
|
||||
JSON_STRING,
|
||||
JSON_NUMBER,
|
||||
JSON_ARRAY,
|
||||
JSON_OBJECT,
|
||||
} JsonTag;
|
||||
|
||||
typedef struct JsonNode JsonNode;
|
||||
|
||||
struct JsonNode
|
||||
{
|
||||
/* only if parent is an object or array (NULL otherwise) */
|
||||
JsonNode *parent;
|
||||
JsonNode *prev, *next;
|
||||
|
||||
/* only if parent is an object (NULL otherwise) */
|
||||
char *key; /* Must be valid UTF-8. */
|
||||
|
||||
JsonTag tag;
|
||||
union {
|
||||
/* JSON_BOOL */
|
||||
bool bool_;
|
||||
|
||||
/* JSON_STRING */
|
||||
char *string_; /* Must be valid UTF-8. */
|
||||
|
||||
/* JSON_NUMBER */
|
||||
double number_;
|
||||
|
||||
/* JSON_ARRAY */
|
||||
/* JSON_OBJECT */
|
||||
struct {
|
||||
JsonNode *head, *tail;
|
||||
} children;
|
||||
};
|
||||
};
|
||||
|
||||
/*** Encoding, decoding, and validation ***/
|
||||
|
||||
JsonNode *json_decode (const char *json);
|
||||
char *json_encode (const JsonNode *node);
|
||||
char *json_encode_string (const char *str);
|
||||
char *json_stringify (const JsonNode *node, const char *space);
|
||||
void json_delete (JsonNode *node);
|
||||
|
||||
bool json_validate (const char *json);
|
||||
|
||||
/*** Lookup and traversal ***/
|
||||
|
||||
JsonNode *json_find_element (JsonNode *array, int index);
|
||||
JsonNode *json_find_member (JsonNode *object, const char *key);
|
||||
|
||||
JsonNode *json_first_child (const JsonNode *node);
|
||||
|
||||
#define json_foreach(i, object_or_array) \
|
||||
for ((i) = json_first_child(object_or_array); \
|
||||
(i) != NULL; \
|
||||
(i) = (i)->next)
|
||||
|
||||
/*** Construction and manipulation ***/
|
||||
|
||||
JsonNode *json_mknull(void);
|
||||
JsonNode *json_mkbool(bool b);
|
||||
JsonNode *json_mkstring(const char *s);
|
||||
JsonNode *json_mknumber(double n);
|
||||
JsonNode *json_mkarray(void);
|
||||
JsonNode *json_mkobject(void);
|
||||
|
||||
void json_append_element(JsonNode *array, JsonNode *element);
|
||||
void json_prepend_element(JsonNode *array, JsonNode *element);
|
||||
void json_append_member(JsonNode *object, const char *key, JsonNode *value);
|
||||
void json_prepend_member(JsonNode *object, const char *key, JsonNode *value);
|
||||
|
||||
void json_remove_from_parent(JsonNode *node);
|
||||
|
||||
/*** Debugging ***/
|
||||
|
||||
/*
|
||||
* Look for structure and encoding problems in a JsonNode or its descendents.
|
||||
*
|
||||
* If a problem is detected, return false, writing a description of the problem
|
||||
* to errmsg (unless errmsg is NULL).
|
||||
*/
|
||||
bool json_check(const JsonNode *node, char errmsg[256]);
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,6 @@
|
||||
Cython==0.24.1
|
||||
bitstring==3.1.5
|
||||
fastcluster==1.1.21
|
||||
h5py==2.6.0
|
||||
libusb1==1.5.0
|
||||
pycapnp==0.5.9
|
||||
pyzmq==15.4.0
|
||||
|
||||
@@ -19,10 +19,7 @@ ZMQ_LIBS = -L$(PHONELIBS)/zmq/aarch64/lib \
|
||||
-l:libczmq.a -l:libzmq.a \
|
||||
-lgnustl_shared
|
||||
|
||||
CEREAL_FLAGS = -I$(PHONELIBS)/capnp-cpp/include
|
||||
CEREAL_LIBS = -L$(PHONELIBS)/capnp-cpp/aarch64/lib/ \
|
||||
-l:libcapnp.a -l:libkj.a
|
||||
CEREAL_OBJS = ../../cereal/gen/c/log.capnp.o
|
||||
JSON_FLAGS = -I$(PHONELIBS)/json/src
|
||||
|
||||
EXTRA_LIBS = -lusb
|
||||
|
||||
@@ -34,14 +31,18 @@ CEREAL_LIBS = -L$(HOME)/drive/external/capnp/lib/ \
|
||||
EXTRA_LIBS = -lusb-1.0 -lpthread
|
||||
endif
|
||||
|
||||
.PHONY: all
|
||||
all: boardd
|
||||
|
||||
-include ../common/cereal.mk
|
||||
|
||||
OBJS = boardd.o \
|
||||
log.capnp.o
|
||||
../common/swaglog.o \
|
||||
$(PHONELIBS)/json/src/json.o \
|
||||
$(CEREAL_OBJS)
|
||||
|
||||
DEPS := $(OBJS:.o=.d)
|
||||
|
||||
all: boardd
|
||||
|
||||
boardd: $(OBJS)
|
||||
@echo "[ LINK ] $@"
|
||||
$(CXX) -fPIC -o '$@' $^ \
|
||||
@@ -53,18 +54,20 @@ boardd.o: boardd.cc
|
||||
@echo "[ CXX ] $@"
|
||||
$(CXX) $(CXXFLAGS) \
|
||||
-I$(PHONELIBS)/android_system_core/include \
|
||||
$(CEREAL_FLAGS) \
|
||||
$(CEREAL_CFLAGS) \
|
||||
$(ZMQ_FLAGS) \
|
||||
-I../ \
|
||||
-I../../ \
|
||||
-c -o '$@' '$<'
|
||||
|
||||
|
||||
log.capnp.o: ../../cereal/gen/cpp/log.capnp.c++
|
||||
@echo "[ CXX ] $@"
|
||||
$(CXX) $(CXXFLAGS) $(CEREAL_FLAGS) \
|
||||
-c -o '$@' '$<'
|
||||
|
||||
%.o: %.c
|
||||
@echo "[ CC ] $@"
|
||||
$(CC) $(CFLAGS) -MMD \
|
||||
-Iinclude -I.. -I../.. \
|
||||
$(CEREAL_CFLAGS) \
|
||||
$(ZMQ_FLAGS) \
|
||||
$(JSON_FLAGS) \
|
||||
-c -o '$@' '$<'
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <capnp/serialize.h>
|
||||
#include "cereal/gen/cpp/log.capnp.h"
|
||||
|
||||
#include "common/swaglog.h"
|
||||
#include "common/timing.h"
|
||||
|
||||
int do_exit = 0;
|
||||
@@ -29,18 +30,12 @@ libusb_device_handle *dev_handle;
|
||||
pthread_mutex_t usb_lock;
|
||||
|
||||
bool spoofing_started = false;
|
||||
bool fake_send = false;
|
||||
|
||||
// double the FIFO size
|
||||
#define RECV_SIZE (0x1000)
|
||||
#define TIMEOUT 0
|
||||
|
||||
#define DEBUG_BOARDD
|
||||
#ifdef DEBUG_BOARDD
|
||||
#define DPRINTF(fmt, ...) printf("boardd: " fmt, ## __VA_ARGS__)
|
||||
#else
|
||||
#define DPRINTF(fmt, ...)
|
||||
#endif
|
||||
|
||||
bool usb_connect() {
|
||||
int err;
|
||||
|
||||
@@ -56,11 +51,17 @@ bool usb_connect() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void usb_retry_connect() {
|
||||
LOG("attempting to connect");
|
||||
while (!usb_connect()) { usleep(100*1000); }
|
||||
LOGW("connected to board");
|
||||
}
|
||||
|
||||
void handle_usb_issue(int err, const char func[]) {
|
||||
DPRINTF("usb error %d \"%s\" in %s\n", err, libusb_strerror((enum libusb_error)err), func);
|
||||
LOGE("usb error %d \"%s\" in %s", err, libusb_strerror((enum libusb_error)err), func);
|
||||
if (err == -4) {
|
||||
while (!usb_connect()) { DPRINTF("attempting to connect\n"); usleep(100*1000); }
|
||||
LOGE("lost connection");
|
||||
usb_retry_connect();
|
||||
}
|
||||
// TODO: check other errors, is simply retrying okay?
|
||||
}
|
||||
@@ -77,7 +78,7 @@ void can_recv(void *s) {
|
||||
do {
|
||||
err = libusb_bulk_transfer(dev_handle, 0x81, (uint8_t*)data, RECV_SIZE, &recv, TIMEOUT);
|
||||
if (err != 0) { handle_usb_issue(err, __func__); }
|
||||
if (err == -8) { DPRINTF("overflow got 0x%x\n", recv); };
|
||||
if (err == -8) { LOGE("overflow got 0x%x", recv); };
|
||||
|
||||
// timeout is okay to exit, recv still happened
|
||||
if (err == -7) { break; }
|
||||
@@ -129,6 +130,7 @@ void can_health(void *s) {
|
||||
uint8_t started;
|
||||
uint8_t controls_allowed;
|
||||
uint8_t gas_interceptor_detected;
|
||||
uint8_t started_signal_detected;
|
||||
} health;
|
||||
|
||||
// recv from board
|
||||
@@ -157,6 +159,7 @@ void can_health(void *s) {
|
||||
}
|
||||
healthData.setControlsAllowed(health.controls_allowed);
|
||||
healthData.setGasInterceptorDetected(health.gas_interceptor_detected);
|
||||
healthData.setStartedSignalDetected(health.started_signal_detected);
|
||||
|
||||
// send to health
|
||||
auto words = capnp::messageToFlatArray(msg);
|
||||
@@ -174,8 +177,10 @@ void can_send(void *s) {
|
||||
err = zmq_msg_recv(&msg, s, 0);
|
||||
assert(err >= 0);
|
||||
|
||||
// format for board
|
||||
auto amsg = kj::arrayPtr((const capnp::word*)zmq_msg_data(&msg), zmq_msg_size(&msg));
|
||||
// format for board, make copy due to alignment issues, will be freed on out of scope
|
||||
auto amsg = kj::heapArray<capnp::word>((zmq_msg_size(&msg) / sizeof(capnp::word)) + 1);
|
||||
memcpy(amsg.begin(), zmq_msg_data(&msg), zmq_msg_size(&msg));
|
||||
|
||||
capnp::FlatArrayMessageReader cmsg(amsg);
|
||||
cereal::Event::Reader event = cmsg.getRoot<cereal::Event>();
|
||||
int msg_count = event.getCan().size();
|
||||
@@ -197,8 +202,6 @@ void can_send(void *s) {
|
||||
memcpy(&send[i*4+2], cmsg.getDat().begin(), cmsg.getDat().size());
|
||||
}
|
||||
|
||||
//DPRINTF("got send message: %d\n", msg_count);
|
||||
|
||||
// release msg
|
||||
zmq_msg_close(&msg);
|
||||
|
||||
@@ -206,10 +209,12 @@ void can_send(void *s) {
|
||||
int sent;
|
||||
pthread_mutex_lock(&usb_lock);
|
||||
|
||||
do {
|
||||
err = libusb_bulk_transfer(dev_handle, 3, (uint8_t*)send, msg_count*0x10, &sent, TIMEOUT);
|
||||
if (err != 0 || msg_count*0x10 != sent) { handle_usb_issue(err, __func__); }
|
||||
} while(err != 0);
|
||||
if (!fake_send) {
|
||||
do {
|
||||
err = libusb_bulk_transfer(dev_handle, 3, (uint8_t*)send, msg_count*0x10, &sent, TIMEOUT);
|
||||
if (err != 0 || msg_count*0x10 != sent) { handle_usb_issue(err, __func__); }
|
||||
} while(err != 0);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&usb_lock);
|
||||
|
||||
@@ -221,7 +226,7 @@ void can_send(void *s) {
|
||||
// **** threads ****
|
||||
|
||||
void *can_send_thread(void *crap) {
|
||||
DPRINTF("start send thread\n");
|
||||
LOGD("start send thread");
|
||||
|
||||
// sendcan = 8017
|
||||
void *context = zmq_ctx_new();
|
||||
@@ -237,7 +242,7 @@ void *can_send_thread(void *crap) {
|
||||
}
|
||||
|
||||
void *can_recv_thread(void *crap) {
|
||||
DPRINTF("start recv thread\n");
|
||||
LOGD("start recv thread");
|
||||
|
||||
// can = 8006
|
||||
void *context = zmq_ctx_new();
|
||||
@@ -254,7 +259,7 @@ void *can_recv_thread(void *crap) {
|
||||
}
|
||||
|
||||
void *can_health_thread(void *crap) {
|
||||
DPRINTF("start health thread\n");
|
||||
LOGD("start health thread");
|
||||
|
||||
// health = 8011
|
||||
void *context = zmq_ctx_new();
|
||||
@@ -274,40 +279,36 @@ int set_realtime_priority(int level) {
|
||||
struct sched_param sa;
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
sa.sched_priority = level;
|
||||
return sched_setscheduler(gettid(), SCHED_FIFO, &sa);
|
||||
return sched_setscheduler(getpid(), SCHED_FIFO, &sa);
|
||||
}
|
||||
|
||||
int main() {
|
||||
int err;
|
||||
printf("boardd: starting boardd\n");
|
||||
LOGW("starting boardd");
|
||||
|
||||
// set process priority
|
||||
err = set_realtime_priority(4);
|
||||
printf("boardd: setpriority returns %d\n", err);
|
||||
LOG("setpriority returns %d", err);
|
||||
|
||||
// check the environment
|
||||
if (getenv("STARTED")) {
|
||||
spoofing_started = true;
|
||||
}
|
||||
|
||||
// connect to the board
|
||||
if (getenv("FAKESEND")) {
|
||||
fake_send = true;
|
||||
}
|
||||
|
||||
// init libusb
|
||||
err = libusb_init(&ctx);
|
||||
assert(err == 0);
|
||||
libusb_set_debug(ctx, 3);
|
||||
|
||||
// TODO: duplicate code from error handling
|
||||
while (!usb_connect()) { DPRINTF("attempting to connect\n"); usleep(100*1000); }
|
||||
// connect to the board
|
||||
usb_retry_connect();
|
||||
|
||||
/*int config;
|
||||
err = libusb_get_configuration(dev_handle, &config);
|
||||
assert(err == 0);
|
||||
DPRINTF("configuration is %d\n", config);*/
|
||||
|
||||
/*err = libusb_set_interface_alt_setting(dev_handle, 0, 0);
|
||||
assert(err == 0);*/
|
||||
|
||||
// create threads
|
||||
|
||||
pthread_t can_health_thread_handle;
|
||||
err = pthread_create(&can_health_thread_handle, NULL,
|
||||
can_health_thread, NULL);
|
||||
|
||||
@@ -109,7 +109,7 @@ def boardd_mock_loop():
|
||||
|
||||
while 1:
|
||||
tsc = messaging.drain_sock(logcan, wait_for_one=True)
|
||||
snds = map(can_capnp_to_can_list, tsc)
|
||||
snds = map(lambda x: can_capnp_to_can_list(x.can), tsc)
|
||||
snd = []
|
||||
for s in snds:
|
||||
snd += s
|
||||
@@ -162,7 +162,7 @@ def boardd_loop(rate=200):
|
||||
# send can if we have a packet
|
||||
tsc = messaging.recv_sock(sendcan)
|
||||
if tsc is not None:
|
||||
can_send_many(can_capnp_to_can_list(tsc))
|
||||
can_send_many(can_capnp_to_can_list(tsc.sendcan))
|
||||
|
||||
rk.keep_time()
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#!/usr/bin/env python
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
import numpy as np
|
||||
import tempfile
|
||||
import zmq
|
||||
|
||||
from common.services import service_list
|
||||
@@ -8,6 +11,7 @@ import selfdrive.messaging as messaging
|
||||
from selfdrive.config import ImageParams, VehicleParams
|
||||
from selfdrive.calibrationd.calibration import ViewCalibrator, CalibStatus
|
||||
|
||||
CALIBRATION_TMP_DIR = "/sdcard"
|
||||
CALIBRATION_FILE = "/sdcard/calibration_param"
|
||||
|
||||
def load_calibration(gctx):
|
||||
@@ -32,28 +36,33 @@ def load_calibration(gctx):
|
||||
|
||||
# load calibration data
|
||||
if os.path.isfile(CALIBRATION_FILE):
|
||||
# if the calibration file exist, start from the last cal values
|
||||
with open(CALIBRATION_FILE, "r") as cal_file:
|
||||
data = [float(l.strip()) for l in cal_file.readlines()]
|
||||
calib = ViewCalibrator((I.X, I.Y),
|
||||
big_box_size,
|
||||
vp_img,
|
||||
warp_matrix_start,
|
||||
vp_f=[data[2], data[3]],
|
||||
cal_cycle=data[0],
|
||||
cal_status=data[1])
|
||||
try:
|
||||
# If the calibration file exist, start from the last cal values
|
||||
with open(CALIBRATION_FILE, "r") as cal_file:
|
||||
data = [float(l.strip()) for l in cal_file.readlines()]
|
||||
return ViewCalibrator(
|
||||
(I.X, I.Y),
|
||||
big_box_size,
|
||||
vp_img,
|
||||
warp_matrix_start,
|
||||
vp_f=[data[2], data[3]],
|
||||
cal_cycle=data[0],
|
||||
cal_status=data[1])
|
||||
except Exception as e:
|
||||
print("Could not load calibration file: {}".format(e))
|
||||
|
||||
if calib.cal_status == CalibStatus.INCOMPLETE:
|
||||
print "CALIBRATION IN PROGRESS", calib.cal_cycle
|
||||
else:
|
||||
print "NO CALIBRATION FILE"
|
||||
calib = ViewCalibrator((I.X, I.Y),
|
||||
big_box_size,
|
||||
vp_img,
|
||||
warp_matrix_start,
|
||||
vp_f=vp_guess)
|
||||
return ViewCalibrator(
|
||||
(I.X, I.Y), big_box_size, vp_img, warp_matrix_start, vp_f=vp_guess)
|
||||
|
||||
return calib
|
||||
def store_calibration(calib):
|
||||
# Tempfile needs to be on the same device as the calbration file.
|
||||
with tempfile.NamedTemporaryFile(delete=False, dir=CALIBRATION_TMP_DIR) as cal_file:
|
||||
print(calib.cal_cycle, file=cal_file)
|
||||
print(calib.cal_status, file=cal_file)
|
||||
print(calib.vp_f[0], file=cal_file)
|
||||
print(calib.vp_f[1], file=cal_file)
|
||||
cal_file_name = cal_file.name
|
||||
os.rename(cal_file_name, CALIBRATION_FILE)
|
||||
|
||||
def calibrationd_thread(gctx):
|
||||
context = zmq.Context()
|
||||
@@ -69,7 +78,7 @@ def calibrationd_thread(gctx):
|
||||
v_ego = None
|
||||
|
||||
calib = load_calibration(gctx)
|
||||
last_cal_cycle = calib.cal_cycle
|
||||
last_write_cycle = calib.cal_cycle
|
||||
|
||||
while 1:
|
||||
# calibration at the end so it does not delay radar processing above
|
||||
@@ -91,14 +100,10 @@ def calibrationd_thread(gctx):
|
||||
calib.calibration(p0, p1, st, v_ego, steer_angle, VP)
|
||||
|
||||
# write a new calibration every 100 cal cycle
|
||||
if calib.cal_cycle - last_cal_cycle >= 100:
|
||||
print "writing cal", calib.cal_cycle
|
||||
with open(CALIBRATION_FILE, "w") as cal_file:
|
||||
cal_file.write(str(calib.cal_cycle)+'\n')
|
||||
cal_file.write(str(calib.cal_status)+'\n')
|
||||
cal_file.write(str(calib.vp_f[0])+'\n')
|
||||
cal_file.write(str(calib.vp_f[1])+'\n')
|
||||
last_cal_cycle = calib.cal_cycle
|
||||
if calib.cal_cycle - last_write_cycle >= 100:
|
||||
print("writing cal", calib.cal_cycle)
|
||||
store_calibration(calib)
|
||||
last_write_cycle = calib.cal_cycle
|
||||
|
||||
warp_matrix = map(float, calib.warp_matrix.reshape(9).tolist())
|
||||
dat = messaging.new_message()
|
||||
|
||||
@@ -74,7 +74,7 @@ class CANParser(object):
|
||||
msg_vl = fix(ck_portion, msg)
|
||||
# compare recalculated vs received checksum
|
||||
if msg_vl != cdat:
|
||||
print hex(msg), "CHECKSUM FAIL"
|
||||
print "CHECKSUM FAIL: " + hex(msg)
|
||||
self.ck[msg] = False
|
||||
self.ok[msg] = False
|
||||
# counter check
|
||||
@@ -89,6 +89,7 @@ class CANParser(object):
|
||||
self.cn_vl[msg] -= 1 # counter check passed
|
||||
# message status is invalid if we received too many wrong counter values
|
||||
if self.cn_vl[msg] >= cn_vl_max:
|
||||
print "COUNTER WRONG: " + hex(msg)
|
||||
self.ok[msg] = False
|
||||
|
||||
# update msg time stamps and counter value
|
||||
|
||||
@@ -90,7 +90,7 @@ class CarController(object):
|
||||
#print chime, alert_id, hud_alert
|
||||
fcw_display, steer_required, acc_alert = process_hud_alert(hud_alert)
|
||||
|
||||
hud = HUDData(int(pcm_accel), int(hud_v_cruise), 0x41, hud_car,
|
||||
hud = HUDData(int(pcm_accel), int(hud_v_cruise), 0x01, hud_car,
|
||||
0xc1, 0x41, hud_lanes + steer_required,
|
||||
int(snd_beep), 0x48, (snd_chime << 5) + fcw_display, acc_alert)
|
||||
|
||||
|
||||
17
selfdrive/common/cereal.mk
Normal file
17
selfdrive/common/cereal.mk
Normal file
@@ -0,0 +1,17 @@
|
||||
CEREAL_CFLAGS = -I$(PHONELIBS)/capnp-c/include
|
||||
CEREAL_CXXFLAGS = -I$(PHONELIBS)/capnp-cpp/include
|
||||
CEREAL_LIBS = -L$(PHONELIBS)/capnp-cpp/aarch64/lib/ \
|
||||
-L$(PHONELIBS)/capnp-c/aarch64/lib/ \
|
||||
-l:libcapn.a -l:libcapnp.a -l:libkj.a
|
||||
CEREAL_OBJS = ../../cereal/gen/c/log.capnp.o ../../cereal/gen/c/car.capnp.o
|
||||
|
||||
log.capnp.o: ../../cereal/gen/cpp/log.capnp.c++
|
||||
@echo "[ CXX ] $@"
|
||||
$(CXX) $(CXXFLAGS) $(CEREAL_CFLAGS) \
|
||||
-c -o '$@' '$<'
|
||||
|
||||
car.capnp.o: ../../cereal/gen/cpp/car.capnp.c++
|
||||
@echo "[ CXX ] $@"
|
||||
$(CXX) $(CXXFLAGS) $(CEREAL_CFLAGS) \
|
||||
-c -o '$@' '$<'
|
||||
|
||||
@@ -53,6 +53,7 @@ extern "C" FramebufferState* framebuffer_init(
|
||||
assert(status == 0);
|
||||
|
||||
int orientation = 3; // rotate framebuffer 270 degrees
|
||||
//int orientation = 1; // rotate framebuffer 90 degrees
|
||||
if(orientation == 1 || orientation == 3) {
|
||||
int temp = s->dinfo.h;
|
||||
s->dinfo.h = s->dinfo.w;
|
||||
|
||||
71
selfdrive/common/glutil.c
Normal file
71
selfdrive/common/glutil.c
Normal file
@@ -0,0 +1,71 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <GLES3/gl3.h>
|
||||
|
||||
#include "glutil.h"
|
||||
|
||||
GLuint load_shader(GLenum shaderType, const char *src) {
|
||||
GLint status = 0, len = 0;
|
||||
GLuint shader;
|
||||
|
||||
if (!(shader = glCreateShader(shaderType)))
|
||||
return 0;
|
||||
|
||||
glShaderSource(shader, 1, &src, NULL);
|
||||
glCompileShader(shader);
|
||||
glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
|
||||
|
||||
if (status)
|
||||
return shader;
|
||||
|
||||
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &len);
|
||||
if (len) {
|
||||
char *msg = (char*)malloc(len);
|
||||
if (msg) {
|
||||
glGetShaderInfoLog(shader, len, NULL, msg);
|
||||
msg[len-1] = 0;
|
||||
fprintf(stderr, "error compiling shader:\n%s\n", msg);
|
||||
free(msg);
|
||||
}
|
||||
}
|
||||
glDeleteShader(shader);
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLuint load_program(const char *vert_src, const char *frag_src) {
|
||||
GLuint vert, frag, prog;
|
||||
GLint status = 0, len = 0;
|
||||
|
||||
if (!(vert = load_shader(GL_VERTEX_SHADER, vert_src)))
|
||||
return 0;
|
||||
if (!(frag = load_shader(GL_FRAGMENT_SHADER, frag_src)))
|
||||
goto fail_frag;
|
||||
if (!(prog = glCreateProgram()))
|
||||
goto fail_prog;
|
||||
|
||||
glAttachShader(prog, vert);
|
||||
glAttachShader(prog, frag);
|
||||
glLinkProgram(prog);
|
||||
|
||||
glGetProgramiv(prog, GL_LINK_STATUS, &status);
|
||||
if (status)
|
||||
return prog;
|
||||
|
||||
glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &len);
|
||||
if (len) {
|
||||
char *buf = (char*) malloc(len);
|
||||
if (buf) {
|
||||
glGetProgramInfoLog(prog, len, NULL, buf);
|
||||
buf[len-1] = 0;
|
||||
fprintf(stderr, "error linking program:\n%s\n", buf);
|
||||
free(buf);
|
||||
}
|
||||
}
|
||||
glDeleteProgram(prog);
|
||||
fail_prog:
|
||||
glDeleteShader(frag);
|
||||
fail_frag:
|
||||
glDeleteShader(vert);
|
||||
return 0;
|
||||
}
|
||||
8
selfdrive/common/glutil.h
Normal file
8
selfdrive/common/glutil.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef COMMON_GLUTIL_H
|
||||
#define COMMON_GLUTIL_H
|
||||
|
||||
#include <GLES3/gl3.h>
|
||||
GLuint load_shader(GLenum shaderType, const char *src);
|
||||
GLuint load_program(const char *vert_src, const char *frag_src);
|
||||
|
||||
#endif
|
||||
@@ -19,6 +19,7 @@ typedef struct LogState {
|
||||
JsonNode *ctx_j;
|
||||
void *zctx;
|
||||
void *sock;
|
||||
int print_level;
|
||||
} LogState;
|
||||
|
||||
static LogState s = {
|
||||
@@ -31,6 +32,19 @@ static void cloudlog_init() {
|
||||
s.zctx = zmq_ctx_new();
|
||||
s.sock = zmq_socket(s.zctx, ZMQ_PUSH);
|
||||
zmq_connect(s.sock, "ipc:///tmp/logmessage");
|
||||
|
||||
s.print_level = CLOUDLOG_WARNING;
|
||||
const char* print_level = getenv("LOGPRINT");
|
||||
if (print_level) {
|
||||
if (strcmp(print_level, "debug") == 0) {
|
||||
s.print_level = CLOUDLOG_DEBUG;
|
||||
} else if (strcmp(print_level, "info") == 0) {
|
||||
s.print_level = CLOUDLOG_INFO;
|
||||
} else if (strcmp(print_level, "warning") == 0) {
|
||||
s.print_level = CLOUDLOG_WARNING;
|
||||
}
|
||||
}
|
||||
|
||||
s.inited = true;
|
||||
}
|
||||
|
||||
@@ -50,7 +64,7 @@ void cloudlog_e(int levelnum, const char* filename, int lineno, const char* func
|
||||
return;
|
||||
}
|
||||
|
||||
if (levelnum >= CLOUDLOG_PRINT_LEVEL) {
|
||||
if (levelnum >= s.print_level) {
|
||||
printf("%s: %s\n", filename, msg_buf);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,13 +7,19 @@
|
||||
#define CLOUDLOG_ERROR 40
|
||||
#define CLOUDLOG_CRITICAL 50
|
||||
|
||||
#define CLOUDLOG_PRINT_LEVEL CLOUDLOG_WARNING
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void cloudlog_e(int levelnum, const char* filename, int lineno, const char* func, const char* srctime,
|
||||
const char* fmt, ...) /*__attribute__ ((format (printf, 6, 7)))*/;
|
||||
|
||||
void cloudlog_bind(const char* k, const char* v);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#define cloudlog(lvl, fmt, ...) cloudlog_e(lvl, __FILE__, __LINE__, \
|
||||
__func__, __DATE__ " " __TIME__, \
|
||||
fmt, ## __VA_ARGS__)
|
||||
|
||||
1
selfdrive/common/version.h
Normal file
1
selfdrive/common/version.h
Normal file
@@ -0,0 +1 @@
|
||||
const char *openpilot_version = "0.2.8";
|
||||
@@ -11,6 +11,7 @@ from common.numpy_fast import clip
|
||||
from selfdrive.config import Conversions as CV
|
||||
from common.services import service_list
|
||||
from common.realtime import sec_since_boot, set_realtime_priority, Ratekeeper
|
||||
from common.profiler import Profiler
|
||||
|
||||
from selfdrive.controls.lib.drive_helpers import learn_angle_offset
|
||||
|
||||
@@ -37,6 +38,8 @@ def controlsd_thread(gctx, rate=100): #rate in Hz
|
||||
# *** log ***
|
||||
context = zmq.Context()
|
||||
live100 = messaging.pub_sock(context, service_list['live100'].port)
|
||||
carstate = messaging.pub_sock(context, service_list['carState'].port)
|
||||
carcontrol = messaging.pub_sock(context, service_list['carControl'].port)
|
||||
|
||||
thermal = messaging.sub_sock(context, service_list['thermal'].port)
|
||||
live20 = messaging.sub_sock(context, service_list['live20'].port)
|
||||
@@ -72,16 +75,29 @@ def controlsd_thread(gctx, rate=100): #rate in Hz
|
||||
|
||||
soft_disable_timer = None
|
||||
|
||||
# Is cpu temp too high to enable?
|
||||
overtemp = False
|
||||
free_space = 1.0
|
||||
|
||||
# start the loop
|
||||
set_realtime_priority(2)
|
||||
|
||||
rk = Ratekeeper(rate, print_delay_threshold=2./1000)
|
||||
while 1:
|
||||
prof = Profiler()
|
||||
cur_time = sec_since_boot()
|
||||
|
||||
# read CAN
|
||||
CS = CI.update()
|
||||
|
||||
# broadcast carState
|
||||
cs_send = messaging.new_message()
|
||||
cs_send.init('carState')
|
||||
cs_send.carState = CS # copy?
|
||||
carstate.send(cs_send.to_bytes())
|
||||
|
||||
prof.checkpoint("CarInterface")
|
||||
|
||||
# did it request to enable?
|
||||
enable_request, enable_condition = False, False
|
||||
|
||||
@@ -120,12 +136,14 @@ def controlsd_thread(gctx, rate=100): #rate in Hz
|
||||
v_cruise_kph = clip(v_cruise_kph, V_CRUISE_MIN, V_CRUISE_MAX)
|
||||
|
||||
if not enabled and b.type in ["accelCruise", "decelCruise"] and not b.pressed:
|
||||
enable_request = True
|
||||
enable_request = True
|
||||
|
||||
# do disable on button down
|
||||
if b.type == "cancel" and b.pressed:
|
||||
AM.add("disable", enabled)
|
||||
|
||||
prof.checkpoint("Buttons")
|
||||
|
||||
# *** health checking logic ***
|
||||
hh = messaging.recv_sock(health)
|
||||
if hh is not None:
|
||||
@@ -138,11 +156,15 @@ def controlsd_thread(gctx, rate=100): #rate in Hz
|
||||
# thermal data, checked every second
|
||||
td = messaging.recv_sock(thermal)
|
||||
if td is not None:
|
||||
cpu_temps = [td.thermal.cpu0, td.thermal.cpu1, td.thermal.cpu2,
|
||||
td.thermal.cpu3, td.thermal.mem, td.thermal.gpu]
|
||||
# check overtemp
|
||||
if any(t > 950 for t in cpu_temps):
|
||||
AM.add("overheat", enabled)
|
||||
# Check temperature.
|
||||
overtemp = any(
|
||||
t > 950
|
||||
for t in (td.thermal.cpu0, td.thermal.cpu1, td.thermal.cpu2,
|
||||
td.thermal.cpu3, td.thermal.mem, td.thermal.gpu))
|
||||
# under 15% of space free
|
||||
free_space = td.thermal.freeSpace
|
||||
|
||||
prof.checkpoint("Health")
|
||||
|
||||
# *** getting model logic ***
|
||||
PP.update(cur_time, CS.vEgo)
|
||||
@@ -165,6 +187,11 @@ def controlsd_thread(gctx, rate=100): #rate in Hz
|
||||
print "enabled pressed at", cur_time
|
||||
last_enable_request = cur_time
|
||||
|
||||
# don't engage with less than 15% free
|
||||
if free_space < 0.15:
|
||||
AM.add("outOfSpace", enabled)
|
||||
enable_request = False
|
||||
|
||||
if VP.brake_only:
|
||||
enable_condition = ((cur_time - last_enable_request) < 0.2) and CS.cruiseState.enabled
|
||||
else:
|
||||
@@ -181,6 +208,11 @@ def controlsd_thread(gctx, rate=100): #rate in Hz
|
||||
if PP.dead:
|
||||
AM.add("modelCommIssue", enabled)
|
||||
|
||||
if overtemp:
|
||||
AM.add("overheat", enabled)
|
||||
|
||||
prof.checkpoint("Model")
|
||||
|
||||
if enable_condition and not enabled and not AM.alertPresent():
|
||||
print "*** enabling controls"
|
||||
|
||||
@@ -207,12 +239,16 @@ def controlsd_thread(gctx, rate=100): #rate in Hz
|
||||
# *** put the adaptive in adaptive cruise control ***
|
||||
AC.update(cur_time, CS.vEgo, CS.steeringAngle, LoC.v_pid, awareness_status, VP)
|
||||
|
||||
prof.checkpoint("AdaptiveCruise")
|
||||
|
||||
# *** gas/brake PID loop ***
|
||||
final_gas, final_brake = LoC.update(enabled, CS.vEgo, v_cruise_kph, AC.v_target_lead, AC.a_target, AC.jerk_factor, VP)
|
||||
|
||||
# *** steering PID loop ***
|
||||
final_steer, sat_flag = LaC.update(enabled, CS.vEgo, CS.steeringAngle, CS.steeringPressed, PP.d_poly, angle_offset, VP)
|
||||
|
||||
prof.checkpoint("PID")
|
||||
|
||||
# ***** handle alerts ****
|
||||
# send a "steering required alert" if saturation count has reached the limit
|
||||
if sat_flag:
|
||||
@@ -232,7 +268,6 @@ def controlsd_thread(gctx, rate=100): #rate in Hz
|
||||
soft_disable_timer -= 1
|
||||
else:
|
||||
soft_disable_timer = None
|
||||
|
||||
|
||||
# *** push the alerts to current ***
|
||||
alert_text_1, alert_text_2, visual_alert, audible_alert = AM.process_alerts(cur_time)
|
||||
@@ -263,6 +298,14 @@ def controlsd_thread(gctx, rate=100): #rate in Hz
|
||||
if not CI.apply(CC):
|
||||
AM.add("controlsFailed", enabled)
|
||||
|
||||
# broadcast carControl
|
||||
cc_send = messaging.new_message()
|
||||
cc_send.init('carControl')
|
||||
cc_send.carControl = CC # copy?
|
||||
carcontrol.send(cc_send.to_bytes())
|
||||
|
||||
prof.checkpoint("CarControl")
|
||||
|
||||
# ***** publish state to logger *****
|
||||
|
||||
# publish controls state at 100Hz
|
||||
@@ -311,12 +354,14 @@ def controlsd_thread(gctx, rate=100): #rate in Hz
|
||||
|
||||
live100.send(dat.to_bytes())
|
||||
|
||||
prof.checkpoint("Live100")
|
||||
|
||||
# *** run loop at fixed rate ***
|
||||
rk.keep_time()
|
||||
if rk.keep_time():
|
||||
prof.display()
|
||||
|
||||
def main(gctx=None):
|
||||
controlsd_thread(gctx, 100)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from cereal import car
|
||||
from selfdrive.swaglog import cloudlog
|
||||
|
||||
class ET:
|
||||
ENABLE = 0
|
||||
@@ -24,7 +25,7 @@ class alert(object):
|
||||
tst = car.CarControl.new_message()
|
||||
tst.hudControl.visualAlert = self.visual_alert
|
||||
tst.hudControl.audibleAlert = self.audible_alert
|
||||
|
||||
|
||||
def __str__(self):
|
||||
return self.alert_text_1 + "/" + self.alert_text_2 + " " + str(self.alert_type) + " " + str(self.visual_alert) + " " + str(self.audible_alert)
|
||||
|
||||
@@ -54,11 +55,15 @@ class AlertManager(object):
|
||||
"doorOpen": alert("Take Control Immediately","Door Open", ET.SOFT_DISABLE, "steerRequired", "chimeRepeated", 1., 3., 3.),
|
||||
"seatbeltNotLatched": alert("Take Control Immediately","Seatbelt Unlatched", ET.SOFT_DISABLE, "steerRequired", "chimeRepeated", 1., 3., 3.),
|
||||
"espDisabled": alert("Take Control Immediately","ESP Off", ET.SOFT_DISABLE, "steerRequired", "chimeRepeated", 1., 3., 3.),
|
||||
"wrongCarMode": alert("Comma Unavailable","Main Switch Off", ET.NO_ENTRY, None, None, .4, 0., 3.),
|
||||
"wrongCarMode": alert("Comma Unavailable","Main Switch Off", ET.NO_ENTRY, None, "chimeDouble", .4, 0., 3.),
|
||||
"outOfSpace": alert("Comma Unavailable","Out of Space", ET.NO_ENTRY, None, "chimeDouble", .4, 0., 3.),
|
||||
"ethicalDilemma": alert("Take Control Immediately","Ethical Dilemma Detected", ET.IMMEDIATE_DISABLE, "steerRequired", "chimeRepeated", 1., 3., 3.),
|
||||
"startup": alert("Always Keep Hands on Wheel","Be Ready to Take Over Any Time", ET.NO_ENTRY, None, None, 0., 0., 15.),
|
||||
}
|
||||
def __init__(self):
|
||||
self.activealerts = []
|
||||
self.current_alert = None
|
||||
self.add("startup", False)
|
||||
|
||||
def alertPresent(self):
|
||||
return len(self.activealerts) > 0
|
||||
@@ -70,7 +75,8 @@ class AlertManager(object):
|
||||
return len(self.activealerts) > 0 and self.activealerts[0].alert_type >= ET.IMMEDIATE_DISABLE
|
||||
|
||||
def add(self, alert_type, enabled = True):
|
||||
this_alert = self.alerts[str(alert_type)]
|
||||
alert_type = str(alert_type)
|
||||
this_alert = self.alerts[alert_type]
|
||||
|
||||
# downgrade the alert if we aren't enabled
|
||||
if not enabled and this_alert.alert_type > ET.NO_ENTRY:
|
||||
@@ -80,6 +86,12 @@ class AlertManager(object):
|
||||
if enabled and this_alert.alert_type < ET.WARNING:
|
||||
return
|
||||
|
||||
# if new alert is different, log it
|
||||
if self.current_alert is None or self.current_alert.alert_text_2 != this_alert.alert_text_2:
|
||||
cloudlog.event('alert_add',
|
||||
alert_type=alert_type,
|
||||
enabled=enabled)
|
||||
|
||||
self.activealerts.append(this_alert)
|
||||
self.activealerts.sort()
|
||||
|
||||
@@ -106,6 +118,10 @@ class AlertManager(object):
|
||||
alert_text_1 = self.current_alert.alert_text_1
|
||||
alert_text_2 = self.current_alert.alert_text_2
|
||||
|
||||
# disable current alert
|
||||
if self.alert_start_time + max(self.current_alert.duration_sound, self.current_alert.duration_hud_alert, self.current_alert.duration_text) < cur_time:
|
||||
self.current_alert = None
|
||||
|
||||
# reset
|
||||
self.activealerts = []
|
||||
|
||||
|
||||
@@ -3,10 +3,17 @@ import numpy as np
|
||||
|
||||
from common.numpy_fast import interp
|
||||
import selfdrive.messaging as messaging
|
||||
X_PATH = np.arange(0.0, 50.0)
|
||||
|
||||
def model_polyfit(points):
|
||||
return np.polyfit(X_PATH, map(float, points), 3)
|
||||
|
||||
def compute_path_pinv():
|
||||
deg = 3
|
||||
x = np.arange(50.0)
|
||||
X = np.vstack(tuple(x**n for n in range(deg, -1, -1))).T
|
||||
pinv = np.linalg.pinv(X)
|
||||
return pinv
|
||||
|
||||
def model_polyfit(points, path_pinv):
|
||||
return np.dot(path_pinv, map(float, points))
|
||||
|
||||
# lane width http://safety.fhwa.dot.gov/geometric/pubs/mitigationstrategies/chapter3/3_lanewidth.cfm
|
||||
_LANE_WIDTH_V = [3., 3.8]
|
||||
@@ -40,24 +47,26 @@ class PathPlanner(object):
|
||||
self.last_model = 0.
|
||||
self.logMonoTime = 0
|
||||
self.lead_dist, self.lead_prob, self.lead_var = 0, 0, 1
|
||||
self._path_pinv = compute_path_pinv()
|
||||
|
||||
def update(self, cur_time, v_ego):
|
||||
md = messaging.recv_sock(self.model)
|
||||
|
||||
if md is not None:
|
||||
self.logMonoTime = md.logMonoTime
|
||||
p_poly = model_polyfit(md.model.path.points) # predicted path
|
||||
p_prob = 1. # model does not tell this probability yet, so set to 1 for now
|
||||
l_poly = model_polyfit(md.model.leftLane.points) # left line
|
||||
l_prob = md.model.leftLane.prob # left line prob
|
||||
r_poly = model_polyfit(md.model.rightLane.points) # right line
|
||||
r_prob = md.model.rightLane.prob # right line prob
|
||||
p_poly = model_polyfit(md.model.path.points, self._path_pinv) # predicted path
|
||||
l_poly = model_polyfit(md.model.leftLane.points, self._path_pinv) # left line
|
||||
r_poly = model_polyfit(md.model.rightLane.points, self._path_pinv) # right line
|
||||
|
||||
p_prob = 1. # model does not tell this probability yet, so set to 1 for now
|
||||
l_prob = md.model.leftLane.prob # left line prob
|
||||
r_prob = md.model.rightLane.prob # right line prob
|
||||
|
||||
self.lead_dist = md.model.lead.dist
|
||||
self.lead_prob = md.model.lead.prob
|
||||
self.lead_var = md.model.lead.std**2
|
||||
|
||||
#*** compute target path ***
|
||||
# compute target path
|
||||
self.d_poly, _, _ = calc_desired_path(l_poly, r_poly, p_poly, l_prob, r_prob, p_prob, v_ego)
|
||||
|
||||
self.last_model = cur_time
|
||||
|
||||
@@ -219,7 +219,7 @@ class Cluster(object):
|
||||
ret += " vision_cnt: %6.0f" % self.vision_cnt
|
||||
return ret
|
||||
|
||||
def is_potential_lead(self, v_ego, enabled):
|
||||
def is_potential_lead(self, v_ego):
|
||||
# predict cut-ins by extrapolating lateral speed by a lookahead time
|
||||
# lookahead time depends on cut-in distance. more attentive for close cut-ins
|
||||
# also, above 50 meters the predicted path isn't very reliable
|
||||
@@ -233,12 +233,11 @@ class Cluster(object):
|
||||
# average dist
|
||||
d_path = self.dPath
|
||||
|
||||
if enabled:
|
||||
t_lookahead = interp(self.dRel, t_lookahead_bp, t_lookahead_v)
|
||||
# correct d_path for lookahead time, considering only cut-ins and no more than 1m impact
|
||||
lat_corr = clip(t_lookahead * self.vLat, -1, 0)
|
||||
else:
|
||||
lat_corr = 0.
|
||||
# lat_corr used to be gated on enabled, now always running
|
||||
t_lookahead = interp(self.dRel, t_lookahead_bp, t_lookahead_v)
|
||||
# correct d_path for lookahead time, considering only cut-ins and no more than 1m impact
|
||||
lat_corr = clip(t_lookahead * self.vLat, -1, 0)
|
||||
|
||||
d_path = max(d_path + lat_corr, 0)
|
||||
|
||||
if d_path < 1.5 and not self.stationary and not self.oncoming:
|
||||
|
||||
@@ -196,7 +196,7 @@ def radard_thread(gctx=None):
|
||||
|
||||
# *** extract the lead car ***
|
||||
lead_clusters = [c for c in clusters
|
||||
if c.is_potential_lead(v_ego, enabled)]
|
||||
if c.is_potential_lead(v_ego)]
|
||||
lead_clusters.sort(key=lambda x: x.dRel)
|
||||
lead_len = len(lead_clusters)
|
||||
|
||||
|
||||
31
selfdrive/debug/dump.py
Executable file
31
selfdrive/debug/dump.py
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env python
|
||||
import sys
|
||||
import argparse
|
||||
import zmq
|
||||
from hexdump import hexdump
|
||||
|
||||
import selfdrive.messaging as messaging
|
||||
from common.services import service_list
|
||||
|
||||
if __name__ == "__main__":
|
||||
context = zmq.Context()
|
||||
poller = zmq.Poller()
|
||||
|
||||
parser = argparse.ArgumentParser(description='Sniff a communcation socket')
|
||||
parser.add_argument('--raw', action='store_true')
|
||||
parser.add_argument("socket", type=str,
|
||||
help="socket name")
|
||||
args = parser.parse_args()
|
||||
|
||||
messaging.sub_sock(context, service_list[args.socket].port, poller)
|
||||
|
||||
while 1:
|
||||
polld = poller.poll(timeout=1000)
|
||||
for sock, mode in polld:
|
||||
if mode != zmq.POLLIN:
|
||||
continue
|
||||
if args.raw:
|
||||
hexdump(sock.recv())
|
||||
else:
|
||||
print messaging.recv_sock(sock)
|
||||
|
||||
@@ -17,18 +17,16 @@ ZMQ_LIBS = -L$(PHONELIBS)/zmq/aarch64/lib \
|
||||
-l:libczmq.a -l:libzmq.a \
|
||||
-lgnustl_shared
|
||||
|
||||
CEREAL_FLAGS = -I$(PHONELIBS)/capnp-cpp/include
|
||||
CEREAL_LIBS = -L$(PHONELIBS)/capnp-cpp/aarch64/lib/ \
|
||||
-l:libcapnp.a -l:libkj.a
|
||||
CEREAL_OBJS = ../../cereal/gen/c/log.capnp.o
|
||||
.PHONY: all
|
||||
all: logcatd
|
||||
|
||||
-include ../common/cereal.mk
|
||||
|
||||
OBJS = logcatd.o \
|
||||
log.capnp.o
|
||||
$(CEREAL_OBJS)
|
||||
|
||||
DEPS := $(OBJS:.o=.d)
|
||||
|
||||
all: logcatd
|
||||
|
||||
logcatd: $(OBJS)
|
||||
@echo "[ LINK ] $@"
|
||||
$(CXX) -fPIC -o '$@' $^ \
|
||||
@@ -40,17 +38,12 @@ logcatd: $(OBJS)
|
||||
@echo "[ CXX ] $@"
|
||||
$(CXX) $(CXXFLAGS) \
|
||||
-I$(PHONELIBS)/android_system_core/include \
|
||||
$(CEREAL_FLAGS) \
|
||||
$(CEREAL_CFLAGS) \
|
||||
$(ZMQ_FLAGS) \
|
||||
-I../ \
|
||||
-I../../ \
|
||||
-c -o '$@' '$<'
|
||||
|
||||
log.capnp.o: ../../cereal/gen/cpp/log.capnp.c++
|
||||
@echo "[ CXX ] $@"
|
||||
$(CXX) $(CXXFLAGS) $(CEREAL_FLAGS) \
|
||||
-c -o '$@' '$<'
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f logcatd $(OBJS) $(DEPS)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import os
|
||||
|
||||
# fetch from environment
|
||||
DONGLE_ID = os.getenv("DONGLE_ID")
|
||||
DONGLE_SECRET = os.getenv("DONGLE_SECRET")
|
||||
def get_dongle_id_and_secret():
|
||||
return os.getenv("DONGLE_ID"), os.getenv("DONGLE_SECRET")
|
||||
|
||||
ROOT = '/sdcard/realdata/'
|
||||
|
||||
|
||||
@@ -75,10 +75,17 @@ def main(gctx=None):
|
||||
rotate_msg = messaging.log.LogRotate.new_message()
|
||||
rotate_msg.segmentNum = cur_part
|
||||
rotate_msg.path = cur_dir
|
||||
|
||||
vision_control_sock.send(rotate_msg.to_bytes())
|
||||
|
||||
finally:
|
||||
cloudlog.info("loggerd exiting...")
|
||||
|
||||
# tell visiond to stop logging
|
||||
rotate_msg = messaging.log.LogRotate.new_message()
|
||||
rotate_msg.segmentNum = -1
|
||||
rotate_msg.path = "/dev/null"
|
||||
vision_control_sock.send(rotate_msg.to_bytes())
|
||||
|
||||
# stop logging
|
||||
logger.stop()
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -9,11 +9,14 @@ import requests
|
||||
import traceback
|
||||
import threading
|
||||
|
||||
from collections import Counter
|
||||
from selfdrive.swaglog import cloudlog
|
||||
from selfdrive.loggerd.config import DONGLE_ID, DONGLE_SECRET, ROOT
|
||||
from selfdrive.loggerd.config import get_dongle_id_and_secret, ROOT
|
||||
|
||||
from common.api import api_get
|
||||
|
||||
fake_upload = os.getenv("FAKEUPLOAD") is not None
|
||||
|
||||
def raise_on_thread(t, exctype):
|
||||
for ctid, tobj in threading._active.items():
|
||||
if tobj is t:
|
||||
@@ -98,6 +101,14 @@ class Uploader(object):
|
||||
|
||||
yield (name, key, fn)
|
||||
|
||||
def get_data_stats(self):
|
||||
name_counts = Counter()
|
||||
total_size = 0
|
||||
for name, key, fn in self.gen_upload_files():
|
||||
name_counts[name] += 1
|
||||
total_size += os.stat(fn).st_size
|
||||
return dict(name_counts), total_size
|
||||
|
||||
def next_file_to_upload(self):
|
||||
# try to upload log files first
|
||||
for name, key, fn in self.gen_upload_files():
|
||||
@@ -120,8 +131,15 @@ class Uploader(object):
|
||||
url = url_resp.text
|
||||
cloudlog.info({"upload_url", url})
|
||||
|
||||
with open(fn, "rb") as f:
|
||||
self.last_resp = requests.put(url, data=f)
|
||||
if fake_upload:
|
||||
print "*** WARNING, THIS IS A FAKE UPLOAD TO %s ***" % url
|
||||
class FakeResponse(object):
|
||||
def __init__(self):
|
||||
self.status_code = 200
|
||||
self.last_resp = FakeResponse()
|
||||
else:
|
||||
with open(fn, "rb") as f:
|
||||
self.last_resp = requests.put(url, data=f)
|
||||
except Exception as e:
|
||||
self.last_exc = (e, traceback.format_exc())
|
||||
raise
|
||||
@@ -205,7 +223,13 @@ class Uploader(object):
|
||||
def uploader_fn(exit_event):
|
||||
cloudlog.info("uploader_fn")
|
||||
|
||||
uploader = Uploader(DONGLE_ID, DONGLE_SECRET, ROOT)
|
||||
dongle_id, dongle_secret = get_dongle_id_and_secret()
|
||||
|
||||
if dongle_id is None or dongle_secret is None:
|
||||
cloudlog.info("uploader MISSING DONGLE_ID or DONGLE_SECRET")
|
||||
raise Exception("uploader can't start without dongle id and secret")
|
||||
|
||||
uploader = Uploader(dongle_id, dongle_secret, ROOT)
|
||||
|
||||
while True:
|
||||
backoff = 0.1
|
||||
|
||||
@@ -6,7 +6,7 @@ import selfdrive.messaging as messaging
|
||||
|
||||
def main(gctx):
|
||||
# setup logentries. we forward log messages to it
|
||||
le_token = "bc65354a-b887-4ef4-8525-15dd51230e8c"
|
||||
le_token = "e8549616-0798-4d7e-a2ca-2513ae81fa17"
|
||||
le_handler = LogentriesHandler(le_token, use_tls=False)
|
||||
|
||||
le_level = 20 #logging.INFO
|
||||
|
||||
@@ -21,6 +21,8 @@ from selfdrive.registration import register
|
||||
|
||||
import common.crash
|
||||
|
||||
from selfdrive.loggerd.config import ROOT
|
||||
|
||||
# comment out anything you don't want to run
|
||||
managed_processes = {
|
||||
"uploader": "selfdrive.loggerd.uploader",
|
||||
@@ -49,10 +51,6 @@ car_started_processes = ['controlsd', 'loggerd', 'sensord', 'radard', 'calibrati
|
||||
# ****************** process management functions ******************
|
||||
def launcher(proc, gctx):
|
||||
try:
|
||||
# unset the signals
|
||||
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
||||
signal.signal(signal.SIGTERM, signal.SIG_DFL)
|
||||
|
||||
# import the process
|
||||
mod = importlib.import_module(proc)
|
||||
|
||||
@@ -61,6 +59,8 @@ def launcher(proc, gctx):
|
||||
|
||||
# exec the process
|
||||
mod.main(gctx)
|
||||
except KeyboardInterrupt:
|
||||
cloudlog.info("child %s got ctrl-c" % proc)
|
||||
except Exception:
|
||||
# can't install the crash handler becuase sys.excepthook doesn't play nice
|
||||
# with threads, so catch it here.
|
||||
@@ -156,17 +156,16 @@ def manager_init():
|
||||
}
|
||||
}
|
||||
|
||||
# hook to kill all processes
|
||||
signal.signal(signal.SIGINT, cleanup_all_processes)
|
||||
signal.signal(signal.SIGTERM, cleanup_all_processes)
|
||||
|
||||
def manager_thread():
|
||||
# now loop
|
||||
context = zmq.Context()
|
||||
thermal_sock = messaging.pub_sock(context, service_list['thermal'].port)
|
||||
health_sock = messaging.sub_sock(context, service_list['health'].port)
|
||||
|
||||
cloudlog.info("manager start")
|
||||
version = open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "common", "version.h")).read().split('"')[1]
|
||||
|
||||
cloudlog.info("manager start %s" % version)
|
||||
cloudlog.info(dict(os.environ))
|
||||
|
||||
start_managed_process("logmessaged")
|
||||
start_managed_process("logcatd")
|
||||
@@ -188,6 +187,14 @@ def manager_thread():
|
||||
for p in car_started_processes:
|
||||
start_managed_process(p)
|
||||
|
||||
logger_dead = False
|
||||
|
||||
count = 0
|
||||
|
||||
# set 5 second timeout on health socket
|
||||
# 5x slower than expected
|
||||
health_sock.RCVTIMEO = 5000
|
||||
|
||||
while 1:
|
||||
# get health of board, log this in "thermal"
|
||||
td = messaging.recv_sock(health_sock, wait=True)
|
||||
@@ -195,6 +202,17 @@ def manager_thread():
|
||||
|
||||
# replace thermald
|
||||
msg = read_thermal()
|
||||
|
||||
# loggerd is gated based on free space
|
||||
statvfs = os.statvfs(ROOT)
|
||||
avail = (statvfs.f_bavail * 1.0)/statvfs.f_blocks
|
||||
|
||||
# thermal message now also includes free space
|
||||
msg.thermal.freeSpace = avail
|
||||
with open("/sys/class/power_supply/battery/capacity") as f:
|
||||
msg.thermal.batteryPercent = int(f.read())
|
||||
with open("/sys/class/power_supply/battery/status") as f:
|
||||
msg.thermal.batteryStatus = f.read().strip()
|
||||
thermal_sock.send(msg.to_bytes())
|
||||
print msg
|
||||
|
||||
@@ -209,18 +227,41 @@ def manager_thread():
|
||||
elif max_temp < 70.0:
|
||||
start_managed_process("uploader")
|
||||
|
||||
if avail < 0.05:
|
||||
logger_dead = True
|
||||
|
||||
# start constellation of processes when the car starts
|
||||
if not os.getenv("STARTALL"):
|
||||
if td.health.started:
|
||||
# with 2% left, we killall, otherwise the phone is bricked
|
||||
if td is not None and td.health.started and avail > 0.02:
|
||||
for p in car_started_processes:
|
||||
start_managed_process(p)
|
||||
if p == "loggerd" and logger_dead:
|
||||
kill_managed_process(p)
|
||||
else:
|
||||
start_managed_process(p)
|
||||
else:
|
||||
logger_dead = False
|
||||
for p in car_started_processes:
|
||||
kill_managed_process(p)
|
||||
|
||||
# shutdown if the battery gets lower than 10%, we aren't running, and we are discharging
|
||||
if msg.thermal.batteryPercent < 5 and msg.thermal.batteryStatus == "Discharging":
|
||||
os.system('LD_LIBRARY_PATH="" svc power shutdown')
|
||||
|
||||
# check the status of all processes, did any of them die?
|
||||
for p in running:
|
||||
cloudlog.info(" running %s %s" % (p, running[p]))
|
||||
cloudlog.debug(" running %s %s" % (p, running[p]))
|
||||
|
||||
# report to server once per minute
|
||||
if (count%60) == 0:
|
||||
cloudlog.event("STATUS_PACKET",
|
||||
running=running.keys(),
|
||||
count=count,
|
||||
health=(td.to_dict() if td else None),
|
||||
thermal=msg.to_dict(),
|
||||
version=version)
|
||||
|
||||
count += 1
|
||||
|
||||
|
||||
# optional, build the c++ binaries and preimport the python for speed
|
||||
@@ -242,24 +283,6 @@ def manager_prepare():
|
||||
subprocess.check_call(["make", "clean"], cwd=proc[0])
|
||||
subprocess.check_call(["make", "-j4"], cwd=proc[0])
|
||||
|
||||
def manager_test():
|
||||
global managed_processes
|
||||
managed_processes = {}
|
||||
managed_processes["test1"] = ("test", ["./test.py"])
|
||||
managed_processes["test2"] = ("test", ["./test.py"])
|
||||
managed_processes["test3"] = "selfdrive.test.test"
|
||||
manager_prepare()
|
||||
start_managed_process("test1")
|
||||
start_managed_process("test2")
|
||||
start_managed_process("test3")
|
||||
print running
|
||||
time.sleep(3)
|
||||
kill_managed_process("test1")
|
||||
kill_managed_process("test2")
|
||||
kill_managed_process("test3")
|
||||
print running
|
||||
time.sleep(10)
|
||||
|
||||
def wait_for_device():
|
||||
while 1:
|
||||
try:
|
||||
@@ -291,20 +314,23 @@ def main():
|
||||
del managed_processes['loggerd']
|
||||
del managed_processes['logmessaged']
|
||||
del managed_processes['logcatd']
|
||||
if os.getenv("NOCONTROL") is not None:
|
||||
del managed_processes['controlsd']
|
||||
del managed_processes['radard']
|
||||
|
||||
manager_init()
|
||||
manager_prepare()
|
||||
|
||||
if os.getenv("PREPAREONLY") is not None:
|
||||
sys.exit(0)
|
||||
|
||||
if len(sys.argv) > 1 and sys.argv[1] == "test":
|
||||
manager_test()
|
||||
else:
|
||||
manager_prepare()
|
||||
try:
|
||||
manager_thread()
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
common.crash.capture_exception()
|
||||
finally:
|
||||
cleanup_all_processes(None, None)
|
||||
try:
|
||||
manager_thread()
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
common.crash.capture_exception()
|
||||
finally:
|
||||
cleanup_all_processes(None, None)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -17,18 +17,16 @@ ZMQ_LIBS = -L$(PHONELIBS)/zmq/aarch64/lib \
|
||||
-l:libczmq.a -l:libzmq.a \
|
||||
-lgnustl_shared
|
||||
|
||||
CEREAL_FLAGS = -I$(PHONELIBS)/capnp-cpp/include
|
||||
CEREAL_LIBS = -L$(PHONELIBS)/capnp-cpp/aarch64/lib/ \
|
||||
-l:libcapnp.a -l:libkj.a
|
||||
CEREAL_OBJS = ../../cereal/gen/c/log.capnp.o
|
||||
.PHONY: all
|
||||
all: sensord
|
||||
|
||||
-include ../common/cereal.mk
|
||||
|
||||
OBJS = sensors.o \
|
||||
log.capnp.o
|
||||
$(CEREAL_OBJS)
|
||||
|
||||
DEPS := $(OBJS:.o=.d)
|
||||
|
||||
all: sensord
|
||||
|
||||
sensord: $(OBJS)
|
||||
@echo "[ LINK ] $@"
|
||||
$(CXX) -fPIC -o '$@' $^ \
|
||||
@@ -40,19 +38,12 @@ sensors.o: sensors.cc
|
||||
@echo "[ CXX ] $@"
|
||||
$(CXX) $(CXXFLAGS) \
|
||||
-I$(PHONELIBS)/android_system_core/include \
|
||||
$(CEREAL_FLAGS) \
|
||||
$(CEREAL_CFLAGS) \
|
||||
$(ZMQ_FLAGS) \
|
||||
-I../ \
|
||||
-I../../ \
|
||||
-c -o '$@' '$<'
|
||||
|
||||
|
||||
log.capnp.o: ../../cereal/gen/cpp/log.capnp.c++
|
||||
@echo "[ CXX ] $@"
|
||||
$(CXX) $(CXXFLAGS) $(CEREAL_FLAGS) \
|
||||
-c -o '$@' '$<'
|
||||
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f sensord $(OBJS) $(DEPS)
|
||||
|
||||
@@ -83,6 +83,7 @@ void sensor_loop() {
|
||||
|
||||
const sensors_event_t& data = buffer[i];
|
||||
|
||||
sensorEvents[i].setSource(cereal::SensorEventData::SensorSource::ANDROID);
|
||||
sensorEvents[i].setVersion(data.version);
|
||||
sensorEvents[i].setSensor(data.sensor);
|
||||
sensorEvents[i].setType(data.type);
|
||||
|
||||
@@ -3,7 +3,7 @@ import selfdrive.messaging as messaging
|
||||
|
||||
def read_tz(x):
|
||||
with open("/sys/devices/virtual/thermal/thermal_zone%d/temp" % x) as f:
|
||||
ret = int(f.read())
|
||||
ret = max(0, int(f.read()))
|
||||
return ret
|
||||
|
||||
def read_thermal():
|
||||
|
||||
@@ -30,6 +30,7 @@ FRAMEBUFFER_LIBS = -lutils -lgui -lEGL
|
||||
|
||||
OBJS = ui.o \
|
||||
touch.o \
|
||||
../common/glutil.o \
|
||||
../common/visionipc.o \
|
||||
../common/framebuffer.o \
|
||||
$(PHONELIBS)/nanovg/nanovg.o \
|
||||
|
||||
@@ -1,15 +1,50 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <assert.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <assert.h>
|
||||
#include <dirent.h>
|
||||
#include <sys/poll.h>
|
||||
#include <linux/input.h>
|
||||
|
||||
#include "touch.h"
|
||||
|
||||
static int find_dev() {
|
||||
int err;
|
||||
|
||||
int ret = -1;
|
||||
|
||||
DIR *dir = opendir("/dev/input");
|
||||
assert(dir);
|
||||
struct dirent* de = NULL;
|
||||
while ((de = readdir(dir))) {
|
||||
if (strncmp(de->d_name, "event", 5)) continue;
|
||||
|
||||
int fd = openat(dirfd(dir), de->d_name, O_RDONLY);
|
||||
assert(fd >= 0);
|
||||
|
||||
char name[128] = {0};
|
||||
err = ioctl(fd, EVIOCGNAME(sizeof(name) - 1), &name);
|
||||
assert(err >= 0);
|
||||
|
||||
unsigned long ev_bits[8] = {0};
|
||||
err = ioctl(fd, EVIOCGBIT(0, sizeof(ev_bits)), ev_bits);
|
||||
assert(err >= 0);
|
||||
|
||||
if (strncmp(name, "synaptics", 9) == 0 && ev_bits[0] == 0xb) {
|
||||
ret = fd;
|
||||
break;
|
||||
}
|
||||
close(fd);
|
||||
}
|
||||
closedir(dir);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void touch_init(TouchState *s) {
|
||||
// synaptics touch screen on oneplus 3
|
||||
s->fd = open("/dev/input/event4", O_RDONLY);
|
||||
s->fd = find_dev();
|
||||
assert(s->fd >= 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,11 +20,14 @@
|
||||
#include "common/timing.h"
|
||||
#include "common/util.h"
|
||||
#include "common/mat.h"
|
||||
#include "common/glutil.h"
|
||||
|
||||
#include "common/framebuffer.h"
|
||||
#include "common/visionipc.h"
|
||||
#include "common/modeldata.h"
|
||||
|
||||
#include "common/version.h"
|
||||
|
||||
#include "cereal/gen/c/log.capnp.h"
|
||||
|
||||
#include "touch.h"
|
||||
@@ -95,7 +98,6 @@ typedef struct UIState {
|
||||
|
||||
// base ui
|
||||
uint64_t last_base_update;
|
||||
uint64_t last_rx_bytes;
|
||||
uint64_t last_tx_bytes;
|
||||
char serial[4096];
|
||||
const char* dongle_id;
|
||||
@@ -249,70 +251,6 @@ static const char line_fragment_shader[] =
|
||||
" gl_FragColor = vColor;\n"
|
||||
"}\n";
|
||||
|
||||
static GLuint load_shader(GLenum shaderType, const char *src) {
|
||||
GLint status = 0, len = 0;
|
||||
GLuint shader;
|
||||
|
||||
if (!(shader = glCreateShader(shaderType)))
|
||||
return 0;
|
||||
|
||||
glShaderSource(shader, 1, &src, NULL);
|
||||
glCompileShader(shader);
|
||||
glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
|
||||
|
||||
if (status)
|
||||
return shader;
|
||||
|
||||
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &len);
|
||||
if (len) {
|
||||
char *msg = malloc(len);
|
||||
if (msg) {
|
||||
glGetShaderInfoLog(shader, len, NULL, msg);
|
||||
msg[len-1] = 0;
|
||||
fprintf(stderr, "error compiling shader:\n%s\n", msg);
|
||||
free(msg);
|
||||
}
|
||||
}
|
||||
glDeleteShader(shader);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static GLuint load_program(const char *vert_src, const char *frag_src) {
|
||||
GLuint vert, frag, prog;
|
||||
GLint status = 0, len = 0;
|
||||
|
||||
if (!(vert = load_shader(GL_VERTEX_SHADER, vert_src)))
|
||||
return 0;
|
||||
if (!(frag = load_shader(GL_FRAGMENT_SHADER, frag_src)))
|
||||
goto fail_frag;
|
||||
if (!(prog = glCreateProgram()))
|
||||
goto fail_prog;
|
||||
|
||||
glAttachShader(prog, vert);
|
||||
glAttachShader(prog, frag);
|
||||
glLinkProgram(prog);
|
||||
|
||||
glGetProgramiv(prog, GL_LINK_STATUS, &status);
|
||||
if (status)
|
||||
return prog;
|
||||
|
||||
glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &len);
|
||||
if (len) {
|
||||
char *buf = (char*) malloc(len);
|
||||
if (buf) {
|
||||
glGetProgramInfoLog(prog, len, NULL, buf);
|
||||
buf[len-1] = 0;
|
||||
fprintf(stderr, "error linking program:\n%s\n", buf);
|
||||
free(buf);
|
||||
}
|
||||
}
|
||||
glDeleteProgram(prog);
|
||||
fail_prog:
|
||||
glDeleteShader(frag);
|
||||
fail_frag:
|
||||
glDeleteShader(vert);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const mat4 device_transform = {{
|
||||
1.0, 0.0, 0.0, 0.0,
|
||||
@@ -759,9 +697,9 @@ static void ui_draw_vision(UIState *s) {
|
||||
draw_frame(s);
|
||||
|
||||
if (!scene->frontview) {
|
||||
draw_rgb_box(s, scene->big_box_x, s->rgb_height-scene->big_box_height-scene->big_box_y,
|
||||
/*draw_rgb_box(s, scene->big_box_x, s->rgb_height-scene->big_box_height-scene->big_box_y,
|
||||
scene->big_box_width, scene->big_box_height,
|
||||
0xFF0000FF);
|
||||
0xFF0000FF);*/
|
||||
|
||||
ui_draw_transformed_box(s, 0xFF00FF00);
|
||||
|
||||
@@ -842,7 +780,7 @@ static void ui_draw_vision(UIState *s) {
|
||||
if (strlen(scene->alert_text2) > 0) {
|
||||
nvgFillColor(s->vg, nvgRGBA(255,255,255,255));
|
||||
nvgFontSize(s->vg, 100.0f);
|
||||
nvgText(s->vg, 100+1700/2, 200+500, scene->alert_text2, NULL);
|
||||
nvgText(s->vg, 100+1700/2, 200+550, scene->alert_text2, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -861,6 +799,11 @@ static void ui_draw_vision(UIState *s) {
|
||||
}
|
||||
}
|
||||
|
||||
static void ui_draw_blank(UIState *s) {
|
||||
glClearColor(0.1, 0.1, 0.1, 1.0);
|
||||
glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
|
||||
static void ui_draw_base(UIState *s) {
|
||||
glClearColor(0.1, 0.1, 0.1, 1.0);
|
||||
glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
|
||||
@@ -910,8 +853,10 @@ static void ui_draw(UIState *s) {
|
||||
|
||||
if (s->vision_connected) {
|
||||
ui_draw_vision(s);
|
||||
} else {
|
||||
} else if (s->awake) {
|
||||
ui_draw_base(s);
|
||||
} else {
|
||||
ui_draw_blank(s);
|
||||
}
|
||||
|
||||
eglSwapBuffers(s->display, s->surface);
|
||||
@@ -987,9 +932,20 @@ static int pending_uploads() {
|
||||
int cnt = 0;
|
||||
struct dirent *entry = NULL;
|
||||
while ((entry = readdir(dirp))) {
|
||||
if (entry->d_name[0] != '.') {
|
||||
if (entry->d_name[0] == '.') continue;
|
||||
|
||||
char subdirn[255];
|
||||
snprintf(subdirn, 255, "/sdcard/realdata/%s", entry->d_name);
|
||||
DIR *subdirp = opendir(subdirn);
|
||||
if (!subdirp) continue;
|
||||
|
||||
struct dirent *subentry = NULL;
|
||||
while ((subentry = readdir(subdirp))) {
|
||||
if (subentry->d_name[0] == '.') continue;
|
||||
//snprintf(subdirn, 255, "/sdcard/realdata/%s/%s", entry->d_name, subentry->d_name);
|
||||
cnt++;
|
||||
}
|
||||
closedir(subdirp);
|
||||
}
|
||||
closedir(dirp);
|
||||
return cnt;
|
||||
@@ -1206,20 +1162,19 @@ static void ui_update(UIState *s) {
|
||||
char* bat_stat = read_file("/sys/class/power_supply/battery/status");
|
||||
|
||||
int tx_rate = 0;
|
||||
int rx_rate = 0;
|
||||
char* rx_bytes = read_file("/sys/class/net/rmnet_data0/statistics/rx_bytes");
|
||||
char* tx_bytes = read_file("/sys/class/net/rmnet_data0/statistics/tx_bytes");
|
||||
if (rx_bytes && tx_bytes) {
|
||||
uint64_t rx_bytes_n = atoll(rx_bytes);
|
||||
rx_rate = rx_bytes_n - s->last_rx_bytes;
|
||||
s->last_rx_bytes = rx_bytes_n;
|
||||
uint64_t tx_bytes_n = 0;
|
||||
char *tx_bytes;
|
||||
|
||||
uint64_t tx_bytes_n = atoll(tx_bytes);
|
||||
tx_rate = tx_bytes_n - s->last_tx_bytes;
|
||||
s->last_tx_bytes = tx_bytes_n;
|
||||
}
|
||||
if (rx_bytes) free(rx_bytes);
|
||||
if (tx_bytes) free(tx_bytes);
|
||||
// cellular bytes
|
||||
tx_bytes = read_file("/sys/class/net/rmnet_data0/statistics/tx_bytes");
|
||||
if (tx_bytes) { tx_bytes_n += atoll(tx_bytes); free(tx_bytes); }
|
||||
|
||||
// wifi bytes
|
||||
tx_bytes = read_file("/sys/class/net/wlan0/statistics/tx_bytes");
|
||||
if (tx_bytes) { tx_bytes_n += atoll(tx_bytes); free(tx_bytes); }
|
||||
|
||||
tx_rate = tx_bytes_n - s->last_tx_bytes;
|
||||
s->last_tx_bytes = tx_bytes_n;
|
||||
|
||||
// TODO: do this properly
|
||||
system("git rev-parse --abbrev-ref HEAD > /tmp/git_branch");
|
||||
@@ -1240,10 +1195,10 @@ static void ui_update(UIState *s) {
|
||||
s->board_connected = !system("lsusb | grep bbaa > /dev/null");
|
||||
|
||||
snprintf(s->base_text, sizeof(s->base_text),
|
||||
"version: %s (%s)\nserial: %s\n dongle id: %s\n battery: %s %s\npending: %d\nrx %.1fkiB/s tx %.1fkiB/s\nboard: %s",
|
||||
git_commit, git_branch,
|
||||
"version: v%s %s (%s)\nserial: %s\n dongle id: %s\n battery: %s %s\npending: %d -> %.1f kb/s\nboard: %s",
|
||||
openpilot_version, git_commit, git_branch,
|
||||
s->serial, s->dongle_id, bat_cap ? bat_cap : "(null)", bat_stat ? bat_stat : "(null)",
|
||||
pending, rx_rate / 1024.0, tx_rate / 1024.0, s->board_connected ? "found" : "NOT FOUND");
|
||||
pending, tx_rate / 1024.0, s->board_connected ? "found" : "NOT FOUND");
|
||||
|
||||
if (bat_cap) free(bat_cap);
|
||||
if (bat_stat) free(bat_stat);
|
||||
@@ -1253,10 +1208,12 @@ static void ui_update(UIState *s) {
|
||||
|
||||
s->last_base_update = ts;
|
||||
|
||||
if (s->awake_timeout > 0) {
|
||||
s->awake_timeout--;
|
||||
} else {
|
||||
set_awake(s, false);
|
||||
if (!activity_running()) {
|
||||
if (s->awake_timeout > 0) {
|
||||
s->awake_timeout--;
|
||||
} else {
|
||||
set_awake(s, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user