Home › Forum › SOFA › Programming with SOFA › [SOLVED] Using NI library in sofa envronment
Tagged: 64_bits, SOFA_1509, Windows_81
- This topic has 16 replies, 2 voices, and was last updated 8 years, 8 months ago by Hugo.
-
AuthorPosts
-
7 March 2016 at 11:41 #6050MadaniBlocked
I want to use a force sensor in my model and simulate an admittance control strategy in sofa. For doing this I need to feed the data I receive from NI data acquisition board into sofa plug in. I have written my own plug in to use external data into sofa and I also have the code which reads the force sensor using NI library and it works fine as an individual program.but when I put it in my sofa code I can not compile the program. To make it simple : I need to add NI library to plug in of sofa (at least that’s what I think needs to be done).Doeas anyone have any idea what should I do? I would appreciate any help. thanks!
7 March 2016 at 18:52 #6099HugoKeymasterDear Medhi,
Even if this is not working, you did well for the first steps. Creating a specific plugin which includes a component making the interface between the NI acquisition board and SOFA is a good start.
You need to make sure that your plugin includes all the NI dependencies. In the documentation Create your Plugin, in the section “CMake configuration/CMakeList.txt”, a default CMakeList was described. In your case, you need to make sure that the target_link_libraries() function includes the NI library. You also might have to add the include NI directories using the CMake function include_directories(). You can find examples in the plugins (applications/plugin): Sensable (OpenHaptics librabry), LeapMotion (LeapMotion library) or Xitact (XiRobot library).
Could you tell us more about the error you have?
you said you “cannot compile the program”Cheers,
Hugo
8 March 2016 at 11:44 #6116MadaniBlockedThanks for your reply Hugo. My code for data reading from NI acquisition board is this:
*******************************************************************************************
#define DAQmxErrChk(functionCall) { if( DAQmxFailed(error=(functionCall)) ) { goto Error; } } int main(int argc, char *argv[]) { printf("Example will halt automatically.\n"); DAQmxErrChk (DAQmxBaseCreateTask("",&taskHandle)); DAQmxErrChk (DAQmxBaseCreateAIVoltageChan(taskHandle,chan,"",DAQmx_Val_Cfg_Default,min,max,DAQmx_Val_Volts,NULL)); DAQmxErrChk (DAQmxBaseCfgSampClkTiming(taskHandle,clockSource,sampleRate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,samplesPerChan)); DAQmxErrChk (DAQmxBaseCfgInputBuffer(taskHandle,200000)); //use a 100,000 sample DMA buffer DAQmxErrChk (DAQmxBaseStartTask(taskHandle)); // The loop will quit after 10 seconds startTime = time(NULL); while( time(NULL)<startTime+10 ) { DAQmxErrChk (DAQmxBaseReadAnalogF64(taskHandle,pointsToRead,timeout,DAQmx_Val_GroupByScanNumber,data,bufferSize*2,&pointsRead,NULL)); totalRead += pointsRead; printf("Acquired %ld samples. Total %ld\n",pointsRead,totalRead); // Just print out the first 10 points of the last data read for (i = 0; i < 10; ++i) printf ("data0[%ld] = %f\tdata1[%ld] = %f\n",i,data[2*i],i,data[2*i+1]); } printf("\nAcquired %ld total samples.\n",totalRead); Error: if( DAQmxFailed(error) ) DAQmxBaseGetExtendedErrorInfo(errBuff,2048); if(taskHandle != 0) { DAQmxBaseStopTask (taskHandle); DAQmxBaseClearTask (taskHandle); } if( DAQmxFailed(error) ) printf ("DAQmxBase Error %ld: %s\n", error, errBuff); }
***********************************************************************************
The error I get is that DAQmxBaseStartTask identifier not found although I have attached NI library header to my plugin header and defined the functions in the public section of MyBehaviorModel.h .this is one of the functions the same applies to other functions as well. I will go through what you suggested and will let you know.
25 March 2016 at 17:45 #6380HugoKeymasterDear Madani,
Sorry for the late reply.
Many things are going on for the Consortium.
Did you solve your issue?
If not, when compiling your plugin, are the NI library well appearing in the make process? If you have a doubt about your CMakeList file, we can also have a look for you.Best,
Hugo
4 April 2016 at 13:42 #6497MadaniBlockedThank you so much Hugo
I can imagine how busy you are and sorry for my late reply as well, I was out of office last week.My problem still exists but I get different error (LK2019). I think that’s because I do not include NIDAQ library correctly. Thanks for your suggestion, it would be a great help if you can take a look at it.Here is my CMakeList file content:
cmake_minimum_required(VERSION 2.8.12) project(PluginExample) set(HEADER_FILES MyBehaviorModel.h MyMappingPendulumInPlane.h MyMappingPendulumInPlane.inl MyProjectiveConstraintSet.h MyProjectiveConstraintSet.inl NIDAQmx.h config.h ) set(HEADER_FILES_TO_MOC MyDataWidgetUnsigned.h ) set(SOURCE_FILES MyBehaviorModel.cpp MyDataWidgetUnsigned.cpp MyMappingPendulumInPlane.cpp MyProjectiveConstraintSet.cpp initPlugin.cpp ) set(README_FILES PluginExample.txt) find_package(SofaGui REQUIRED) find_package(Qt4 REQUIRED) qt4_wrap_cpp(MOCCED_HEADER_FILES ${HEADER_FILES_TO_MOC}) add_library(${PROJECT_NAME} SHARED ${HEADER_FILES_TO_MOC} ${MOCCED_HEADER_FILES} ${HEADER_FILES} ${SOURCE_FILES} ${README_FILES}) set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_PLUGINEXAMPLE") target_link_libraries(${PROJECT_NAME} SofaGuiQt NIDAQmx.lib) include_directories("${CMAKE_CURRENT_SOURCE_DIR}/.. git/sofa/application/plugins/PluginExample") install(TARGETS ${PROJECT_NAME} COMPONENT PluginExample_libraries EXPORT PluginExampleTargets RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
Regards,
Mehdi
4 April 2016 at 14:04 #6500HugoKeymasterHi Medhi,
I just found this topic: https://github.com/pyrech/telemetre/blob/master/projet_cmake/ihm/CMakeLists.txt. Have a look lines 15-16 and 59-61.
I think your CMake should include the same instructions.
Let me know if this helps. If no, could you send us the errors as well.Cheers,
Hugo
4 April 2016 at 14:55 #6509MadaniBlockedThanks
I did what you said and now I get this error:(TARGET_LINK_LIBRARIES):
Cannot specify link libraries for target “PluginExample” which is not built
by this project.and my CmaleLists is like this now:
cmake_minimum_required(VERSION 2.8.12) project(PluginExample) # For NIDAQ IF(WIN32) INCLUDE_DIRECTORIES("C:\\Program Files (x86)\\National Instruments\\NI-DAQ\\DAQmx ANSI C Dev\\include") LINK_DIRECTORIES("C:\\Program Files (x86)\\National Instruments\\NI-DAQ\\DAQmx ANSI C Dev\\lib\\msvc") ENDIF (WIN32) set(HEADER_FILES MyBehaviorModel.h MyMappingPendulumInPlane.h MyMappingPendulumInPlane.inl MyProjectiveConstraintSet.h MyProjectiveConstraintSet.inl NIDAQmx.h config.h ) set(HEADER_FILES_TO_MOC MyDataWidgetUnsigned.h ) set(SOURCE_FILES MyBehaviorModel.cpp MyDataWidgetUnsigned.cpp MyMappingPendulumInPlane.cpp MyProjectiveConstraintSet.cpp initPlugin.cpp ) set(README_FILES PluginExample.txt) find_package(SofaGui REQUIRED) find_package(Qt4 REQUIRED) qt4_wrap_cpp(MOCCED_HEADER_FILES ${HEADER_FILES_TO_MOC}) IF(WIN32) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${QT_LIBRARIES} NIDAQmx ) ENDIF (WIN32) add_library(${PROJECT_NAME} SHARED ${HEADER_FILES_TO_MOC} ${MOCCED_HEADER_FILES} ${HEADER_FILES} ${SOURCE_FILES} ${README_FILES}) set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_PLUGINEXAMPLE") target_link_libraries(${PROJECT_NAME} SofaGuiQt NIDAQmx.lib) include_directories("${CMAKE_CURRENT_SOURCE_DIR}/.. git/sofa/application/plugins/PluginExample") install(TARGETS ${PROJECT_NAME} COMPONENT PluginExample_libraries EXPORT PluginExampleTargets RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
Regards,
4 April 2016 at 15:07 #6511HugoKeymasterHi Mehdi,
What is the name of your plugin?
Let’s take an example and let’s say your plugin is named “NIPlugin”.
Then, our convention is that your plugin is located in sofa/v15.12/src/applications/plugins/NIPlugin. Then, you CMakeList.txt must define the project name as “NIPlugin”. In your current file, you need to replace PluginExample with NIPlugin at lines 2,32,46,48,51 and 52.You just forgot you modify the name when copying the PluginExample.
Cheers,
Hugo
4 April 2016 at 15:24 #6516MadaniBlockedIt’s named PluginExample (I just modified existing plugin example of SOFA and put my own code inside it).
I did these steps still no progress (the same error occurs just the name changed from PluginExample to NIPlugin). Sorry if my problem seems so elementary and I bother you. A part is because I’m a mechanical engineer and not that much professional in C++.
Best,
Mehdi
5 April 2016 at 19:57 #6518MadaniBlockedgood news! I managed to compile it with CMake 3.3 but when I wan to build SOFA I encounter these kinds of error:
error C1083: Cannot open include file: ‘PluginExample/config.h’: No such file or directory (C:\git\sofa\applications\plugins\PluginExample\MyDataWidgetUnsigned.cpp) c:\git\sofa\applications\plugins\pluginexample\MyDataWidgetUnsigned.h
this happens for the files included in CMake. So I think CMake does not really include them when compiles SOFA. I also tried to copy them to the destination of SOFA built code but it did not work.
The other error is this:Error 3399 error C2491: ‘getModuleDescription’ : definition of dllimport function not allowed C:\git\sofa\applications\plugins\PluginExample\initPlugin.cpp
which I checked for the reason but I do not have _cdlcde which I want to delet.
By the way here is my current version of CMakeList.xt that I use:
cmake_minimum_required(VERSION 2.8.12) project(PluginExample) # For NIDAQ IF(WIN32) INCLUDE_DIRECTORIES("C:\\Program Files (x86)\\National Instruments\\NI-DAQ\\DAQmx ANSI C Dev\\include") LINK_DIRECTORIES("C:\\Program Files (x86)\\National Instruments\\NI-DAQ\\DAQmx ANSI C Dev\\lib\\msvc") ENDIF (WIN32) set(HEADER_FILES MyBehaviorModel.h MyMappingPendulumInPlane.h MyMappingPendulumInPlane.inl MyProjectiveConstraintSet.h MyProjectiveConstraintSet.inl NIDAQmx.h config.h ) set(HEADER_FILES_TO_MOC MyDataWidgetUnsigned.h ) set(SOURCE_FILES MyBehaviorModel.cpp MyDataWidgetUnsigned.cpp MyMappingPendulumInPlane.cpp MyProjectiveConstraintSet.cpp initPlugin.cpp ) set(README_FILES PluginExample.txt) find_package(SofaGui REQUIRED) find_package(Qt4 REQUIRED) qt4_wrap_cpp(MOCCED_HEADER_FILES ${HEADER_FILES_TO_MOC}) add_library(${PROJECT_NAME} SHARED ${HEADER_FILES_TO_MOC} ${MOCCED_HEADER_FILES} ${HEADER_FILES} ${SOURCE_FILES} ${README_FILES}) set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_PluginExample") target_link_libraries(${PROJECT_NAME} SofaGuiQt NIDAQmx.lib) include_directories("${CMAKE_CURRENT_SOURCE_DIR}/.. git/sofa/application/plugins/PluginExample") IF(WIN32) TARGET_LINK_LIBRARIES(${PROJECT_NAME} NIDAQmx.lib ${QT_LIBRARIES} NIDAQmx ) ENDIF (WIN32) install(TARGETS ${PROJECT_NAME} COMPONENT PluginExample_libraries EXPORT PluginExampleTargets RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
thanks beforehand.
Regards,
Mehdi
6 April 2016 at 14:02 #6521MadaniBlockedI started following the steps you mentioned and built a new plugin named NIPlugin and moved my codes there. and changed the main CMakeLists.txt so NIPlugin appears in the CMake menu. but I still get the same error.
CMake Error at applications/plugins/NIPlugin/CMakeLists.txt:39 (TARGET_LINK_LIBRARIES):
Cannot specify link libraries for target “NIPlugin” which is not built by
this project.and here is my CMakeLists.txt now:
cmake_minimum_required(VERSION 2.8.12) project(NIPlugin) # For NIDAQ IF(WIN32) INCLUDE_DIRECTORIES("C:\\Program Files (x86)\\National Instruments\\NI-DAQ\\DAQmx ANSI C Dev\\include") LINK_DIRECTORIES("C:\\Program Files (x86)\\National Instruments\\NI-DAQ\\DAQmx ANSI C Dev\\lib\\msvc") ENDIF (WIN32) set(HEADER_FILES MyBehaviorModel.h MyMappingPendulumInPlane.h MyMappingPendulumInPlane.inl MyProjectiveConstraintSet.h MyProjectiveConstraintSet.inl NIDAQmx.h config.h ) set(HEADER_FILES_TO_MOC MyDataWidgetUnsigned.h ) set(SOURCE_FILES MyBehaviorModel.cpp MyDataWidgetUnsigned.cpp MyMappingPendulumInPlane.cpp MyProjectiveConstraintSet.cpp initPlugin.cpp ) set(README_FILES NIPlugin.txt) find_package(SofaGui REQUIRED) find_package(Qt4 REQUIRED) qt4_wrap_cpp(MOCCED_HEADER_FILES ${HEADER_FILES_TO_MOC}) IF(WIN32) TARGET_LINK_LIBRARIES(${PROJECT_NAME} NIDAQmx.lib ${QT_LIBRARIES} NIDAQmx ) ENDIF (WIN32) add_library(${PROJECT_NAME} SHARED ${HEADER_FILES_TO_MOC} ${MOCCED_HEADER_FILES} ${HEADER_FILES} ${SOURCE_FILES} ${README_FILES}) set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_NIPlugin") target_link_libraries(${PROJECT_NAME} SofaGuiQt NIDAQmx.lib) include_directories("${CMAKE_CURRENT_SOURCE_DIR}/.. git/sofa/application/plugins/NIPlugin") install(TARGETS ${PROJECT_NAME} COMPONENT NIPlugin_libraries EXPORT NIPluginTargets RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
thanks again
Regards,
Mehdi
12 April 2016 at 13:06 #6529MadaniBlockedI can guess that you might be busy. Just to keep you updated I managed to remove all the errors and added NIDAQmx.lib in the CmakeList.txt using the following link https://mplab-ros-pkg.googlecode.com/svn-history/r48/trunk/nidaqIO/CMakeLists.txt but it seems I still could not link the library because I get LNK2019 errors.here are the errors:
Error 3 error LNK2019: unresolved external symbol DAQmxStopTask referenced in function "int __cdecl nidaq(int,char * * const)" (?nidaq@@YAHHQEAPEAD@Z) C:\Sofa\applications\plugins\NIPlugin\MyBehaviorModel.obj NIPlugin Error 2 error LNK2019: unresolved external symbol DAQmxStartTask referenced in function "int __cdecl nidaq(int,char * * const)" (?nidaq@@YAHHQEAPEAD@Z) C:\Sofa\applications\plugins\NIPlugin\MyBehaviorModel.obj NIPlugin Error 7 error LNK2019: unresolved external symbol DAQmxReadAnalogF64 referenced in function "int __cdecl nidaq(int,char * * const)" (?nidaq@@YAHHQEAPEAD@Z) C:\Sofa\applications\plugins\NIPlugin\MyBehaviorModel.obj NIPlugin Error 9 error LNK2019: unresolved external symbol DAQmxGetExtendedErrorInfo referenced in function "int __cdecl nidaq(int,char * * const)" (?nidaq@@YAHHQEAPEAD@Z) C:\Sofa\applications\plugins\NIPlugin\MyBehaviorModel.obj NIPlugin Error 1 error LNK2019: unresolved external symbol DAQmxCreateTask referenced in function "int __cdecl nidaq(int,char * * const)" (?nidaq@@YAHHQEAPEAD@Z) C:\Sofa\applications\plugins\NIPlugin\MyBehaviorModel.obj NIPlugin Error 5 error LNK2019: unresolved external symbol DAQmxCreateAIVoltageChan referenced in function "int __cdecl nidaq(int,char * * const)" (?nidaq@@YAHHQEAPEAD@Z) C:\Sofa\applications\plugins\NIPlugin\MyBehaviorModel.obj NIPlugin Error 4 error LNK2019: unresolved external symbol DAQmxClearTask referenced in function "int __cdecl nidaq(int,char * * const)" (?nidaq@@YAHHQEAPEAD@Z) C:\Sofa\applications\plugins\NIPlugin\MyBehaviorModel.obj NIPlugin Error 6 error LNK2019: unresolved external symbol DAQmxCfgSampClkTiming referenced in function "int __cdecl nidaq(int,char * * const)" (?nidaq@@YAHHQEAPEAD@Z) C:\Sofa\applications\plugins\NIPlugin\MyBehaviorModel.obj NIPlugin Error 8 error LNK2019: unresolved external symbol DAQmxCfgInputBuffer referenced in function "int __cdecl nidaq(int,char * * const)" (?nidaq@@YAHHQEAPEAD@Z) C:\Sofa\applications\plugins\NIPlugin\MyBehaviorModel.obj NIPlugin Error 10 error LNK1120: 9 unresolved externals C:\Sofa\bin\Debug\NIPlugin_d.dll 1 NIPlugin 1
I even added the NIDAQmx.lib to external dependecy of the plugin properties in VisualStudio but it does not seem to work.
Regards,
Mehdi
15 April 2016 at 09:13 #6536MadaniBlockedMy last discovery is this: Now I am sure that I am adding NIDAQmx.lib to my project when I build it with CMake. I think the problem is in this part of NIDAQmx.h :
#if defined(__linux__) || defined(__APPLE__) #define __CFUNC #define __CFUNC_C #define __CFUNCPTRVAR #define CVICDECL #define CVICALLBACK CVICDECL #else #define __CFUNC __stdcall #define __CFUNC_C __cdecl #define __CFUNCPTRVAR __cdecl #define CVICDECL __cdecl #define CVICALLBACK CVICDECL #endif
and now the errors are like these:
Error 4135 error LNK2019: unresolved external symbol DAQmxCreateTask referenced in function "public: virtual void __cdecl sofa::component::behaviormodel::MyBehaviorModel::updatePosition(double)" (?updatePosition@MyBehaviorModel@behaviormodel@component@sofa@@UEAAXN@Z) C:\Sofa\applications\plugins\NIPlugin\MyBehaviorModel.obj NIPlugin Error 4136 error LNK2019: unresolved external symbol DAQmxStartTask referenced in function "public: virtual void __cdecl sofa::component::behaviormodel::MyBehaviorModel::updatePosition(double)" (?updatePosition@MyBehaviorModel@behaviormodel@component@sofa@@UEAAXN@Z) C:\Sofa\applications\plugins\NIPlugin\MyBehaviorModel.obj NIPlugin Error 4137 error LNK2019: unresolved external symbol DAQmxStopTask referenced in function "public: virtual void __cdecl sofa::component::behaviormodel::MyBehaviorModel::updatePosition(double)" (?updatePosition@MyBehaviorModel@behaviormodel@component@sofa@@UEAAXN@Z) C:\Sofa\applications\plugins\NIPlugin\MyBehaviorModel.obj NIPlugin Error 4138 error LNK2019: unresolved external symbol DAQmxClearTask referenced in function "public: virtual void __cdecl sofa::component::behaviormodel::MyBehaviorModel::updatePosition(double)" (?updatePosition@MyBehaviorModel@behaviormodel@component@sofa@@UEAAXN@Z) C:\Sofa\applications\plugins\NIPlugin\MyBehaviorModel.obj NIPlugin Error 4139 error LNK2019: unresolved external symbol DAQmxCreateAIVoltageChan referenced in function "public: virtual void __cdecl sofa::component::behaviormodel::MyBehaviorModel::updatePosition(double)" (?updatePosition@MyBehaviorModel@behaviormodel@component@sofa@@UEAAXN@Z) C:\Sofa\applications\plugins\NIPlugin\MyBehaviorModel.obj NIPlugin Error 4140 error LNK2019: unresolved external symbol DAQmxCfgSampClkTiming referenced in function "public: virtual void __cdecl sofa::component::behaviormodel::MyBehaviorModel::updatePosition(double)" (?updatePosition@MyBehaviorModel@behaviormodel@component@sofa@@UEAAXN@Z) C:\Sofa\applications\plugins\NIPlugin\MyBehaviorModel.obj NIPlugin Error 4141 error LNK2019: unresolved external symbol DAQmxReadAnalogF64 referenced in function "public: virtual void __cdecl sofa::component::behaviormodel::MyBehaviorModel::updatePosition(double)" (?updatePosition@MyBehaviorModel@behaviormodel@component@sofa@@UEAAXN@Z) C:\Sofa\applications\plugins\NIPlugin\MyBehaviorModel.obj NIPlugin Error 4142 error LNK2019: unresolved external symbol DAQmxCfgInputBuffer referenced in function "public: virtual void __cdecl sofa::component::behaviormodel::MyBehaviorModel::updatePosition(double)" (?updatePosition@MyBehaviorModel@behaviormodel@component@sofa@@UEAAXN@Z) C:\Sofa\applications\plugins\NIPlugin\MyBehaviorModel.obj NIPlugin Error 4143 error LNK2019: unresolved external symbol DAQmxGetExtendedErrorInfo referenced in function "public: virtual void __cdecl sofa::component::behaviormodel::MyBehaviorModel::updatePosition(double)" (?updatePosition@MyBehaviorModel@behaviormodel@component@sofa@@UEAAXN@Z) C:\Sofa\applications\plugins\NIPlugin\MyBehaviorModel.obj NIPlugin Error 4144 error LNK1120: 9 unresolved externals C:\Sofa\bin\Debug\NIPlugin_d.dll NIPlugin
As you see there is a __cdecl prefix before sofa class definition in NIDAQmx.h which prevents it to match the definition I have in the source file.and if I remove this part of NI code I receive multiple other errors which indicate I have not declared the functions and lots of syntax errors.
As an example here is the definition of DAQmxCreateTask in NIDAQmx.h:
int32 __CFUNC DAQmxCreateTask (const char taskName[], TaskHandle *taskHandle);
which has a __cdecl at the beginning because of the first definition in windows environment.and another problem is that I don’t know what is inside NIDAQmx.lib and how it is defined so I can match my definition to that.
after all I don’t have that much knowledge of C++ coding concept to find out where the problem lies. My thesis will be finished if I can remove these errors and make the code work 🙂
Thank you again.
18 April 2016 at 17:58 #6546MadaniBlockedFinally the problem is solved!!!
It turned out that NI has two versions of NIDAQmx.lib files one for 32bit operationg systems and another one for 64bit ones. and apparently I was using 32bit version although my project was compiled on 64bit operating system and 64bit mode in VS2012.
For others who might wonder where it is located, if you had installed NIDAQmx correctly you should be able to find it in the following directory:<Program Files>\NationalInstruments\Shared\ExternalCompilerSupport\C\lib64\msvc
Good Luck,
Mehdi
21 April 2016 at 14:13 #6558HugoKeymasterDear @mehdimadani,
This is very nice to hear!
Sorry for the delay of my reply. I was away for two weeks.
Let us know if you face any other issue so that we can assist you.Best,
Hugo
21 April 2016 at 22:08 #6597MadaniBlockedThank you so much Hugo!
I guessed that you might have been busy. I have another question which is not related to this topic but I first just wanted to make sure if it is possible or not and then ask the detail in another post.
Is it possible to have text or simulation data on SOFA screen while simulating a scene?Thanks again,
Mehdi
22 April 2016 at 08:39 #6598HugoKeymasterHi Medhi,
Indeed it is feasible to add text/simulation data. But it depends on how/what you want to do.
As you can see, in the GUI of runSofa the time of simulation can thus be displayed. To do so, the GUI has to be modified.
Otherwise (simpler), you can implement the draw() function in the appropriate component and define the text/info you want to display using the usual OpenGL functions.Cheers,
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.