Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if the Simulink required integration step is respected #38

Closed
gabrielenava opened this issue Sep 5, 2018 · 4 comments
Closed
Assignees
Labels

Comments

@gabrielenava
Copy link
Collaborator

In view of robotology/wb-toolbox#160, it seems that there might be an issue with the Simulink gui that impairs the achievement of the desired integration step.

As first thing, we need to verify if there are differences between running the standard demos (Yoga, standup) from command line or from the Simulink gui.

@FabioBergonti if you already implemented a piece of code that allow to verify if the Simulink integration time is respected, can you please add it to this issue? I will then proceed to integrate it inside all the models.

@FabioBergonti
Copy link
Member

Here what I did
I've added this block in my simulink model
image
Then I evaluate YARP_time0

YARP_time0 = YARP_time.signals.values - YARP_time.signals.values(1);

After that some plots

Yarp Time VS simulink time

figure
hold on
plot(YARP_time0,0:length(YARP_time0)-1,'o')
plot(tout,0:length(tout)-1,'o-')
xlabel('Time [s]')
ylabel('Iteration')
grid on
legend('Yarp Time','Simulink Time')

fig

Delta Yarp Time

figure
plot(tout(1:end-1),diff(YARP_time0),'.-')
ylabel('Diff(Yarp Time) [s]')
xlabel('Absolute time [s]')

fig2

Distance between huge Delta Yarp Time

figure
Acc=diff(YARP_time0);
plot(diff(YARP_time0(Acc>0.018)),'.-')
ylabel('Distance [s]')

fig2

@gabrielenava
Copy link
Collaborator Author

Thanks @FabioBergonti! I added the checks in both the Yoga and standup models with this commit

@gabrielenava
Copy link
Collaborator Author

gabrielenava commented Sep 14, 2018

I tested the Yoga++ demo on iCubGenova02, both from the Simulink GUI and from command line. As you can see, I got the same results @FabioBergonti already had for the jumping demo:

From Simulink GUI, Yarp Time Vs. Simulink Time

screenshot from 2018-09-14 15-00-20

Looking closer:

screenshot from 2018-09-14 15-00-46

The issue disappeared when running the Simulink model from command line:

From Matlab command line, Yarp Time Vs. Simulink Time

screenshot from 2018-09-14 14-58-57

screenshot from 2018-09-14 14-57-29

I perceived the demo was also qualitatively different (faster) when launching it from the command line. Therefore I close this issue. The default method for running Simulink controller will become to launch the controllers from command line.

@yeshasvitirupachuri
Copy link
Member

@VenusPasandi FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants