update vss_util tool (#2)

This commit is contained in:
tompzf
2025-11-12 15:40:23 +01:00
committed by GitHub
parent 6ed4b1534e
commit 2fb043b2be
37 changed files with 485 additions and 179 deletions

View File

@@ -8,7 +8,7 @@
#include "bs_front_door_left.h"
/**
* @brief ConstructorF
* @brief Constructor
*/
CBasicServiceFrontDoorLeft::CBasicServiceFrontDoorLeft()
{

View File

@@ -84,10 +84,10 @@ public:
private:
bool m_leftDoorIsOpen01 { 0 };
mutable std::mutex m_leftDoorIsOpen01MutexCallbacks; ///< Mutex protecting m_leftDoorIsOpen01Callbacks
bool m_leftDoorIsOpen01 { 0 }; ///< open&close state of the door
mutable std::mutex m_leftDoorIsOpen01MutexCallbacks; ///< Mutex protecting m_leftDoorIsOpen01Callbacks
std::set<vss::Vehicle::Chassis::Door::Axle01::LeftService::IVSS_SetIsOpen_Event*> m_leftDoorIsOpen01Callbacks; ///< collection of events to be called
vss::Vehicle::Chassis::Door::Axle01::LeftDevice::IVSS_WriteLock* m_ptrLock = nullptr;
vss::Vehicle::Chassis::Door::Axle01::LeftDevice::IVSS_WriteLock* m_ptrLock = nullptr; ///< Interface pointer to lock/unlock the door
};
DEFINE_SDV_OBJECT(CBasicServiceFrontDoorLeft)

View File

@@ -8,7 +8,7 @@
#include "bs_front_door_right.h"
/**
* @brief ConstructorF
* @brief Constructor
*/
CBasicServiceFrontDoorRight::CBasicServiceFrontDoorRight()
{

View File

@@ -84,10 +84,10 @@ public:
private:
bool m_rightDoorIsOpen01 { 0 };
mutable std::mutex m_rightDoorIsOpen01MutexCallbacks; ///< Mutex protecting m_rightDoorIsOpen01Callbacks
bool m_rightDoorIsOpen01 { 0 }; ///< open&close state of the door
mutable std::mutex m_rightDoorIsOpen01MutexCallbacks; ///< Mutex protecting m_rightDoorIsOpen01Callbacks
std::set<vss::Vehicle::Chassis::Door::Axle01::RightService::IVSS_SetIsOpen_Event*> m_rightDoorIsOpen01Callbacks; ///< collection of events to be called
vss::Vehicle::Chassis::Door::Axle01::RightDevice::IVSS_WriteLock* m_ptrLock = nullptr;
vss::Vehicle::Chassis::Door::Axle01::RightDevice::IVSS_WriteLock* m_ptrLock = nullptr; ///< Interface pointer to lock/unlock the door
};
DEFINE_SDV_OBJECT(CBasicServiceFrontDoorRight)

View File

@@ -8,7 +8,7 @@
#include "bs_rear_door_left.h"
/**
* @brief ConstructorF
* @brief Constructor
*/
CBasicServiceRearDoorLeft::CBasicServiceRearDoorLeft()
{

View File

@@ -84,10 +84,10 @@ public:
private:
bool m_leftDoorIsOpen02 { 0 };
mutable std::mutex m_leftDoorIsOpen02MutexCallbacks; ///< Mutex protecting m_leftDoorIsOpen02Callbacks
bool m_leftDoorIsOpen02 { 0 }; ///< open&close state of the door
mutable std::mutex m_leftDoorIsOpen02MutexCallbacks; ///< Mutex protecting m_leftDoorIsOpen02Callbacks
std::set<vss::Vehicle::Chassis::Door::Axle02::LeftService::IVSS_SetIsOpen_Event*> m_leftDoorIsOpen02Callbacks; ///< collection of events to be called
vss::Vehicle::Chassis::Door::Axle02::LeftDevice::IVSS_WriteLock* m_ptrLock = nullptr;
vss::Vehicle::Chassis::Door::Axle02::LeftDevice::IVSS_WriteLock* m_ptrLock = nullptr; ///< Interface pointer to lock/unlock the door
};
DEFINE_SDV_OBJECT(CBasicServiceRearDoorLeft)

View File

@@ -8,7 +8,7 @@
#include "bs_rear_door_right.h"
/**
* @brief ConstructorF
* @brief Constructor
*/
CBasicServiceRearDoorRight::CBasicServiceRearDoorRight()
{

View File

@@ -84,10 +84,10 @@ public:
private:
bool m_rightDoorIsOpen02 { 0 };
mutable std::mutex m_rightDoorIsOpen02MutexCallbacks; ///< Mutex protecting m_rightDoorIsOpen02Callbacks
bool m_rightDoorIsOpen02 { 0 }; ///< open&close state of the door
mutable std::mutex m_rightDoorIsOpen02MutexCallbacks; ///< Mutex protecting m_rightDoorIsOpen02Callbacks
std::set<vss::Vehicle::Chassis::Door::Axle02::RightService::IVSS_SetIsOpen_Event*> m_rightDoorIsOpen02Callbacks; ///< collection of events to be called
vss::Vehicle::Chassis::Door::Axle02::RightDevice::IVSS_WriteLock* m_ptrLock = nullptr;
vss::Vehicle::Chassis::Door::Axle02::RightDevice::IVSS_WriteLock* m_ptrLock = nullptr; ///< Interface pointer to lock/unlock the door
};
DEFINE_SDV_OBJECT(CBasicServiceRearDoorRight)

View File

@@ -90,12 +90,12 @@ private:
*/
void ExecuteAllCallBacksForLeftDoorIsOpen01(sdv::any_t value);
sdv::core::CSignal m_leftLatch01;
sdv::core::CSignal m_leftDoorIsOpen01Signal; ///< Signal of the vehicle device
mutable std::mutex m_leftDoorIsOpen01MutexCallbacks; ///< Mutex protecting m_leftDoorIsOpen01Callbacks
sdv::core::CSignal m_leftLatch01; ///< Signal to lock/unlock the door
sdv::core::CSignal m_leftDoorIsOpen01Signal; ///< Open/close signal of the vehicle device
mutable std::mutex m_leftDoorIsOpen01MutexCallbacks; ///< Mutex protecting m_leftDoorIsOpen01Callbacks
std::set<vss::Vehicle::Chassis::Door::Axle01::LeftDevice::IVSS_WriteIsOpen_Event*> m_leftDoorIsOpen01Callbacks; ///< collection of events to be called
std::atomic<sdv::EObjectStatus> m_status = { sdv::EObjectStatus::initialization_pending }; ///< To update the object status when it changes.
std::atomic<sdv::EObjectStatus> m_status = { sdv::EObjectStatus::initialization_pending }; ///< To update the object status when it changes.
};
DEFINE_SDV_OBJECT(CVehicleDeviceFrontDoorLeft)

