Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
H3D.org Feeds

Forum Index


Board index » All Posts (paboz)




Re: Vibration using Phantom Omni
#1
Not too shy to talk
Not too shy to talk


Thank you for the response! I'll see if I can adapt it somehow to my problem.
The fact is that I'm using the device to navigate a 3D scene and so the proxy is moving continuosly. So, If I got the idea, I'll have to move the plane (or box) together with the proxy.

Furthermore, I'm trying to make a sort of guidance along a trajectory: when the orientation of the device does not agree with the suggested one I send a force towards the device +y-axis so as to block the advance of the proxy in the virtual scene. But also this force make the device vibrate (for the same reason explained before, I guess). This last force is calculated and sent in the same way as the other force.
Any suggestions for this case?

thank you for any help and have a nice day!

Paolo

Posted on: 2011/3/8 10:50
Top


Re: Vibration using Phantom Omni
#2
Not too shy to talk
Not too shy to talk


Thanks for the replies!
I think the problem is more about a wrong way to send forces to the device.
I'll describe what I'm trying to do and if you can guide me to a better solution i'll appreciate.
I want to constrain the device to stay at a zero position in the X-axis, in other words let it free to move along z and y axis but send a force that bring it back if the device is moved along x-axis.
I'm doing this with an AutoUpdate node which "updates" its values when the device position change:

class devNavigatorTrsf : public AutoUpdate<SFVec3f> {
    
/// class devNavigatorTrsf
    /// H3D:AutoUpdate Class in charge of reading the device position and
    /// setting the value of the translational linear velocity (vel), which is Delta Z.

    
HAPI::Vec3 force_to_render;
    
virtual void update(){
        
AutoUpdate<SFVec3f>::update();
        
devpos value;

        
// vel=f(deltaY)
        
devdiffdevpos-Vec3f(0.,0.1,0.);
        
        if (
abs(devpos.x)>eps) {
            if (
devdiff.x>0)  force_to_renderHAPI::Vec3(-(devdiff.x-eps)*50,0,0);
            else 
force_to_renderHAPI::Vec3(-(devdiff.x+eps)*50,0,0);
            
device=static_cast<HAPI::PhantomHapticsDevice*> (hdev->getHAPIDevice());

HAPI::HapticForceField(force_to_render);

            
device->addEffect(new HAPI::HapticForceField(force_to_render));
            
device->transferObjects();

        }

    }
};


and then, when pressing the start button in my application:
devNavigatorTrsf *devNavigatorTrsfObj = new devNavigatorTrsf();

hdev->devicePosition->route(devNavigatorTrsfObj);


where hdev is "PhantomDevice *hdev;".
Could the vibration be caused for the fact that the force is updated at a lower frequency than the haptic loop and lasts just for one haptic loop (and so in a graphic loop would be one haptic period with force and the other with null force)?
Is there a better way to do it?

I hope I had explained myself.

Thanks for any help. And have a nice day!

Paolo

Posted on: 2011/3/3 11:37
Top


Vibration using Phantom Omni
#3
Not too shy to talk
Not too shy to talk


Hi everyone!!
I am using a Phantom Omni and I noticed that its behaviour is different, depending on the computer and the OS where my application is running.
One of the features of my application is to costrain the device in a position with the x-component equal to zero. It is done by sending a force proportional to its x-position.
When I tested the application in my laptop with Centrino Duo, Windows Vista (32 bits) it worked fine with a smooth reaction to the x displacement.
But the device responds vibrating (to the desplacement) if the application runs in PC iCore7, Windows7, 32 bits or in the same PC with Debian Squeeze 6.0, 64 bits.
It presents vibrations also using the described laptop but with Windows 7 instead of Vista.
In every case OpenHaptics Academic Edition is used.

How can I avoid the problem of vibrations and make the action smoother? Could it be something related with the drivers?
Thank you for any suggestion.
And have a good night or day!

Paolo

Posted on: 2011/2/16 18:00
Top


Re: phantom omni is vibrating when running demo program
#4
Not too shy to talk
Not too shy to talk


Hi everyone!!

I'll "exploit" this thread because something similar happens to me, too.

I am using a Phantom Omni and I noticed that its behaviour is different, depending on the computer where my application is running. In fact, when a force is sent to the device, it vibrates a lot in one computer (iCore7, with Windows7, 32 bits), whereas it responds more smoothly in the other (Centrino Duo, Windows Vista, 32 bits).
Also using the first computer with Debian in 64 bits, the Omni responds with vibrations.

Thank you for any suggestion.
And have a good night or day

Paolo

Posted on: 2011/2/9 20:38
Top


Re: H3D tree in C++ and Closest point
#5
Not too shy to talk
Not too shy to talk


Thank you Markus, very precious suggestions as usual!
It was beacause I was doing the closestPoint before setting up opengl.

I'll have another question... does Quaternion and Rotation have any difference (beside the normalization)? In other words, the 4 H3DFloat parameters that Quaternion take as arguments are : cos(theta/2) as scalar and (sin(theta/2)*Rx,sin(theta/2)*Ry,sin(theta/2)*Rz) as the vectorial part?

thank you and have a nice day!
Paolo

Posted on: 2010/11/17 12:33
Top


H3D tree in C++ and Closest point
#6
Not too shy to talk
Not too shy to talk


