generate.trajectory: Generate index and thumb trajectories accordind to Brenner...

Description Usage Arguments Note Examples

View source: R/generate.trajectory.r

Description

Generate index and thumb trajectories accordind to Brenner and Smeets' model (1998)

Usage

1
generate.trajectory(start, end, phi, ap, MT, r, index.only = F)

Arguments

start

a vector consisting of the x, y and z coordinates of the start position

end

a vector consisting of the x, y and z coordinates of the end position (target's geometrical center)

phi

final grip orientation (in radians). Must be 0 <= phi <= 3/4*pi. In case the final end z coordinate is negative, phi is automatically changed in sign too (otherwise positive pi/2 would result in the index reaching closer than the thumb)

ap

approaching parameter, as in Brenner & Smeets (1998)

MT

movement time (in millisec)

r

radius of the target object

index.only

logical: should the index trajectory be computed alone? (TRUE for pointing/reaching simulation; FALSE for grasping simulation; default to FALSE)

Note

If phi = pi/2 it becomes pi/2+0.00001 to avoid an unknown bug in kin.SmoothAndDerive(). Since Brenner and Smeets' model assumes unconstrained path for each digit, when phi is > pi*.64 (pi*16/25) the index takes an internal trajectory with respect to the thumb.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
libraries()
dig <- generate.trajectory(start=c(200,-300,0), end=c(0,0,400), phi=pi/4, ap=1000, MT=1500, r=40)
ggplot() + geom_point(aes(indexXraw, indexZraw), data=dig, color='red') +
   geom_point(aes(thumbXraw, thumbZraw), data=dig, color='blue') + coord_fixed()
plot3d(dig[,c(1,3,2)], col='red', radius=4, type='s')
spheres3d(dig[,c(4,6,5)], col="blue", radius=4)

# can be used with the other function of the kinesis package too:
libraries()
dig <- generate.trajectory(start=c(200,-300,0), end=c(0,0,-400), phi=pi/4, ap=1000, MT=1500/11, r=40)
# note the negative sign of the final z coord since kin.SmoothAndDerive will multiply z coord by -1
# also note that MT was scaled by the refresh time (11ms in this case) to simulate optotrak sampling
dig$trialN <- 1
dig <- data.check(dig) # follows a bogus subjName (testName) as input to data.check - testName is not a function
testName
dig <- kin.SmoothAndDerive(dig)
head(dig)
kinDig <- kin.extract(dig)
view.single.trial(1, dig)
view.single.trial.GA(1, dig, kinDig)
view.single.trial.grasp3d.anim(1, dig, kinDig, type='s')

ccamp83/kinesis documentation built on Oct. 10, 2019, 4:53 a.m.