0% found this document useful (0 votes)
482 views

Lectur07-Introduction To CHAI3D

Virtual Reality course at the University of Ottawa ELG5124

Uploaded by

t1888
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
482 views

Lectur07-Introduction To CHAI3D

Virtual Reality course at the University of Ottawa ELG5124

Uploaded by

t1888
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Introduction to CHAI3D

Virtual Environments ELG5124/CSI5151 Fall 2011


Jochen Lang SITE, University of Ottawa Canada Haptics SDK
computer haptics interface to different hardware, extensible (see assignment 3) haptics rendering loop haptic effects visualization graphics support based on openGL and GLUT visual rendering loop scenegraph interactive real-time simulation real collision detection, timers and thread management
Jochen Lang

Overview: Haptic Control Loops


Input Loop
Force Force

Haptic Rendering
Force Haptic Rendering Position

Haptic Rendering Position Force Computation

User Control Position

Actuators

Object Response

Collision Detection

Device + Biomechanics

Output Loop

Adapted from M.C. Lin and M.A. Otaduy, Recent advances in haptic rendering and applications, Otaduy, SIGGRAPH course notes, 2005.
Jochen Lang Jochen Lang

Generic Haptic Devices Key Methods


class cGenericHapticDevice : public cGenericDevice // Read the position of the device. Units are meters [m]. int getPosition(cVector3d& a_position) // Read the orientation frame of the device end-effector. int getRotation(cMatrix3d& a_rotation) // Read the linear velocity of the device. Units are meters per second [m/s]. int getLinearVelocity(cVector3d& a_linearVelocity) // Read the angular velocity of the device. Units are in radians per second [m/s]. int getAngularVelocity(cVector3d& a_angularVelocity) // Send a force [N] to the haptic device. int setForce(cVector3d& a_force) // Read a sensed force [N] from the haptic device. int getForce(cVector3d& a_force) // Send a torque [N*m] to the haptic device. int setTorque(cVector3d& a_torque) // Read a sensed torque [N*m] from the haptic device. int getTorque(cVector3d& a_torque) // read the status of the user switch [\b true = \b ON / \b false = \b OFF]. int getUserSwitch(int a_switchIndex, bool& a_status) // Get the specifications of the current device. cHapticDeviceInfo getSpecifications()
Jochen Lang

Generic Haptic Devices State


class cGenericHapticDevice : public cGenericDevice // Open connection to haptic device (0 indicates success). int open() // Close connection to haptic device (0 indicates success). int close() // Initialize or calibrate haptic device (0 indicates success). int initialize(const bool a_resetEncoders=false) // Get the specifications of the current device cHapticDeviceInfo getSpecifications()}

Jochen Lang

Haptic Device Handler


class cHapticDeviceHandler
// Returns the number of devices connected to your computer.

Connecting to a haptic device


// create a haptic device handler handler = new cHapticDeviceHandler(); // get access to the first available haptic device cGenericHapticDevice* hapticDevice; handler->getDevice(hapticDevice, 0); // retrieve information about the current haptic device cHapticDeviceInfo info= hapticDevice->getSpecifications();

unsigned int getNumDevices() getNumDevices()


// Updates information regarding the devices that are connected to your computer.

void update();
// Returns the specifications of the ith device.

int getDeviceSpecifications( getDeviceSpecifications( cHapticDeviceInfo& a_deviceSpecifications, cHapticDeviceInfo& a_deviceSpecifications, unsigned int a_index = 0);
// Returns a handle to the ith device if available.

int getDevice(cGenericHapticDevice*& a_hapticDevice, getDevice(cGenericHapticDevice*& a_hapticDevice, unsigned int a_index = 0);


Jochen Lang

cHapticDeviceInfo string m_manufacturerName; double m_maxForce; double m_workspaceRadius; bool m_sensedPosition; bool m_sensedRotation; bool m_actuatedPosition; bool m_actuatedRotation;
Jochen Lang

Chai3D Source File Organization

Scenegraph Nodes
cGenericObject
Parent of all scenegraph nodes

cCamera
Controls the position/orientation of the camera relative to the scene

cLight
Light source position and orientation

cMesh, cShapeSphere, etc. cMesh, cShapeSphere,


Objects in the scene

cGenericTool
Haptic tools

cWorld
Root of the scene
Jochen Lang Jochen Lang

Haptic Scenegraph Traversal

Example: 12-Polygon
Uses a triangle mesh Haptic finger proxy rendering algorithm of [Ruspini et al. 97] [Ruspini Collision detection with build in axis-aligned-bounding-box tree axis- aligned- bounding-

Copyright Chai3D

Jochen Lang

Jochen Lang

Credits, References
Material from:
Francois Conti, Chai3D source code Kenneth Salisbury, Federico Barbagli and Franois Fran Conti, CS 277 - Experimental Haptics, Lecture 4, Haptics, Open Source Framework CHAI 3D, Stanford 3D University

Jochen Lang

You might also like