Hi everybody!
I'm trying to create an X3D-Node from string, containing an "empty" line set, i.e. leaving empty
the fields vertexCounts and point (of node coordinate) and adding the data with an external vector (my_coords) :

void PathManager::drawLineSetFromFile(string filepathGrouptopGroup){     
vector<double*> vecPoint;
vectorVec3f my_coords//vector containing the points of the line      
X3D::DEFNodes *tempDefNodes= new X3D::DEFNodes();     
AutoRefShape >tempTransform(static_castShape * >(     
X3D::createX3DNodeFromString(     
"  <Shape DEF="SHAPE" >n"
"     <Appearance>n"     
"        <Material DEF="
MATERIAL" emissiveColor="1 0 0" />n"     
"     </Appearance>n"     
"<LineSet DEF="
LINEA" >n"     
"<Coordinate DEF="
COORD_NODE"/>n"      
"</LineSet>"     
"  </Shape> n"
tempDefNodes ).get() ) );       

// Defining Line and associates the reference to the node of the structure file
LineSet *pathLine=NULL//= new LineSet(); 
tempDefNodes->getNode("LINEA",pathLine);      

// Defining how many points have to be taken to draw the line     
pathLine->vertexCount->push_back(my_coords.size());

// Defining the coordinate node. It will contain the R3 points.     
Coordinate *coord_node=NULL;//= new Coordinate();     
tempDefNodes->getNode("COORD_NODE",coord_node);      

// inserting the points in the lineSet     
coord_node->point->setValuemy_coords );      

//inserting the line like child of the top group node to render it graphically     
topGroup->children->push_back(tempTransform.get()); }


Everything goes well when I try to draw the line (setting the sceneRoot to topGroup and rendering it on a GLUTWindow), but when I want to use closestPoint(), in the same function, by doing:


H3D::Node::NodeIntersectResult resultNear;     
topGroup->closestPoint(Vec3f(-10,0,1),resultNear);     
resultNear.transformResult();     
cout << resultNear.result[0].point;


it returns (0,0,0) as the nearest point (which should be (-10,0,0) considering the vector I inserted in coord and the drawn line) and the following errors:

OpenGL error befor H3DDisplayListObject::DisplayList::callList() Error: "no valid operation" when rendering parent of LINEA.displayList
OpenGL error in render() Error:"no valid operation" when rendering parent of LINEA.displayList

Can anyone clarify how to solve this or how is it possible to modify the H3D tree dinamically by C++?
Thank you for any suggestion and have a great "week-second-half" !

Paolo

Posted on: 2010/11/10 12:49
Top


rewind the exploration
#7
Not too shy to talk
Not too shy to talk


Hi Everybody!
I made an application which allows me to navigate a scene using the haptic device to move the viewpoint position and orientation (let say, something similar to the H3D flight example).

But when I go backwards, i would like to follow the same path I followed to get to the point I stay (having the same orientation, too), a sort of rewind of the exploration I made.
Is there any method to store/access tracker positions and orientations so that I can use them to set the viewpoint when i need to?

As an alternative, would it be a good idea to use a C++ vector and push_back/pop_back the values i need, at a certain frequency?

I hope I managed to explain the problem well.

Thanks for the attention.

Paolo

Posted on: 2010/7/5 16:36
Top


Re: define stiffness in a .wrl file from C++
#8
Not too shy to talk
Not too shy to talk


I understand that, in this case, it is not possible to set stiffness without having a reference to the right node, isn't it?

I tryed as you described and it works!

Thank you very much Markus!

Paolo

Posted on: 2010/6/25 12:12
Top


Re: define stiffness in a .wrl file from C++
#9
Not too shy to talk
Not too shy to talk


I'll give you also the wrl (without numeric datas), it may help to understand.
The .wrl file is created by another software.
#VRML V2.0 utf8 CosmoWorlds V1.0

Group {
  
children Shape {
    
appearance Appearance {
      
material Material {
        
ambientIntensity 0.2
        diffuseColor 1 0.8 0.4
        emissiveColor 0 0 0
        specularColor 0.3 0.3 0.3
        shininess 0.2
        transparency 0
      
}
    }
    
geometry IndexedFaceSet {
      
coord Coordinate {
        
point [... ]
      }
  
solid FALSE
  coordIndex 
[...] 
  
normal Normal {
    
vector [ ... ]
  }
  
normalPerVertex TRUE
}
}
}

Posted on: 2010/6/22 19:14
Top


define stiffness in a .wrl file from C++
#10
Not too shy to talk
Not too shy to talk


Hi everybody!

I would like to load two different files and insert them in the same scene. One is a x3d file and the other a wrl file.
The x3d file contains a LineSet and the wrl file contains a IndexedFaceSet.
The approach I used is the following:
I created an x3d file with the device definition and two empty Group fields, one made to hold the wrl file and the other one to hold the x3d file. When running the program the scene is loaded in the right way.

What I would like to do is to specify a stiffness for the shape defined in the wrl file and I would like to do it using C++. I'm loading both files using "createX3DFromURL" and inserting them in the "empty" X3D file.

I hope having explained myself clearly enough.
Thanks everybody for the attention.

Paolo

Posted on: 2010/6/22 18:40
Top



TopTop
(1) 2 »






(C) 2012 SenseGraphics AB    ---    Powered by XOOPS