Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Example of setViewPose function

#1
Does anyone have an example of how to use the setViewPose function correctly?
My use case is to have the 3D view follow the target pose of the robot to provide a close up detail view of the tool point in relation to the work piece.
I tried to use the target pose of the robot with this function but it did not seem to correctly set the view.
Am I missing something in how this function should be used or is there another method available?
#2
Hi mberghauser, 

A good starting point would be to retrieve the current view position. 

You can do that using:

Code:
RDK.ViewPose()


Just print it somewhere to see the content. 

Here's a little piece of code I used to rotate around my station:
Code:
print(RDK.ViewPose())

#Start rotation around cell
viewpose = Pose(-434.322, -789.445, -7644.030,  -75.081, 0, -97.741)
RDK.setViewPose(viewpose)

#Rotation around cell
for i in range(2000):
   viewpose = viewpose * rotz(-0.095 * pi / 180)
   RDK.setViewPose(viewpose)

Hope it helps. 
Jeremy
Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our Youtube Channel


  




Users browsing this thread:
1 Guest(s)