Hi, i try to move a video camera fixed on the flange of my kr15 krc ed05. The problem is that when i make one pan movement by jog or running one src, the camera roll in unwanted mode. if i’m in world coordinate this dosen’t appens but if i want tilt it this appens again. So i need to back in tool mode(jog mode).
So the problem at the end is that every time i need to switch from world to tool coodinate and viceversa to move the camera in right pan and right tilt way. There is any way to fix this problem without hard matrix calculation??
I connected 2 joystick on external computer and i send the variable buy kukavarproxy in this way i like move camera in x y z and rool pith and yall without have the problem of a kind of gimballlock
Camera pan tilt roll

Mizio31 
April 21, 2018 at 8:13 PM 
Thread is marked as Resolved.


i would use quaternions

How?? Can you explain a bit to start

[size=2]one of the issues with trig functions is that their inverse are not continuous.
another issue is that computers have to deal with limitations such as finite number of bits used to represent numeric values. only integers can be represented accurately. with real numbers, there is always rounding involved (except for countable set of values).
it is quite common in mathematics that complexity of problem representation decreases ... if one increases number of dimensions.
this is why in problems involving electrical circuits one often uses complex numbers. they have two dimensions: real and imaginary.Imaginary dimension values are grouped around unit "i" using format [/size]X=a+bi
For example, if we have value
Z=3 + 4i3 is real part of the Z (first dimension)
4 is imaginary part of the Z (second dimension)real and imaginary dimensions are orthogonal to each other, so magnitude of the X is described as X=sqrt(a^2+b^2) etc.
value "i" is defined as square root of negative one (i^2=i*i=1)similarly when working in 3D space, problems become more manageable if instead of conventional 3 dimensions (X,Y,Z) one switches to 4 dimensions.
hence name "Quaternion" (because 'quatro' = 4). This means a number can be represented in form
Y= a + bi + cj + dk (four terms, where i,j,k are imaginary numbers associated with different dimensions).in this world, i^2=j^2=k^2=1
one of the challenges is visualizing multiple dimensions...
https://en.wikipedia.org/wiki/Quaternionbut there are a lot of good resources on this, including yotube.good luck

Thanks......onestly is too hard for me. Ther is one more easy way ? Peraps use geometry operator or inverse_pos or any other simple magic comand???

I don't know what panic mode wanted to tell You, but:
You already noticed that moving in tool coordinates fixes the problem, and this is the only way to move your camera as wanted.
You have to distinguish the two conditions: moving in jog mode: easiest way is to switch to tool coordinates. Otherwise you must know the actual coordinates of the robot to do the transfomations on the computer with the joysticks.
 moving in a running src. Use the ':' operator. and move to $pos_act :{x 0, y 0, z 0, a valuez, b valuey, c valuex} where the value... is given from the computer. 
Honestly, it sounds more to me as if the active Tool data is not set up to the camera properly.

One problem is that everytime a use pos_act and or geometric operator., the motion dtop. This is bad because i want a smooth movement.
Anyway i use joystick and so src.
I’ll make a test . Do you think its just do this “:” with pos _act?? 
To skyfire. Could be the camera not pretty setted but the goal will be like move a glas of water without loss the inclination of the water when move. At same if i tilt it by 15 degrres the water must be at 15 degreas also if i i make a pan

try $PAL_MODE

$pal_mode it’s always parallel to the ground. Or there is any variable to tilt it???

One problem is that everytime a use pos_act and or geometric operator., the motion dtop. This is bad because i want a smooth movement.
Anyway i use joystick and so src.
I’ll make a test . Do you think its just do this “:” with pos _act??
That was only the quickest way to show the principal solution. In a .src you can store the calculated position in a variable and use this for calculating the next position. So it is only at the initial movement necessary to use $pos_act. This are things that could be known by someone who uses joysticks and pc programs to move a robot.
I have done this many years ago with a 6d mouse and it works like a charm. 
To skyfire. Could be the camera not pretty setted but the goal will be like move a glas of water without loss the inclination of the water when move. At same if i tilt it by 15 degrres the water must be at 15 degreas also if i i make a panThis... I cannot decipher what you are describing.
1. What are you rotating around? A fixed point in space, or a TCP related to the camera?
2. Define "tilt the camera". Tilt relative to what? Using what coordinate frame?
3. Is this "tilt" carried out relative to a fixed spatial axis, or to the camera frame?
4. What are your Tool and Base definitions? 
Sorry to be away for a while. Perhaps I found the way to describe my problem. I want move to a point with Lin_rel were the value is the joystick value. The problem is that I want move with angle A relative to base and C relative to the tool. In this way the move my will be perfect for my camera. I want move to the point with just one comand otherwise the video recorded by the camera move like a step when I try to make one oblique movement

You still didn't answer my questions.
Without seeing your complete setup, I can only guess at how to make this work. Something like this should rotate a point around Base A and Tool C:
Code
Display MoreDECL FRAME _fBaseRot, _fToolRot, _fNextPos, _fTempFrame SIGNAL I_rBaseRot $IN[1] TO $IN[16] SIGNAL I_rToolRot $IN[17] TO $IN[32] PTP StartPosition ; move to start point of motion _fBaseRot = $NULLFRAME ; set to 0s _fToolRot = $NULLFRAME ; set to 0s _fBaseRot.A = I_rBaseRot _fToolRot.C = I_rToolRot _fTempFrame = $POS_ACT_MES ; store current position _fNextPos = $POS_ACT_MES ; rotate position around Base A ; first, remove XYZ values to avoid translational side effects _fTempFrame.X = 0 _fTempFrame.Y = 0 _fTempFrame.Z = 0 ;Now, rotate the orientation of the position around Base A _fTempFrame = _fBaseRot : _fTempFrame ;Now, combine the new orientation with the old XYZ position _fNextPos.A = _fTempFrame.A _fNextPos.B = _fTempFrame.B _fNextPos.C = _fTempFrame.C ; rotate position around Tool C _fNextPos = _fNextPos : _fToolRot PTP _fNextPos
The part that makes the Base rotation difficult is that you want to rotate a point around the Base axis (or, more precisely, around an axis parallel to the Base axis, but with its origin at the point. If you just apply a Base rotation, like Point = RotationFrame : Point, the effect is the same as if you had rotated the Base around its own origin, which would rotate and translate every point around the Base's origin. So you have to remove the location, generate your new orientation, then feed the location back in.
Now, if you can do some setup work, there's an easier way to do this: I assume you are trying to do a arcpan, centered on the object of interest? If you know the location of the object, relative to the robot's $WORLD frame, you can create a Base frame whose origins are located at the object. The program your camera position in that Base frame.
After that, generating your BaseA rotation panning shot is as simple as rotating the Base:Code$BASE = StartBase ; unrotated Base, centered at the object PTP CameraPosition ; camera start position, pointed at the object $BASE = $BASE : {0,0,0,30,0,0} ; rotate Base around it's own A axis by 30 deg PTP CameraPosition ; position will be 30deg around an arc centered on the object, still pointing at the object [/b]