Adding an extra propoerty/field in a predefined toolbox class

조회 수: 1 (최근 30일)
Tiago Rocha Goncalves
Tiago Rocha Goncalves 2020년 8월 19일
댓글: Tiago Rocha Goncalves 2020년 8월 24일
Hello guys,
I'm trying to implement a different controller than what is being used in the driving.scenario.Vehicle. For that reason I need to access some variables/parameters that is not considered in the standard form of a specific class predefined in the toolbox of Matlab (driving.scenario.Vehicle).
For example in the Automated Driving Toolbox, I can create the following object:
%% Create scenario, add road and leader vehicle
s = drivingScenario;
vLeader = vehicle(s);
and the values for this VLeader variable would it be those in the picture below. I want to add an extra property called Acceleration to retrieve it's respective value and then be able to implement my controller.
Best regards
  댓글 수: 1
Tiago Rocha Goncalves
Tiago Rocha Goncalves 2020년 8월 20일
Work around:
I managed by using some of the available free spots of the (1,3) velocity vector axis (x,y,z). In my case, I was just using one component (x) so I managed to pass the acceleration at each time step through the (z) component of the velocity. However, I had to change some other parts in order to not mess up with the velocity calculation.

댓글을 달려면 로그인하십시오.

답변 (1개)

Jalaj Gambhir
Jalaj Gambhir 2020년 8월 24일
Hi,
As mentioned in the link, you will have to define waypoints and have different velocities at each waypoint as a workaround to define acceleration of the vehicle.
Hope this helps!
  댓글 수: 1
Tiago Rocha Goncalves
Tiago Rocha Goncalves 2020년 8월 24일
Hello,
Thanks for your help. I'm not sure this would help in my case, as I wanted to implement a specific controller (slide mode control) for a platoon of vehicles scenario. In that case, the acceleration is needed at each time step. More precisely, I was adapating the following function FollowerSpacingControl.m to change the simpler PD controller to the one mentioned above. It worked out with the aforementioned work round in my comment.
Thanks a lot again.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Automated Driving Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by