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

Example of setViewPose function

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?
Hi mberghauser, 

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

You can do that using:


Just print it somewhere to see the content. 

Here's a little piece of code I used to rotate around my station:

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

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

Hope it helps. 
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)