Commit e139e0b8 authored by Reinhard Biegel's avatar Reinhard Biegel
Browse files

Merge branch '56-update-to-osi-3-3-1' into 'develop'

Resolve "Update to OSI 3.3.1"

See merge request !35
parents 5363ceca 90d3ca53
......@@ -26,6 +26,7 @@ FIND_PATH(OSI_INCLUDE_DIR "osi3/osi_version.pb.h"
$ENV{EXTERNLIBS}/OSI/include
/usr/local/include
/usr/include
PATH_SUFFIXES include
DOC "OSI - Headers"
)
......
......@@ -40,11 +40,13 @@ add_openpass_target(
${FMILibrary_INCLUDE_DIR}/JM
src/FmiImporter/include
../../core/opSimulation/modules/World_OSI
${OSI_INCLUDE_DIR}
LIBRARIES
Qt5::Core
${FMILibrary_LIBRARY_DIR}
Common
LINKOSI
CoreCommon
protobuf::libprotobuf
-L${OSI_INCLUDE_DIR}/../lib/osi3 open_simulation_interface_pic
)
......@@ -409,15 +409,22 @@ void OsmpFmuHandler::UpdateOutput(int localLinkId, std::shared_ptr<SignalInterfa
}
else if (trafficUpdateVariable.has_value())
{
const auto& baseMoving = trafficUpdate.mutable_update()->mutable_base();
velocity = std::sqrt(baseMoving->velocity().x() * baseMoving->velocity().x() + baseMoving->velocity().y() * baseMoving->velocity().y());
yaw = baseMoving->orientation().yaw();
roll = baseMoving->orientation().roll();
acceleration = baseMoving->acceleration().x() * std::cos(yaw) + baseMoving->acceleration().y() * std::sin(yaw);
centripetalAcceleration = -baseMoving->acceleration().x() * std::sin(yaw) + baseMoving->acceleration().y() * std::cos(yaw);
positionX = baseMoving->position().x() - bb_center_offset_x * std::cos(yaw);
positionY = baseMoving->position().y() - bb_center_offset_x * std::sin(yaw);
yawRate = baseMoving->orientation_rate().yaw();
if (trafficUpdate.update_size() > 0)
{
const auto& baseMoving = trafficUpdate.mutable_update(0)->mutable_base();
velocity = std::sqrt(baseMoving->velocity().x() * baseMoving->velocity().x() + baseMoving->velocity().y() * baseMoving->velocity().y());
yaw = baseMoving->orientation().yaw();
roll = baseMoving->orientation().roll();
acceleration = baseMoving->acceleration().x() * std::cos(yaw) + baseMoving->acceleration().y() * std::sin(yaw);
centripetalAcceleration = -baseMoving->acceleration().x() * std::sin(yaw) + baseMoving->acceleration().y() * std::cos(yaw);
positionX = baseMoving->position().x() - bb_center_offset_x * std::cos(yaw);
positionY = baseMoving->position().y() - bb_center_offset_x * std::sin(yaw);
yawRate = baseMoving->orientation_rate().yaw();
}
else
{
LOGWARN(log_prefix(agentIdString) + "Received empty TrafficUpdate message");
}
}
else
{
......
......@@ -13,7 +13,6 @@ set(COMPONENT_SOURCE_DIR ${OPENPASS_SIMCORE_DIR}/components/Algorithm_FmuWrapper
add_openpass_target(
NAME ${COMPONENT_TEST_NAME} TYPE test COMPONENT module
DEFAULT_MAIN
LINKOSI
SOURCES
OsmpFmuUnitTests.cpp
......@@ -39,10 +38,13 @@ add_openpass_target(
${FMILibrary_INCLUDE_DIR}/FMI1
${FMILibrary_INCLUDE_DIR}/FMI2
${FMILibrary_INCLUDE_DIR}/JM
${OSI_INCLUDE_DIR}
LIBRARIES
Qt5::Core
Common
${FMILibrary_LIBRARY_DIR}
protobuf::libprotobuf
-L${OSI_INCLUDE_DIR}/../lib/osi3 open_simulation_interface_pic
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment