Git Product home page Git Product logo

adaptive-autosar's Introduction

Adaptive-AUTOSAR

example workflow

Adaptive AUTOSAR is a simulated Adaptive Platform environment over Linux defined by AUTOSAR. The goal of this project is to implement the interfaces defined by the standard for educational purposes. For more information, please refer to the project Wiki.

Simulation flow diagram

Dependecies

It will be tried to use minimum number of dependencies as much as possible. The current dependencies are as follows:

Build

Compiler debug configuration

  • GCC:
cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/x86_64-linux-gnu-gcc-11 -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/x86_64-linux-gnu-g++-11 -S . -B build
  • Clang:
cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/clang-14 -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/clang++-14 -S . -B build

Compiling

cmake --build build

Unit tests running

cd build && ctest

Run

To run the Adaptive AUTOSAR simulation, launch the following executable by passing the execution manifest file path as the argument:

./build/adaptive_autosar ./configuration/execution_manifest.arxml ./configuration/extended_vehicle_manifest.arxml ./configuration/diagnostic_manager_manifest.arxml ./configuration/health_monitoring_manifest.arxml

Then the executable will ask for:

  1. First, the VCC API key;
  2. And then the test access OAuth 2.0 token;

in order to connect to the Volvo Extended Vehicle RESTful API. To create the API key and the access token, you can follow this tutorial.

⚠️ Due to security reasons, the terminal echo is temporarily disabled while typing the key and the token.

Documentation

Please refer to the project GitHub pages powered by Doxygen.

Contribution

Please refer to the contributing page.

adaptive-autosar's People

Contributors

langroodi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adaptive-autosar's Issues

Supporting GCC

Is your feature request related to a problem? Please describe.
Due to a SEGFAULT on one Google unit tests, G++ compiler cannot be used.

Describe the solution you'd like
The error should be tracked and solved. So, then the project can be built via both GCC and Clang.

Additional context
Please refer to the following ticket:
google/googletest#3506

error log occur

enviroment:
linux:

Linux magic 5.15.0-86-generic
96~20.04.1-Ubuntu SMP Thu Sep 21 13:23:37 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

cmake:
3.16.3
gcc version:
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)
branch:
origin/master

produce:
after i run “./build/bin/adaptive_autosar ./configuration/execution_manifest.arxml ./configuration/extended_vehicle_manifest.arxml ./configuration/diagnostic_manager_manifest.arxml ./configuration/health_monitoring_manifest.arxml” igot log as below, could you kindly help?

Tue Oct 24 20:34:53 2023
PlatformHeathManagement Context ID:Lifetime;Context Description:Application lifetime logs;Log Level:Info;Plafrom health management has been initialized.
Tue Oct 24 20:34:53 2023
ExtendedVehicle Context ID:Lifetime;Context Description:Application lifetime logs;Log Level:Info;Extended Vehicle AA has been initialized.
Tue Oct 24 20:34:53 2023
DiagnosticManager Context ID:Lifetime;Context Description:Application lifetime logs;Log Level:Info;TelematicControlModuleMonitor is offered.
Tue Oct 24 20:34:53 2023
DiagnosticManager Context ID:Lifetime;Context Description:Application lifetime logs;Log Level:Info;Diagnostic Manager has been initialized.
Tue Oct 24 20:34:53 2023
StateManagement Context ID:Lifetime;Context Description:Application lifetime logs;Log Level:Info;EM initial machine state transition is fetched successfully.
Tue Oct 24 20:34:53 2023
StateManagement Context ID:Lifetime;Context Description:Application lifetime logs;Log Level:Info;EM is transited to the start-up state successfully.
Tue Oct 24 20:34:53 2023
StateManagement Context ID:Lifetime;Context Description:Application lifetime logs;Log Level:Info;Execution state is reported successfully.
Tue Oct 24 20:34:59 2023
DiagnosticManager Context ID:Lifetime;Context Description:Application lifetime logs;Log Level:Error;TelematicControlModuleEvent is failed with DTC 49560
Tue Oct 24 20:35:03 2023
LogRecoveryAction Context ID:RecoveryAction;Context Description:Recovery action logs;Log Level:Error;Alive supervision is expired on MachineFG
Tue Oct 24 20:35:05 2023
ExtendedVehicle Context ID:Lifetime;Context Description:Application lifetime logs;Log Level:Error;Setting the VIN failed due to unexpected RESTful response format.

Armxl >>> Arxml

Describe the bug
Armxl >>> Arxml

modified:   test/arxml/arxml_node_test.cpp
modified:   test/arxml/arxml_reader_test.cpp

SOME/IP SD server dead-lock

Describe the bug
In some situation (probably a racing condition), the SOME/IP SD server stuck in the Main phase state, and it cannot get out of that state anymore, even by calling server Stop!