View File

@@ -90,12 +90,12 @@ private:
*/
void ExecuteAllCallBacksForRightDoorIsOpen01(sdv::any_t value);
sdv::core::CSignal m_rightLatch01;
sdv::core::CSignal m_rightDoorIsOpen01Signal; ///< Signal of the vehicle device
mutable std::mutex m_rightDoorIsOpen01MutexCallbacks; ///< Mutex protecting m_rightDoorIsOpen01Callbacks
sdv::core::CSignal m_rightLatch01; ///< Signal to lock/unlock the door
sdv::core::CSignal m_rightDoorIsOpen01Signal; ///< Open/close signal of the vehicle device
mutable std::mutex m_rightDoorIsOpen01MutexCallbacks; ///< Mutex protecting m_rightDoorIsOpen01Callbacks
std::set<vss::Vehicle::Chassis::Door::Axle01::RightDevice::IVSS_WriteIsOpen_Event*> m_rightDoorIsOpen01Callbacks; ///< collection of events to be called
std::atomic<sdv::EObjectStatus> m_status = { sdv::EObjectStatus::initialization_pending }; ///< To update the object status when it changes.
std::atomic<sdv::EObjectStatus> m_status = { sdv::EObjectStatus::initialization_pending }; ///< To update the object status when it changes.
};
DEFINE_SDV_OBJECT(CVehicleDeviceFrontDoorRight)

View File

@@ -90,12 +90,12 @@ private:
*/
void ExecuteAllCallBacksForLeftDoorIsOpen02(sdv::any_t value);
sdv::core::CSignal m_leftLatch02;
sdv::core::CSignal m_leftDoorIsOpen02Signal; ///< Signal of the vehicle device
mutable std::mutex m_leftDoorIsOpen02MutexCallbacks; ///< Mutex protecting m_leftDoorIsOpen02Callbacks
sdv::core::CSignal m_leftLatch02; ///< Signal to lock/unlock the door
sdv::core::CSignal m_leftDoorIsOpen02Signal; ///< Open/close signal of the vehicle device
mutable std::mutex m_leftDoorIsOpen02MutexCallbacks; ///< Mutex protecting m_leftDoorIsOpen02Callbacks
std::set<vss::Vehicle::Chassis::Door::Axle02::LeftDevice::IVSS_WriteIsOpen_Event*> m_leftDoorIsOpen02Callbacks; ///< collection of events to be called
std::atomic<sdv::EObjectStatus> m_status = { sdv::EObjectStatus::initialization_pending }; ///< To update the object status when it changes.
std::atomic<sdv::EObjectStatus> m_status = { sdv::EObjectStatus::initialization_pending }; ///< To update the object status when it changes.
};
DEFINE_SDV_OBJECT(CVehicleDeviceRearDoorLeft)

