mirror of
https://github.com/eclipse-openvehicle-api/openvehicle-api.git
synced 2026-02-05 15:18:45 +00:00
update vss_util tool (#2)
This commit is contained in:
BIN
examples/auto_headlamp_example/simulation_artifacts/carla_bridge_coupecar.fmu
LFS
Normal file
BIN
examples/auto_headlamp_example/simulation_artifacts/carla_bridge_coupecar.fmu
LFS
Normal file
Binary file not shown.
BIN
examples/auto_headlamp_example/simulation_artifacts/carla_bridge_patrolcar.fmu
LFS
Normal file
BIN
examples/auto_headlamp_example/simulation_artifacts/carla_bridge_patrolcar.fmu
LFS
Normal file
Binary file not shown.
Binary file not shown.
@@ -8,7 +8,7 @@
|
||||
#include "bs_front_door_left.h"
|
||||
|
||||
/**
|
||||
* @brief ConstructorF
|
||||
* @brief Constructor
|
||||
*/
|
||||
CBasicServiceFrontDoorLeft::CBasicServiceFrontDoorLeft()
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "bs_front_door_right.h"
|
||||
|
||||
/**
|
||||
* @brief ConstructorF
|
||||
* @brief Constructor
|
||||
*/
|
||||
CBasicServiceFrontDoorRight::CBasicServiceFrontDoorRight()
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "bs_rear_door_left.h"
|
||||
|
||||
/**
|
||||
* @brief ConstructorF
|
||||
* @brief Constructor
|
||||
*/
|
||||
CBasicServiceRearDoorLeft::CBasicServiceRearDoorLeft()
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "bs_rear_door_right.h"
|
||||
|
||||
/**
|
||||
* @brief ConstructorF
|
||||
* @brief Constructor
|
||||
*/
|
||||
CBasicServiceRearDoorRight::CBasicServiceRearDoorRight()
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user