Chai3D 3.2.0 Multiple Touch (Phantom) Haptics Devices

Typically: "How do I... ", "How can I... " questions
Post Reply
omnipOtent
Posts: 7
Joined: 11 Dec 2019, 22:12

Chai3D 3.2.0 Multiple Touch (Phantom) Haptics Devices

Post by omnipOtent »

Hello everyone,

OS: Windows 10 Pro 64-bit
V-REP: V-REP PRO EDU 3.6.2 64-bit
Haptics Devices: Two (2) 3D Systems Touch, USB version (previously known as Geomagic Phantom Omni)
Haptics Library: Chai3D 3.2.0, Windows version

I managed to have the two haptics devices recognized by Chai3D. One was named "Default Device" and the other named "Phantom2". In the Chai3D example "02-multi-devices" both devices are recognized and have force feedback.

I copied "hdPhantom64.dll" to "C:\Program Files\V-REP3\V-REP_PRO_EDU", then the two V-REP examples under "chai3d-3.2.0\modules\V-REP\examples" work. Although the second device has bright blue light (indicates as recognized), only the first device is doing the teleoperation. It is okay.

My goal is to use both two haptics devices to control a dual-arm robotic system in V-REP, so I tried to modify the Lua script associated with the "hapticDevice" in one of the examples, "01-V-REP-shapes.ttt".

Here is part of the original Lua script code:

Code: Select all

if (sim_call_type==sim.syscb_sensing) then
    if CHAI3DPluginInitialized then

        -- Read the position of the cursor:
        local p=simExtCHAI3D_readPosition(0)

        -- Reflect the position of the cursor in V-REP:
        sim.setObjectPosition(toolSphereHandle,modelHandle,p)

        -- Read the the interaction force:
        local f=simExtCHAI3D_readForce(0)

        -- Read the buttons of the device:
        local currentButtonStates=simExtCHAI3D_readButtons(0)
    end
end
I tried changing all 0s to 1s to see if the second haptics device could take the job, but failed (if I print(p), always (0, 0, 0)).
However, both devices have bright blue light coming from the inkwell.

May I get some instructions from you guys? Many thanks.

coppelia
Site Admin
Posts: 10558
Joined: 14 Dec 2012, 00:25

Re: Chai3D 3.2.0 Multiple Touch (Phantom) Haptics Devices

Post by coppelia »

Hello,

not sure what is going on... we unfortunately only have one haptic device for testing purposes...

Cheers

omnipOtent
Posts: 7
Joined: 11 Dec 2019, 22:12

Re: Chai3D 3.2.0 Multiple Touch (Phantom) Haptics Devices

Post by omnipOtent »

Thanks for the reply. I just figured it out, in the demo code it writes:

Code: Select all

simExtCHAI3D_start(0,toolRadius,workspaceRadius)
Obviously I should have added the following to initiate the other device:

Code: Select all

simExtCHAI3D_start(1,toolRadius,workspaceRadius)
After fixing this, the problem gets resolved.

More questions:
1. Is https://github.com/CoppeliaRobotics/sim ... CHAI3D.cpp it writes a bunch of statements like this:

Code: Select all

// definitions for LUA_START_COMMAND
#define LUA_START_COMMANDOLD "simExtCHAI3D_start"
#define LUA_START_COMMAND "simCHAI3D.start"
I wonder if the function "simExtCHAI3D_" is deprecated to "simCHAI3D." style? Which one would you suggest to use?
How about the compatibility of the "simExtCHAI3D_", "simCHAI3D." with the newest CoppeliaSim EDU 4.0.0 (rev4) on Windows 10? According to this professor's slide (page 29) posted on 04/06/2020: http://www.diag.uniroma1.it/deluca/lhi_ ... cTouch.pdf
The compatibility between Chai3D and the recent V-REP versions (>3.3.2) seems compromised. I wonder what your opinion is.

2. Is it okay to have both V-REP 3.6.2 and CoppeliaSim 4.0.0 (rev4) on my Windows 10 laptop? Any potential issue(s) do you foresee?

3. It is possible to extract the orientation of the haptics device's tip? It seems only "simCHAI3D.readButtons()", "simCHAI3D.readForce()" and "simCHAI3D.readPosition()" are available. I understand that the last three DOFs of my Touch haptics device are "passive", it that the reason no "simCHAI3D.readOrientation()" is available?

4. What might be the best way to map the master device's workspace to the slave device's workspace? In my case, I'd like to control two 6-DOF UR5 arms.

Post Reply