![]() |
#1
|
|||
|
|||
about Kinect coordinate transformation
Code:
import viz import vizshape viz.go() grid = vizshape.addGrid() """ Kinect Tracker object ID's These are not actually being using in the script but are to help anyone who wants to get access to a specific bodypart. For example to just get a handle to tracking data for the head use: myHead = vrpn.addTracker( 'Tracker0@localhost', HEAD). """ HEAD = 0 NECK = 1 TORSO = 2 WAIST = 3 LEFTCOLLOR = 4 LEFTSHOULDER = 5 LEFTELBOW = 6 LEFTWRIST = 7 LEFTHAND = 8 LEFTFINGERTIP = 9 RIGHTCOLLAR = 10 RIGHTSHOULDER = 11 RIGHTELBOW = 12 RIGHTWRIST = 13 RIGHTHAND = 14 RIGHTFINGERTIP = 15 LEFTHIP = 16 LEFTKNEE = 17 LEFTANGLE = 18 LEFTFOOT = 19 RIGHTHIP = 20 RIGHTKNEE = 21 RIGHTANKLE = 22 RIGHTFOOT = 23 #store trackers, links, and vizshape objects trackers = [] links = [] shapes = [] #start vrpn vrpn = viz.addExtension('vrpn7.dle') #now add all trackers and link a shape to it for i in range(0, 24): t = vrpn.addTracker( 'Tracker0@localhost',i ) s = vizshape.addSphere(radius=.1) l = viz.link(t,s) trackers.append(t) links.append(l) shapes.append(s) Is there a way to convert the tracking white dots always shown in front of the mainview (maybe 1 or 2 meter distance from the mainview), when the mainview changed, the white dot will also follow the mainview to change to another position. It should be something regarding coordinate transformation. Thanks, |
#2
|
|||
|
|||
also when the euler of the mainview changed, the white dot should also be changed.
looking for help, thanks, |
#3
|
|||
|
|||
Try the following:
Code:
#now add all trackers and link a shape to it for i in range(0, 24): t = vrpn.addTracker( 'Tracker0@localhost',i ) s = vizshape.addSphere(radius=.1) l = viz.link(t,s) #keep the sphere in the reference frame of the view l.postMultLinkable(viz.MainView) #uncomment the following line to move the sphere forward #l.preTrans([0,0,3]) trackers.append(t) links.append(l) shapes.append(s) |
#4
|
|||
|
|||
Quote:
|
#5
|
|||
|
|||
based on my own understanding, the question is how to shift the coordinate of Kinect sensor. The kinect sensor captures movement of skeletal joints. and when the mainview moved, the tracking coordinate still stay in the global coordinate of Vizard software itself.
is there a way to change the origin of Kinect sensor instantly for example (1 or 2 meters in front of the mainview position). when the mainview moved, it will move along with mainview, in that way, the tracking skeletal joints can be shown in front of the mainview all the time. Thanks, |
#6
|
|||
|
|||
Does the following work?
Code:
for i in range(0, 24): t = vrpn.addTracker( 'Tracker0@localhost',i ) s = vizshape.addSphere(radius=.1) s.setReferenceFrame(viz.RF_VIEW) l = viz.link(t,s) #change z value to move sphere closer/farther from view l.postTrans([0,0,2]) trackers.append(t) links.append(l) shapes.append(s) |
#7
|
|||
|
|||
Quote:
When I apply "pos_s = s.getPosition() print pos_s" to the code, it seems the position is still their local position, is there a method using coordinate transformation to achieve keeping skeletal appearing in front of the mainview. waiting for the reply |
#8
|
|||
|
|||
I made a simple code to explain my problem
Code:
import viz import vizshape viz.go() grid = vizshape.addGrid() viz.MainView.setPosition(0,1,-5) #now the sphere should be around 7 meters away from the main s = vizshape.addSphere(radius=0.1) s.setPosition([0,0,2]) I want to achieve that when the position of mainview moved, the sphere can move to the relative position (which is around 7 meters in front of the mainview) (defining a function to achieve it). And I also need to know the current global position of the sphere. Hopefully, you can understand what I want to achieve. I think it is regarding coordinate transformation. |
#9
|
|||
|
|||
any idea Jeff?
|
#10
|
|||
|
|||
Does everything look correct with the last code I posted? If so and you need the global transform of the sphere you could try calculating it based on the view transform and the sphere's relative offset.
What are you using to control the movement of the view? When the skeleton moves is it relative to the view or does the view follow? There maybe another way of setting this up through vizconnect. |
#11
|
|||
|
|||
Quote:
Do you know how to calculate the global position of the skeletal joints? Thanks, |
#12
|
|||
|
|||
Quote:
|
#13
|
|||
|
|||
You could try setting this up through vizconnect. The attached script shows a simple desktop example. The keyboard tracker is a substitute for a kinect tracker. Both the beachball, which is parented to the keytracker, and the view node follow the transport. The beachball's position is printed out in global coordinates.
|
#14
|
|||
|
|||
Quote:
I will try to figure it out. |
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Local coordinate and global coordinate | haohaoxuexi1 | Vizard | 2 | 07-24-2016 07:21 PM |
Problems with using WIRKS without the Kinect in a mirror setting | Jennifer | Vizard | 0 | 06-03-2013 03:17 PM |
Kinect auto selection of skeleton | victorqx | Vizard | 0 | 05-29-2012 08:30 AM |
Mouse 2D coordinate to viz world 3D coordinate | james007 | Vizard | 1 | 10-08-2009 12:11 PM |
creating multiple coordinate systems and making them visible | jalvarez | Vizard | 1 | 02-27-2009 12:36 PM |