View File

@@ -90,12 +90,12 @@ private:
*/
void ExecuteAllCallBacksForRightDoorIsOpen02(sdv::any_t value);
sdv::core::CSignal m_rightLatch02;
sdv::core::CSignal m_rightDoorIsOpen02Signal; ///< Signal of the vehicle device
mutable std::mutex m_rightDoorIsOpen02MutexCallbacks; ///< Mutex protecting m_rightDoorIsOpen02Callbacks
sdv::core::CSignal m_rightLatch02; ///< Signal to lock/unlock the door
sdv::core::CSignal m_rightDoorIsOpen02Signal; ///< Open/close signal of the vehicle device
mutable std::mutex m_rightDoorIsOpen02MutexCallbacks; ///< Mutex protecting m_rightDoorIsOpen02Callbacks
std::set<vss::Vehicle::Chassis::Door::Axle02::RightDevice::IVSS_WriteIsOpen_Event*> m_rightDoorIsOpen02Callbacks; ///< collection of events to be called
std::atomic<sdv::EObjectStatus> m_status = { sdv::EObjectStatus::initialization_pending }; ///< To update the object status when it changes.
std::atomic<sdv::EObjectStatus> m_status = { sdv::EObjectStatus::initialization_pending }; ///< To update the object status when it changes.
};
DEFINE_SDV_OBJECT(CVehicleDeviceRearDoorRight)

View File

@@ -221,7 +221,7 @@ void CConsole::WriteSpeed(float value)
if (m_SpeedVD != value)
{
m_SpeedVD = value;
PrintValue(g_sVehicleDeviceSpeed, "Vehicle Speed RX", m_SpeedVD, "m/s");
PrintValue(g_sVehicleDeviceSpeed, "Vehicle Speed RX", m_SpeedVD, "km/h");
}
}
@@ -230,7 +230,7 @@ void CConsole::SetSpeed(float value)
if (m_SpeedBS != value)
{
m_SpeedBS = value;
PrintValue(g_sBasicServiceSpeed, "Vehicle Speed RX", m_SpeedBS * 3.6f, "km/h");
PrintValue(g_sBasicServiceSpeed, "Vehicle Speed RX", m_SpeedBS, "km/h");
}
}

View File

@@ -16,7 +16,10 @@
/**
* @brief Open trunk service: opens the trunk if vehicle is not moving
* @brief Open trunk example service
* @details This complex service checks the speed of the vehicle. in case the vehicle is oving, it prohibits the opening of the trunk.
* Input events from basic service: vehicle speed in km/h
* Output call for basic service: opening the trunk
*/
class CTrunkExampleService : public sdv::CSdvObject
, public sdv::IObjectControl
@@ -75,12 +78,12 @@ public:
/**
* @brief Set vehicleSpeed signal
* @param[in] value vehicleSpeed
* @param[in] value vehicle speed in km/h
*/
virtual void SetSpeed(float value) override;
/**
* @brief Save call to open the trunk. Opening the trunk is onkly allowed when the vehicle is not moving
* @brief Save call to open the trunk. Opening the trunk is only allowed when the vehicle is not moving
* @return Returns whether the trunk could be opened or not.
*/
virtual bool PopTrunk() override;

View File

@@ -1,6 +1,6 @@
;Class name;Function name;Signal name;vss;Signal direction;type;DBC CAN name includes CAN message name
;;;;;;;
VD;VehicleSpeed;Speed;vehicleSpeed;Vehicle.Speed;RX;float;CAN_Input.Speed
VD;VehicleSpeed;Speed;vehicleSpeed;Vehicle.Speed;RX;float;CAN_Input.Speed;"float vehicleSpeed = value.get<float>() * 3.6f;"
VD;VehicleTrunk;Open;trunk;Vehicle.Body.Trunk;TX;boolean;CAN_Output.OpenTrunk
BS;VehicleSpeed;Speed;vehicleSpeed;Vehicle.Speed;RX;float;Vehicle.Speed
BS;VehicleTrunk;Open;trunk;Vehicle.Body.Trunk;TX;boolean;Vehicle.Body.Trunk
1 Class name Function name Signal name vss Signal direction type DBC CAN name includes CAN message name
2
3 VD VehicleSpeed Speed vehicleSpeed Vehicle.Speed RX float CAN_Input.Speed
4 VD VehicleTrunk Open trunk Vehicle.Body.Trunk TX boolean CAN_Output.OpenTrunk
5 BS VehicleSpeed Speed vehicleSpeed Vehicle.Speed RX float Vehicle.Speed
6 BS VehicleTrunk Open trunk Vehicle.Body.Trunk TX boolean Vehicle.Body.Trunk

