PDA

View Full Version : Vizconnect


KoRnemuse
04-29-2014, 01:30 AM
Hello guys!

I was so happy to see that the Beta3 was out today that I'm trying to use vizconnect right now.

But unfortunately the new tool isn't working for me.

It's not even launching and I've got an error at the start:

************************************************** ****************************
** Loading vizconnect_interface.py
************************************************** ****************************
**Warning: Socket already in use, interface not started.
Loading File: piazza.osgb
Loading File: piazza_animations.osgb
** Load Time: 0.43 seconds


I don't know exactly why is there a server problem on this.
I tried with internet on and off and the result is the same.

Am I doing something wrong?

Cheers
KoRnemuse

Chris Coffin
04-29-2014, 09:33 AM
Currently, you can only have one running copy of the vizconnect interface at a time.

Vizconnect uses websockets to communicate between the configuration interface and the vizard application. This error is generated when something is bound to the port vizconnect is trying to use. Can you check if you have a running Vizard process in the background. You may need to check task manager to verify.

If you don't have another Vizard process running, it may mean that another application is using that port.

You can also copy the following code into a script and run it to verify that the port is being used, without needing to run vizconnect directly. If you change the value of the port to another random number e.g. 9523, does the error still appear?



import socket

# check to see if the web server has already been started by a previous version
s = socket.socket()
address = 'localhost'
port = 8080 # port number is a number, not string
activeSocket = True
try:
s.connect((address, port))
except Exception, e:
# good since we didn't connect, we can probably open socket
activeSocket = False

if activeSocket:
viz.logWarn('**Warning: Socket in use')

KoRnemuse
04-29-2014, 11:19 PM
I checked my task manager and I only have one Vizard running.

So I tried your code and, as you said, the 8080 port is used and if I change it to 9253, as you suggest, the error disappear.

Do I have to change some vizard code to correct that?

Thanks for your answer Chris

KoRnemuse

Chris Coffin
04-30-2014, 10:17 AM
Unfortunately, at this time, there's no method for redirecting vizconnect to another port. I'll work to add a search option for available ports into a future release. Without that, the configuration utility is currently unavailable, unless the other process which is holding that port can be redirected.

I noticed that you've also posted regarding inverse kinematics. Even without using the interface you can still access the inverse kinematics modules, if you'd like to use that code directly.

Here's a sample.



import viz
import vizconnect

# need to get the raw tracker dict for animating the avatars
from vizconnect.util.avatar import animator
from vizconnect.util.avatar import skeleton

# press key 1 to control head, key 2 to control hand
# keys w,a,s,d,z,x control position, keys t,f,g,h,v,b control orientation
from vizconnect.util import virtual_trackers
YOUR_HEAD_TRACKER = virtual_trackers.Keyboard()
YOUR_HEAD_TRACKER.setPosition(0, 1.5, 0)
YOUR_RIGHT_HAND_TRACKER = virtual_trackers.Keyboard()

avatar = viz.add('vcc_female.cfg')
# get the skeleton from the avatar
mySkeleton = skeleton.CompleteCharacters(avatar)

#VC: set which trackers animate which body part
# format is: bone: (tracker, parent, degrees of freedom used)
# The hand is set to move with the head.
# Set the parent (2nd param) to None to disable parenting.
_trackerAssignmentDict = {
vizconnect.AVATAR_HEAD:(YOUR_HEAD_TRACKER, None, vizconnect.DOF_6DOF),
vizconnect.AVATAR_R_HAND:(YOUR_RIGHT_HAND_TRACKER, vizconnect.AVATAR_HEAD, vizconnect.DOF_POS),
}

#VC: create the raw object
myAnimator = animator.InverseKinematics(avatar, mySkeleton, _trackerAssignmentDict)

viz.go()

viz.add('piazza.osgb')


Cheers,
Chris

Erikvdb
05-09-2014, 08:28 AM
Unrelated to sockets, but I'll dump it here anyway:
I can't seem to get the Vizconnect interface working on Firefox. It opens the start, but whenever I click any of the options it shows the loading icon for a bit and then just jumps back to the start again. In IE it works fine.
Am I just missing some plugin, or..?

Chris Coffin
05-16-2014, 08:57 AM
Thanks for your feedback! There is an issue with how firefox handles the timing for page redirections. This will be fixed in the next release.

Cheers,
Chris