@@ -1822,7 +1822,10 @@ int ComputeProfiles(Constraints& constraints, dReal sdbeg, dReal sdend){
1822
1822
1823
1823
// /////////////// Integrate from start /////////////////////
1824
1824
ret = IntegrateForward (constraints,0 ,sdbeg,constraints.integrationtimestep ,resprofile,1e5 ,testaboveexistingprofiles,testmvc,zlajpah);
1825
- if (ret == INT_BOTTOM || resprofile.nsteps < 10 ) {
1825
+ if (ret != INT_BOTTOM && resprofile.nsteps >2 ) {
1826
+ constraints.resprofileslist .push_back (resprofile);
1827
+ }
1828
+ if (ret == INT_BOTTOM || resprofile.nsteps < 5 ) {
1826
1829
// Integration failed. However, if qd(0) = 0, there was probably a singularity, and one can try different values for sdot
1827
1830
std::vector<dReal> qd (constraints.trajectory .dimension );
1828
1831
constraints.trajectory .Evald (0 ,qd);
@@ -1845,11 +1848,6 @@ int ComputeProfiles(Constraints& constraints, dReal sdbeg, dReal sdend){
1845
1848
}
1846
1849
}
1847
1850
}
1848
- else {
1849
- if (resprofile.nsteps >1 ) {
1850
- constraints.resprofileslist .push_back (resprofile);
1851
- }
1852
- }
1853
1851
// Now if it still fails, shouganai
1854
1852
if (ret==INT_BOTTOM) {
1855
1853
message = " Start profile hit 0" ;
@@ -1861,7 +1859,10 @@ int ComputeProfiles(Constraints& constraints, dReal sdbeg, dReal sdend){
1861
1859
1862
1860
// /////////////// Integrate from end /////////////////////
1863
1861
ret = IntegrateBackward (constraints,constraints.trajectory .duration ,sdend,constraints.integrationtimestep ,resprofile,1e5 ,testaboveexistingprofiles,testmvc);
1864
- if (ret == INT_BOTTOM || resprofile.nsteps < 10 ) {
1862
+ if (ret != INT_BOTTOM && resprofile.nsteps >2 ) {
1863
+ constraints.resprofileslist .push_back (resprofile);
1864
+ }
1865
+ if (ret == INT_BOTTOM || resprofile.nsteps < 5 ) {
1865
1866
// Integration failed. However, if qd(send) = 0, there was probably a singularity, and one can try different values for sdot
1866
1867
dReal send = constraints.trajectory .duration ;
1867
1868
std::vector<dReal> qd (constraints.trajectory .dimension );
@@ -1889,11 +1890,6 @@ int ComputeProfiles(Constraints& constraints, dReal sdbeg, dReal sdend){
1889
1890
1890
1891
}
1891
1892
}
1892
- else {
1893
- if (resprofile.nsteps >1 ) {
1894
- constraints.resprofileslist .push_back (resprofile);
1895
- }
1896
- }
1897
1893
if (ret==INT_BOTTOM) {
1898
1894
}
1899
1895
// Now if it still fails, shouganai
0 commit comments