Commit d0d1491c authored by Nicolas Docquier's avatar Nicolas Docquier
Browse files

Merge branch 'Release_1.10.0' into 'master'

Release 1.10.0

See merge request robotran/mbsysc!192
parents d73cadc4 7c768298
......@@ -10,6 +10,8 @@
*.ogg
*.ogv
*.ipynb
*.so
*.mpg
**/*.m
stderr.txt
stdout.txt
......@@ -27,3 +29,4 @@ DISPLAY
OUTBOX
POSTPRO
CMakeLists.txt.user
image: robotran/ubuntu-robotran-opengl:v0
image: robotran/ubuntu-robotran-opengl:v4
# --------------------------------------------------------------------------
......@@ -225,14 +225,11 @@ tutorial_4_monolithic:
- cmake ..
- make
- ./exe_Driven_variable
- cd ../../resultsR
- diff -q dirdyn_q_ref.res dirdyn_q.res
- diff -q dirdyn_qd_ref.res dirdyn_qd.res
- diff -q dirdyn_qdd_ref.res dirdyn_qdd.res
- diff -q dirdyn_Qq_ref.res dirdyn_Qq.res
- diff -q dirdyn_Qc_ref.res dirdyn_Qc.res
- diff -q dirdyn_linkF_ref.res dirdyn_linkF.res
- cd ../../
- python ../../Compare_results.py resultsR/ 1e-4 1e-6
only:
- dev
tutorial_4_separate:
script:
- mkdir MBsysC/build
......@@ -365,15 +362,10 @@ tutorial_8_monolithic:
- cmake ..
- make
- ./exe_Userderivatives
- cd ../../resultsR
- diff -q dirdyn_q_ref.res dirdyn_q.res
- diff -q dirdyn_qd_ref.res dirdyn_qd.res
- diff -q dirdyn_qdd_ref.res dirdyn_qdd.res
- diff -q dirdyn_Qq_ref.res dirdyn_Qq.res
- diff -q Vertical_Acc_ref.res dirdyn_Vertical_Acc.res
- diff -q dirdyn_linkF_ref.res dirdyn_linkF.res
- diff -q dirdyn_ux_ref.res dirdyn_ux.res
- diff -q dirdyn_uxd_ref.res dirdyn_uxd.res
- cd ../../
- python ../../Compare_results.py resultsR/ 1e-4 1e-6
only:
- dev
tutorial_8_separate:
script:
......@@ -392,7 +384,7 @@ tutorial_8_separate:
- diff -q dirdyn_qd_ref.res dirdyn_qd.res
- diff -q dirdyn_qdd_ref.res dirdyn_qdd.res
- diff -q dirdyn_Qq_ref.res dirdyn_Qq.res
- diff -q Vertical_Acc_ref.res dirdyn_Vertical_Acc.res
- diff -q dirdyn_Vertical_Acc_ref.res dirdyn_Vertical_Acc.res
- diff -q dirdyn_linkF_ref.res dirdyn_linkF.res
- diff -q dirdyn_ux_ref.res dirdyn_ux.res
- diff -q dirdyn_uxd_ref.res dirdyn_uxd.res
......@@ -440,7 +432,6 @@ tutorial_9_separate:
# --------------------------------------------------------------------------
Python_interface_realtimeOFF:
image: robotran/ubuntu-robotran-cython:v0
script:
- mkdir MBsysC/build
- cd MBsysC/build
......
## Changes for next release
* Change the call structure for integrators in dirdyn module. The integrators are now chosen thanks to a key-word and their calls are formated :
-> 3 functions specifics for each integrator (init, loop and finish integrator) are implemented
-> these functions are automatically called thanks to 3 pointors of functions
-> Euler Explicit is availlable by not yet tested (RK4 still by default)
-> all the integrators have the same options (but warnings are printed when unused options are changed by user)
-> a custom integrator could be designed by the developper (files to do so are already there)
* Update initialization of result and animation buffers ==> this simplify the settings of respath and animpath options
* Enrich the OpenDL 3D lib to add "camera sensors". This enable screen capturing that can be outputed to files (image, video) or other flux (openCV...)
* Remove dependancy over GSL by using the LAPACKE:
* Windows: No change for user, compiled libraries are provided
* Ubuntu: `sudo apt-get install liblapacke-dev`
* User can now set vector as output variable:
* Initialization: with function `define_output_vector(char* label, int size)` define the label and the size of each vector in _user_dirdyn.c_ file inside the `user_dirdyn_init` function.
* Setting vector value: in the same place where you can call `set_output` function you can also call:
* `set_output_vector(double *v_ptr, char* label)` to save the content of the specified vector (`v_ptr`) in the output identified by the label.
* `set_output_value(double value, int index, char* label)` to set element _index_ of the vector identified by the label at the specified value.
* Python interface: possibility to retrieve point id with function `mbs_get_point_id(self, bodyName, pointName)`
## Robotran v1.9.7
* BugFix in equilibrium module (result vector was freed before being printed leading in some case to incoherent value)
......
# -*- coding: utf-8 -*-
"""
This script is used to compare current results with references results
Arguments:
[1] path to the folder containing the .res file (relative path from calling directory)
[2] relative tolerance to meet (see numpy.interp)
[3] absolute tolerance to meet (see numpy.interp)
Compatible with Python 2.7
@author: lantsoght
"""
import os
import sys
import numpy as np
#Default value
folder = "TutorialProjects/1_Bodies_and_Joints/resultsR"
rtol = 1e-5
atol = 1e-8
nargs = len(sys.argv)
if nargs > 1:
folder = sys.argv[1]
if nargs == 4:
rtol = float(sys.argv[2])
atol = float(sys.argv[3])
if (nargs ==2):
print "Using default tolerances value"
elif (nargs !=4) and (nargs !=2):
print "Wrong number of arguments (",nargs,"): testing tutorial 1 with default tolerance"
# integrator = ["RK4", "Dopri5", "Rosenbrock", "EulerEx", ".res"] # old list with EulerEx
integrator = ["RK4", "Dopri5", "Rosenbrock", ".res"]
"""
Return for each integrator a list containing all file related to the integrator
If no file found for an integrator, the list is empty
"""
def loadFiles(path='./'):
print os.getcwd()
allFiles = os.listdir(path)
# isolate files from integrator
refResFile = [File for File in allFiles if File.endswith("ref.res")]
for item in refResFile : allFiles.remove(item)
RK4ResFile = [File for File in allFiles if integrator[0] in File]
for item in RK4ResFile : allFiles.remove(item)
Dopri5ResFile = [File for File in allFiles if integrator[1] in File]
for item in Dopri5ResFile : allFiles.remove(item)
RosenbrockResFile = [File for File in allFiles if integrator[2] in File]
for item in RosenbrockResFile : allFiles.remove(item)
# EulerExResFile = [File for File in allFiles if integrator[3] in File]
# for item in EulerExResFile : allFiles.remove(item)
# noneResFile = [File for File in allFiles if File.endswith(integrator[-1])]
# for item in noneResFile : allFiles.remove(item)
# Ordering the lists
refResFile.sort()
RK4ResFile.sort()
Dopri5ResFile.sort()
RosenbrockResFile.sort()
#EulerExResFile.sort()
#noneResFile.sort()
return refResFile, RK4ResFile, Dopri5ResFile, RosenbrockResFile #, EulerExResFile, noneResFile
"""
Check if the the testFile
"""
def checkTolerances(testFile, ref, atol, rtol, intName):
if len(testFile)==0:
print "No file containing the keyword '", intName, "' has been found"
return True
allGood = 1
testRaw = []
testInterp = []
# Loading the results to check
j=0
for i in testFile:
testRaw.append(np.loadtxt(os.path.join(folder, i)))
testInterp.append(np.zeros(np.shape(ref[j])))
j+=1
# Get time waypoint
time = np.array(ref[0][:,0])
# interpolate & check data's
j=0
for reference, raw, interpol, filename in zip(ref, testRaw, testInterp, testFile):
# Get number of variable
nq = np.shape(reference)[1]-1
if not (nq == np.shape(raw)[1]-1):
print "files dimension are not the same, files are not correctly sorted"
break
interpol[:,0] = reference[:,0]
for t in xrange(len(time)):
for i in xrange(nq+1):
interpol[t,i] = np.interp(time[t], raw[:,0], raw[:,i])
check = np.isclose(reference, interpol, rtol, atol)
if not np.all(check):
print "Tolerances were not met:"
print " for the file: ", filename
print " compared with the reference:",listed[0][j] ,"\n"
allGood = 0
j+=1
# Everything was OKgit status
if allGood == 1:
return True
return False
listed = loadFiles(os.path.join("./",folder))
refNp = []
# Loading only once the reference results
for i in listed[0]:
refNp.append(np.loadtxt(os.path.join(folder, i)))
Nb_ref = len(refNp)
# check if the tolerance is met
i = 0
for intFile, suffix in zip(listed[1:], integrator):
if (Nb_ref==len(intFile)):
passed = checkTolerances(intFile, refNp, atol, rtol, suffix)
else:
print "Skip test for the integrator "+suffix+ ":"
print " The number or reference file ("+str(Nb_ref)+") is not the same as the number of generated file ("+str(len(intFile))+")"
passed = False
if not passed:
i = 1
if i:
sys.exit(0)
else:
print "Tolerance was met for all known integrator (except for EulerExplicit - not tested here) "
sys.exit(i)
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<mbsDescR7>
<mbsname>MultiplePendulum</mbsname>
<mbsyspad_version>0.0.beta</mbsyspad_version>
<mbsyspad_version>1.9.7</mbsyspad_version>
<base>
<!--this is the base body-->
<gravity>
......@@ -71,7 +71,6 @@
</base_body>
</x2D>
<x3D>
<x3D_frame />
<x3D_points />
<x3D_lines />
<x3D_shapes>
......@@ -93,7 +92,9 @@
<z>0.0</z>
</rotation>
<color R="0" G="0" B="0" />
<transparency>0.4699999988079071</transparency>
<specularColor R="255" G="255" B="255" />
<shininess>250.0</shininess>
<transparency>0.5</transparency>
<size>
<x>2.0</x>
<y>0.001</y>
......@@ -220,6 +221,8 @@
<z>0.0</z>
</rotation>
<color R="0" G="0" B="0" />
<specularColor R="255" G="255" B="255" />
<shininess>250.0</shininess>
<transparency>0.0</transparency>
<radius>0.01</radius>
<height>0.5</height>
......@@ -335,6 +338,8 @@
<z>0.0</z>
</rotation>
<color R="255" G="255" B="0" />
<specularColor R="255" G="255" B="255" />
<shininess>250.0</shininess>
<transparency>0.0</transparency>
<radius>0.01</radius>
<height>0.5</height>
......@@ -450,6 +455,8 @@
<z>0.0</z>
</rotation>
<color R="255" G="0" B="51" />
<specularColor R="255" G="255" B="255" />
<shininess>250.0</shininess>
<transparency>0.0</transparency>
<radius>0.01</radius>
<height>0.5</height>
......@@ -487,6 +494,10 @@
<com>0.3</com>
<point>0.3</point>
</shapeScaleFactors>
<opengl>
<lightAndShadowMode>LIGHTS_NO_SPEC_SHADER</lightAndShadowMode>
<glfwSample>4</glfwSample>
</opengl>
<viewpoints>
<!--This is the viewpoint list-->
<viewpoint>
......@@ -567,46 +578,130 @@
<directionalLight>
<name>DefaultLight01</name>
<joint>base</joint>
<color R="255" G="255" B="255" />
<ambient>0.05</ambient>
<depthXWidth>1024.0</depthXWidth>
<depthYWidth>1024.0</depthYWidth>
<depthNear>-10.0</depthNear>
<depthFar>20.0</depthFar>
<shadowBias>0.0</shadowBias>
<zUpVector>
<x>0.0</x>
<y>0.0</y>
<z>1.0</z>
</zUpVector>
<active />
<direction>
<x>2.0</x>
<y>1.0</y>
<z>1.0</z>
</direction>
<depthScale>0.0015</depthScale>
<relPointVector>
<x>0.0</x>
<y>0.0</y>
<z>0.0</z>
</relPointVector>
</directionalLight>
<directionalLight>
<name>DefaultLight02</name>
<joint>base</joint>
<color R="255" G="255" B="255" />
<ambient>0.05</ambient>
<depthXWidth>1024.0</depthXWidth>
<depthYWidth>1024.0</depthYWidth>
<depthNear>-10.0</depthNear>
<depthFar>20.0</depthFar>
<shadowBias>0.0</shadowBias>
<zUpVector>
<x>0.0</x>
<y>0.0</y>
<z>1.0</z>
</zUpVector>
<active />
<direction>
<x>-1.0</x>
<y>-2.0</y>
<z>1.0</z>
</direction>
<depthScale>0.0015</depthScale>
<relPointVector>
<x>0.0</x>
<y>0.0</y>
<z>0.0</z>
</relPointVector>
</directionalLight>
<directionalLight>
<name>DefaultLight03</name>
<joint>base</joint>
<color R="255" G="255" B="255" />
<ambient>0.05</ambient>
<depthXWidth>1024.0</depthXWidth>
<depthYWidth>1024.0</depthYWidth>
<depthNear>-10.0</depthNear>
<depthFar>20.0</depthFar>
<shadowBias>0.0</shadowBias>
<zUpVector>
<x>0.0</x>
<y>0.0</y>
<z>1.0</z>
</zUpVector>
<active />
<direction>
<x>1.0</x>
<y>-1.0</y>
<z>-2.0</z>
</direction>
<depthScale>0.0015</depthScale>
<relPointVector>
<x>0.0</x>
<y>0.0</y>
<z>0.0</z>
</relPointVector>
</directionalLight>
<directionalLight>
<name>DefaultLight04</name>
<joint>base</joint>
<color R="255" G="255" B="255" />
<ambient>0.05</ambient>
<depthXWidth>1024.0</depthXWidth>
<depthYWidth>1024.0</depthYWidth>
<depthNear>-10.0</depthNear>
<depthFar>20.0</depthFar>
<shadowBias>0.0</shadowBias>
<zUpVector>
<x>0.0</x>
<y>0.0</y>
<z>1.0</z>
</zUpVector>
<active />
<direction>
<x>-1.0</x>
<y>2.0</y>
<z>1.0</z>
</direction>
<depthScale>0.0015</depthScale>
<relPointVector>
<x>0.0</x>
<y>0.0</y>
<z>0.0</z>
</relPointVector>
</directionalLight>
<pointLight>
<name>New_Light</name>
<joint>base</joint>
<color R="255" G="255" B="255" />
<ambient>0.05</ambient>
<depthXWidth>1024.0</depthXWidth>
<depthYWidth>1024.0</depthYWidth>
<depthNear>0.1</depthNear>
<depthFar>100.0</depthFar>
<shadowBias>0.0</shadowBias>
<zUpVector>
<x>0.0</x>
<y>0.0</y>
<z>1.0</z>
</zUpVector>
<active />
<position>
<x>0.0</x>
......@@ -618,6 +713,12 @@
<lin>0.0</lin>
<quad>0.0</quad>
</attenuation>
<depthFovRad>1.0</depthFovRad>
<shadowDirVector>
<x>0.0</x>
<y>-1.0</y>
<z>0.0</z>
</shadowDirVector>
</pointLight>
</lights>
</x3D>
......
......@@ -72,8 +72,8 @@ if( FLAG_SHARED_LIB OR FLAG_SEPARATE_SYMBOLIC )
if((NOT UNIX) AND (NOT FLAG_SEPARATE_SYMBOLIC))
add_custom_command(TARGET Project_symbolic POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_BINARY_DIR}/Debug/Project_symbolic.dll
${CMAKE_CURRENT_BINARY_DIR}/../Debug/Project_symbolic.dll
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/Project_symbolic.dll
${CMAKE_CURRENT_BINARY_DIR}/../$<CONFIGURATION>/Project_symbolic.dll
)
endif()
......@@ -91,7 +91,12 @@ endif()
# MBSysC libraries
if ( FLAG_SEPARATE_BUILD ) # find MBSysC dynamic libraries
find_package( LibRobotranC 1.9.7 REQUIRED )
find_package( LibRobotranC 1.10.0 REQUIRED )
add_definitions(${LIB_MBSYSC_DEFINITIONS})
target_link_libraries(Project_symbolic ${LIB_MBSYSC_MODULES})
endif()
# Windows M_PI definitions
if (WIN32)
add_definitions(-D _USE_MATH_DEFINES)
endif (WIN32)
......@@ -26,6 +26,11 @@ if (UNIX)
set(CMAKE_EXE_LINKER_FLAGS "-fPIC")
endif (UNIX)
# Windows M_PI definitions
if (WIN32)
add_definitions(-D _USE_MATH_DEFINES)
endif (WIN32)
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# SEPARATE COMPILATION
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -115,8 +120,8 @@ if( FLAG_SHARED_LIB OR FLAG_SEPARATE_USER_FCT )
if((NOT UNIX) AND (NOT FLAG_SEPARATE_USER_FCT))
add_custom_command(TARGET Project_userfct POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_BINARY_DIR}/Debug/Project_userfct.dll
${CMAKE_CURRENT_BINARY_DIR}/../Debug/Project_userfct.dll
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/Project_userfct.dll
${CMAKE_CURRENT_BINARY_DIR}/../$<CONFIGURATION>/Project_userfct.dll
)
endif()
......@@ -131,7 +136,7 @@ endif()
# MBSysC libraries
if ( FLAG_SEPARATE_BUILD ) # find MBSysC dynamic libraries
find_package( LibRobotranC 1.9.7 REQUIRED )
find_package( LibRobotranC 1.10.0 REQUIRED )
add_definitions(${LIB_MBSYSC_DEFINITIONS})
endif()
......
......@@ -7,16 +7,16 @@
// Last update : 01/10/2008
//---------------------------
#include "math.h"
#define _USE_MATH_DEFINES // to use M_PI in Windows
#include "math.h"
#include "MBSdef.h"
#include "mbs_data.h"
#include "user_model.h"
#include "user_model.h"
#include "set_output.h"
#include "useful_functions.h"
double* user_JointForces(MbsData *mbs_data, double tsim)
{
zeros_dvec_1(mbs_data->Qq);
return mbs_data->Qq;
}
......@@ -40,7 +40,6 @@ void mbs_delete_user_model(UserModel* um)
void mbs_load_user_model_xml(MDS_gen_strct* gen, UserModel* um)
{
int ind;
int ind_state_value = 1;
um->Bushing.K = gen->user_models->user_model_list[0]->parameter_list[0]->value_list[0];
......
......@@ -22,9 +22,6 @@ endif ()
# project name
project (MultiplePendulum)
# project configuration
set( CMAKE_C_FLAGS_RELEASE "-O3" )
set( CMAKE_CXX_FLAGS_RELEASE "-O3" )
# Variable for storing the path to Robotran common files (should be adapted depending on the location of those source)
if(NOT DEFINED ROBOTRAN_SOURCE_DIR)
......@@ -174,7 +171,7 @@ flags_clean()
if ( FLAG_SEPARATE_BUILD ) # find MBSysC dynamic libraries
find_path(LibRobotranC_DIR LibRobotranCConfig.cmake "${ROBOTRAN_SOURCE_DIR}/build")
find_package( LibRobotranC 1.9.7 REQUIRED )
find_package( LibRobotranC 1.10.0 REQUIRED )
target_link_libraries( ${Executable} ${LIB_MBSYSC_MODULES} ${LIB_MBSYSC_LOAD} ${LIB_MBSYSC_UTILITIES} )
add_definitions(${LIB_MBSYSC_DEFINITIONS})
......
......@@ -224,20 +224,16 @@ print '----'
for i in xrange(1200):
chipy.IncrementStep()
chipy.MBS3D_IncrementStep()
chipy.ComputeFext()
chipy.ComputeBulk()
chipy.ComputeFreeVelocity()
chipy.MBS3D_ComputeFreeVelocity()
chipy.SelectProxTactors(freq_detect)
chipy.RecupRloc()
chipy.ExSolver(**solver_params)
chipy.StockRloc()
chipy.ComputeDof()
chipy.MBS3D_ComputeDof()
chipy.WriteDisplayFiles(freq_display,ref_radius)
chipy.UpdateStep()
chipy.MBS3D_UpdateDof()
chipy.ClosePostproFiles()
chipy.CloseDisplayFiles()
......
<?xml version="1.0" encoding="UTF-8"?>
<mbsDescR7>
<mbsname>PendulumSpringC</mbsname>
<mbsyspad_version>1.9.6</mbsyspad_version>
<mbsyspad_version>1.9.7</mbsyspad_version>
<base>
<!--this is the base body-->
<gravity>
......@@ -112,7 +112,7 @@
<specularColor R="255" G="255" B="255" />
<shininess>250.0</shininess>
<transparency>0.0</transparency>
<url>PRJPATH/animationR/vrml/base3.wrl</url>
<url>PRJPATH\animationR\vrml\base3.wrl</url>
</inline>
<box>
<name>Wall</name>
......@@ -293,7 +293,7 @@
<specularColor R="255" G="255" B="255" />
<shininess>250.0</shininess>
<transparency>0.0</transparency>
<url>PRJPATH/animationR/vrml/pendulum2.wrl</url>
<url>PRJPATH\animationR\vrml\pendulum2.wrl</url>
</inline>