I am running mocoInverse in C++ using the OpenSim Moco API. When I attempt to run the study in Microsoft Visual Studio 2017, I encounter an error. I have verified that my input files conform to the standard format, and they work correctly within the OpenSim GUI. Despite this, I receive the following error when running the code in Visual Studio.
[error] GCVSpline: there must be 6 or more data points.
[error] GCVSpline: there must be 6 or more data points.
[error] GCVSpline: there must be 6 or more data points.
[error] GCVSpline: there must be 6 or more data points.
[info] Storage: read data file = C:\Users\ksiva\OneDrive\Desktop\Semester 4\Capstone\Simulation Framework\ID\IK\UpAndStopAndDown0.5s_ConstForceLoad.sto (nr=604 nc=7)
[info] ExternalForce::externalforce Data source being set to UpAndStopAndDown0.5s_ConstForceLoad.sto
Exception: SimTK Exception thrown at GCVSPLUtil.h:81:
Bad call to Simbody API method GCVSPLUtil::gcvspl(): Too few data points
(Required condition 'n >= 2*m' was not met.)
C:\Users\ksiva\OneDrive\Desktop\Semester 4\Capstone\Simulation Framework\ID\build\Release\OSimTrial.exe (process 47188) exited with code 1.
I checked the .sto file and found that there are 6 data points for a single force point which shouldn't give this error. Can anyone guide me on how to troubleshoot the error.
Thanks for the support.
MoCoInverse: GCVSpline: there should be 6 or more data points, error.
- Sivaprasad Kunnath
- Posts: 8
- Joined: Mon Jun 03, 2024 2:13 am
MoCoInverse: GCVSpline: there should be 6 or more data points, error.
- Attachments
-
- GCVSpline error.png (125.15 KiB) Viewed 702 times
- Nicholas Bianco
- Posts: 999
- Joined: Thu Oct 04, 2012 8:09 pm
Re: MoCoInverse: GCVSpline: there should be 6 or more data points, error.
Hi Sivaprasad,
That error is likely because you do not have enough time points in your data file "UpAndStopAndDown0.5s_ConstForceLoad.sto". How many rows does that file have?
Best,
Nick
That error is likely because you do not have enough time points in your data file "UpAndStopAndDown0.5s_ConstForceLoad.sto". How many rows does that file have?
Best,
Nick
- Sivaprasad Kunnath
- Posts: 8
- Joined: Mon Jun 03, 2024 2:13 am
Re: MoCoInverse: GCVSpline: there should be 6 or more data points, error.
Hey Nicholas,
Thank you for your support. The file had six columns and approximately 1,200 rows. I discovered that the issue was due to a blank line between the labels and the values, causing the program to attempt to fetch data but finding no values due to the empty line.
Thank you for your support. The file had six columns and approximately 1,200 rows. I discovered that the issue was due to a blank line between the labels and the values, causing the program to attempt to fetch data but finding no values due to the empty line.
- Nicholas Bianco
- Posts: 999
- Joined: Thu Oct 04, 2012 8:09 pm
Re: MoCoInverse: GCVSpline: there should be 6 or more data points, error.
Glad you found the error!