- This topic has 3 replies, 2 voices, and was last updated 3 years, 10 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Programming with SOFA › [SOLVED] Geomagic Plugin: Printing haptic force in Console
Tagged: 64_bits, Plugin_Geomagic, SOFA_2006, Windows_10
I didn’t feel any haptic force using scenes in Geomagic plugin. Thus, I tried to print the haptic force, but it didn’t work.
1. I add a Data<Vec3d> d_foce
in GeomagicDriver.h
. d_force
is used to store haptic force.
2. In GeomagicDriver.cpp:HDCallbackCode HDCALLBACK stateCallback(void * userData)
, the haptic force d_force
is assigned as: driver->d_force.setValue(Vec3(omni_force[0], omni_force[0], omni_force[0]));
3. The d_force
could be printed in consle using msg_info()
in Draw
method in GeomagicDriver.cpp
.
msg_info() << "haptic force: [" << force[0] << "," << force[1] << "," << force[2] << "\n";
Eventhough the printlog
option of Geomagic plugin is checked, there still isn’t any messages.
By the way, using the same procedure as above, the haptic frequency could be printed out when the printlog
option of LCPForceFeedback
is checked.
Oh, I make a stupid mistake: choosing the wrong component when clicking printlog
. The precedure above is right. I could print out the haptic force.
What’s more, how can I store the haptic force into a file?
Hey @yupeng,
You can use either your own way of exporting in a file in C++ (since you started to implement things on your own).
Otherwise, take a look at the VTKExporter for instance which allows to export positions, or any other nodal/element information.
Best
Hugo
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.