View File

@@ -274,8 +274,8 @@ void CConsole::UpdateData()
PrintText(g_sDLSteeringWheel, "Data link signals are unavailable!");
// Print basic service event values
PrintValue(g_sBSSteeringWheel, "Steering Angle", m_fSteeringWheelAngle * 57.296f , "deg");
PrintValue(g_sBSVehicleSpeed, "Vehicle Speed RX", m_fVehicleSpeed * 3.6f , "km/h");
PrintValue(g_sBSSteeringWheel, "Steering Angle", m_fSteeringWheelAngle, "deg");
PrintValue(g_sBSVehicleSpeed, "Vehicle Speed RX", m_fVehicleSpeed, "km/h");
// Get complex service information
if (m_pCounterSteeringSvc)

View File

@@ -1,7 +1,7 @@
#include <iostream>
#include "complex_service.h"
const float g_fSpeedThreshold = 30.0f / 3.6f;
const float g_fSpeedThreshold = 30.0f;
CCounterSteeringExampleService::CCounterSteeringExampleService()
{
@@ -141,8 +141,8 @@ void CCounterSteeringExampleService::UpdateRearAxleAngle()
if (CounterSteeringActive())
{
// Get steering wheel angle percentage
// The steering wheel can have values from -16...16 rad.
float fSteeringWheelPercent = m_fSteeringWheel / 16.0f;
// The steering wheel can have values from -916.736 to 916.736 degrees.
float fSteeringWheelPercent = m_fSteeringWheel / 916.736f;
if (fSteeringWheelPercent > 1.0) fSteeringWheelPercent = 1.0;
if (fSteeringWheelPercent < -1.0) fSteeringWheelPercent = -1.0;

View File

@@ -1,7 +1,7 @@
;Class name;Function name;Signal name;vss;Signal direction;type;DBC CAN name includes CAN message name
;;;;;;;
VD;SteeringWheel;SteeringWheel;wheelAngle;Vehicle.Chassis.SteeringWheel.Angle;RX;float;CAN_Input.SteeringWheel
VD;VehicleSpeed;Speed;vehicleSpeed;Vehicle.Speed;RX;float;CAN_Input.Speed
VD;SteeringWheel;SteeringWheel;wheelAngle;Vehicle.Chassis.SteeringWheel.Angle;RX;float;CAN_Input.SteeringWheel;"float wheelAngle = value.get<float>() * 57.296f ;"
VD;VehicleSpeed;Speed;vehicleSpeed;Vehicle.Speed;RX;float;CAN_Input.Speed;"float vehicleSpeed = value.get<float>() * 3.6f;"
VD;VehicleChassisAxle;RearAxle;axleAngle;Vehicle.Chassis.RearAxle.Row.Wheel;TX;float;CAN_Output.RearAngle
VD;IsActiveCounter;Counter;liveCounter;Vehicle.Software.Application.IsActiveCounter;TX;uint8;CAN_Output.IsActiveCounter
BS;SteeringWheel;SteeringWheel;wheelAngle;Vehicle.Chassis.SteeringWheel.Angle;RX;float;Vehicle.Chassis.SteeringWheel.Angle
1 Class name Function name Signal name vss Signal direction type DBC CAN name includes CAN message name
2
3 VD SteeringWheel SteeringWheel wheelAngle Vehicle.Chassis.SteeringWheel.Angle RX float CAN_Input.SteeringWheel
4 VD VehicleSpeed Speed vehicleSpeed Vehicle.Speed RX float CAN_Input.Speed
5 VD VehicleChassisAxle RearAxle axleAngle Vehicle.Chassis.RearAxle.Row.Wheel TX float CAN_Output.RearAngle
6 VD IsActiveCounter Counter liveCounter Vehicle.Software.Application.IsActiveCounter TX uint8 CAN_Output.IsActiveCounter
7 BS SteeringWheel SteeringWheel wheelAngle Vehicle.Chassis.SteeringWheel.Angle RX float Vehicle.Chassis.SteeringWheel.Angle