To Reproduce
It is a bit difficult to re-produce the error, but it seems sometimes stopping occurs before starting the server. The best way to debug sequence is to analyze the code itself.

Expected behavior
The server should be gracefully stop event the Stop function is called explicitly or the server destructor is being invoked.

Additional context (please complete the following information):

  • Linux Distribution and Version: Ubuntu 20.04
  • CMake Version: 3.14
  • Compiler: GCC 9.3.0

Improper pointers lifetime management

Describe the bug
Occurrence of SEGFAULT errors are possible due to improper lifetime management of entries and options in the SD client and server.

To Reproduce
Unfortunately the behavior is a bit random, and a way of reproducing is still unknown!

Expected behavior
SD sever and client should be destructed properly without any SEGFAULT error.

Additional context (please complete the following information):

  • Linux Distribution and Version: Ubuntu 20.04
  • CMake Version: 3.14
  • Compiler: GCC 9.3.0

error: variable cExpectedResult’ has initializer but incomplete type

/home/jack/codebase/Adaptive-AUTOSAR/build/_deps/doip-lib-src/test/routing_activation_request_test.cpp: In member function ‘virtual void DoipLib::RoutingActivationRequestTest_SerializationWithoutOemData_Test::TestBody()’:
/home/jack/codebase/Adaptive-AUTOSAR/build/_deps/doip-lib-src/test/routing_activation_request_test.cpp:14:51: error: variable ‘const std::array<unsigned char, 15> cExpectedResult’ has initializer but incomplete type
14 | const std::array<uint8_t, cPayloadLength> cExpectedResult{

The info aboval shows the detail of the error. Please help give solution.

THanks
Jack

ara::exec::DeterministicClient::WaitForActivation()

Is the content of the function body in the title incomplete?Its function return value should contain all members of the enumeration class.
However, the function can only return a fixed local variable: kRun.

Logsinks run in application context

Describe the bug
Logsinks run in application context. This means there can be two possible issues.

  1. logging of excessive messages leads to wait times in application / threads.
  2. contextual data (private data structure that is used to concat) is shared across threads and results in corrupted data.

To Reproduce
This is a speculation for now.

Expected behavior
I propose the following solution:

  1. implement logging server that takes the log data over a unix socket. This offloads the i/o latency on to the log server and application could either buffer or stream the log data to unix socket.
  2. use unique_locks and protect the common message buffer.

Test timeout error

Describe the bug
Following unit test is failing due to a timeout error:

Total Test time (real) =   6.21 sec

The following tests FAILED:
         60 - SomeIpSdTest.StopScenario (Failed)

To Reproduce
There is not a certain way to reproduce the situation.

Expected behavior
The timeout amount should be enough. It seems due to a random internal error in the client or the server, required states cannot be reached.

Additional context (please complete the following information):

  • Linux Distribution and Version: Ubuntu 20.04
  • CMake Version: 3.14
  • Compiler: GCC 9.3.0

SOME/IP Client Child Abortion Exception

Describe the bug
Child abortion exception in the following unit test:

        Start  57: SomeIpSdTest.StartScenario
 57/152 Test  #57: SomeIpSdTest.StartScenario .........................   Passed    0.71 sec
        Start  58: SomeIpSdTest.ClientStopScenario
 58/152 Test  #58: SomeIpSdTest.ClientStopScenario ....................Child aborted***Exception:   0.99 sec
        Start  59: SomeIpSdTest.ServerStopScenario
 59/152 Test  #59: SomeIpSdTest.ServerStopScenario ....................   Passed    0.71 sec

To Reproduce
Occurred only once.

Expected behavior
The test should always pass.

Additional context (please complete the following information):

  • Linux Distribution and Version: Ubuntu 20.04
  • CMake Version: 3.14
  • Compiler: GCC 9.3.0

nlohmann json with Clang

Describe the bug
The nlohmann json header has different behavior while switching compiler between GCC and Clang. The current code within Extended Vehicle AA now only works with GCC.

To Reproduce
Switch the compiler to Clang, compile the source and launch the application after the compile. Type an invalid API key and then an invalid access token when the application ask for it at the startup. Then, you will notice that the Extended Vehicle AA will crash.

Expected behavior
The setting VIN logic should be compiler independent.

Additional context (please complete the following information):

  • Compiler: Clang 14.0.0
  • Library: nlohmann json 3.11.2

Not able to test the project although have a valid API keys and tokens.

Discussed in #35

Originally posted by ajayjadhav900 May 6, 2024
I have clone , build the entire repo and is built successfully.
./build/adaptive_autosar ./configuration/execution_manifest.arxml ./configuration/extended_vehicle_manifest.arxml ./configuration/diagnostic_manager_manifest.arxml ./configuration/health_monitoring_manifest.arxml

there is one typo error - adaptive_autosar exe is present in build/bin directory.

i have connected volvo page and configure the API and token
still getting this error
StateManagement Context ID:Lifetime;Context Description:Application lifetime logs;Log Level:Info;EM initial machine state transition is fetched successfully.
Mon May 6 11:47:59 2024
StateManagement Context ID:Lifetime;Context Description:Application lifetime logs;Log Level:Info;EM is transited to the start-up state successfully.
Mon May 6 11:47:59 2024
StateManagement Context ID:Lifetime;Context Description:Application lifetime logs;Log Level:Info;Execution state is reported successfully.
Mon May 6 11:48:01 2024
ExtendedVehicle Context ID:Lifetime;Context Description:Application lifetime logs;Log Level:Error;Setting the VIN failed due to unexpected RESTful response format.

I have crossed checks ,API keys and token are valid.

Please assist on this.

Add an sample application for using communication management

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Additional context
Add any code repository here which the project may interact with.

Wrong implementation of StateClient within ara::exec

Describe the bug
StateClient would have an instance at SM side to interact with EM. So, the StateClient object should not keep any local state at SM side and the states should be communicated back to EM.

To Reproduce
Please refer to

std::future<void> StateClient::GetInitialMachineStateTransitionResult()

Expected behavior
The requested states from SM should be communicated back to EM (via SOME/IP, REST, etc.).

Unable to compile on ubuntu 20 using clang and cmake on VSCode terminal.

Unable to compile on ubuntu 20 using clang and cmake on VSCode terminal. Can you please check and let me know what is wrong... and BTW will i eventually see any communication on Ethernet running DDS?

hasan@dhasan-VirtualBox:~/Desktop/work/Adaptive-AUTOSAR$ cmake --build .
Scanning dependencies of target gtest
[ 2%] Building CXX object _deps/googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
[ 4%] Linking CXX static library ../../../lib/libgtest.a
[ 4%] Built target gtest
Scanning dependencies of target gtest_main
[ 6%] Building CXX object _deps/googletest-build/googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
[ 8%] Linking CXX static library ../../../lib/libgtest_main.a
[ 8%] Built target gtest_main
Scanning dependencies of target ara_sm
[ 11%] Linking CXX static library libara_sm.a
[ 11%] Built target ara_sm
Scanning dependencies of target ara_com
[ 13%] Building CXX object CMakeFiles/ara_com.dir/src/ara/com/helper/payload_helper.cpp.o
[ 15%] Building CXX object CMakeFiles/ara_com.dir/src/ara/com/helper/ipv4_address.cpp.o
In file included from /home/dhasan/Desktop/work/Adaptive-AUTOSAR/src/ara/com/helper/ipv4_address.cpp:1:
/home/dhasan/Desktop/work/Adaptive-AUTOSAR/src/ara/com/helper/./ipv4_address.h: In function ‘constexpr bool ara::com::helper::operator==(ara::com::helper::Ipv4Address, ara::com::helper::Ipv4Address)’:
/home/dhasan/Desktop/work/Adaptive-AUTOSAR/src/ara/com/helper/./ipv4_address.h:52:39: error: call to non-‘constexpr’ function ‘std::array<_Tp, _Nm>::value_type& std::array<_Tp, _Nm>::operator[](std::array<_Tp, _Nm>::size_type) [with _Tp = unsigned char; long unsigned int _Nm = 4; std::array<_Tp, _Nm>::reference = unsigned char&; std::array<_Tp, _Nm>::value_type = unsigned char; std::array<_Tp, _Nm>::size_type = long unsigned int]’
52 | (address1.Octets[0] == address2.Octets[0]) &&
| ^
make[2]: *** [CMakeFiles/ara_com.dir/build.make:76: CMakeFiles/ara_com.dir/src/ara/com/helper/ipv4_address.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:205: CMakeFiles/ara_com.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

Questions about random numbers in deterministic execution

6018b1b928d84940d2437d9ea83c1a7
Sorry to bother you, but combined with the standard and your open source, I can't figure it out, I hope you can help answer, thank you very much!
1、Where does the random number assigned by GetRandom API to the workers in the worker pool come from? I see that the function you wrote is to directly obtain the random number of each cycle in the DeterministicClient instance, I think it should not be the case.
2、How does the deterministic random number assigned to container elements in the second paragraph achieve deterministic execution? Why assign random numbers to container elements and workers at the same time? Or is it that the random number assigned to container elements is obtained by workers performing the task.
3、The standard is very general. I would like to ask how to achieve deterministic execution of random numbers, including allocation to workers and container elements. Can this achieve deterministic execution?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.