07-30-2020, 11:49 AM
(This post was last modified: 07-30-2020, 12:41 PM by David Akiba90.)
Hi everyone , i'm trying to get the actual pose of my robot according to a frame selected by the user.
I need this , because i'm comparing the actual pose with a target which has been defined according to an user frame.
My problem is , when i got the actual pose of my robot , it's got it according to the robot base .
(Ps : everything is made as online programming )
1: The user pick a frame , and i use SetPoseFrame() for changing the reference frame ( doesn't seem to work)
2: I ask for the joint and i solve the forward kinematic , then i have the actual pose of my robot and i find the xyz coordinate
3: i get the pose of the target selected by the user
when i compare by example the both x coordinate , for the target x cordinate i got it according to the frame choosen by the user concerning the actual x position it's according to the robot base.
I would like to know if there is an elegant way to get the robot position according to an user frame ?
I finally figured it ou , i used this instead :
I need this , because i'm comparing the actual pose with a target which has been defined according to an user frame.
My problem is , when i got the actual pose of my robot , it's got it according to the robot base .
(Ps : everything is made as online programming )
1: The user pick a frame , and i use SetPoseFrame() for changing the reference frame ( doesn't seem to work)
Code:
# user picck a frame
FRAME = RDK.ItemUserPick('Select a reference frame', ITEM_TYPE_FRAME)
ROBOT.setPoseFrame(FRAME)
2: I ask for the joint and i solve the forward kinematic , then i have the actual pose of my robot and i find the xyz coordinate
Code:
##----------------robot position --------------##
robot_joints = ROBOT.Joints()
robot_position = ROBOT.SolveFK(robot_joints)
xyzRxyz=Pose_2_TxyzRxyz(robot_position)
Code:
##--------------------collision target-----------##
targetCollide =RDK.ItemUserPick('Select a collide target', ITEM_TYPE_TARGET)
poseCollide= targetCollide.Pose()
xyzRxyzCollide=Pose_2_TxyzRxyz(poseCollide)
when i compare by example the both x coordinate , for the target x cordinate i got it according to the frame choosen by the user concerning the actual x position it's according to the robot base.
I would like to know if there is an elegant way to get the robot position according to an user frame ?
I finally figured it ou , i used this instead :
Code:
# user picck a frame
FRAME = RDK.ItemUserPick('Select a reference frame', ITEM_TYPE_FRAME)
ROBOT.setPoseFrame(FRAME)
Code:
robot_joints = ROBOT.Joints()
ROBOT.setJoints(robot_joints)
#robot_position = ROBOT.SolveFK(robot_joints)
#xyzRxyz=Pose_2_TxyzRxyz(robot_position)
robot_position=ROBOT.Pose()
xyzRxyz=Pose_2_TxyzRxyz(robot_position)