Home› Programming
Discussion
Back to discussions page
agiakos
Posts: 15 Apprentice
Define variable point position while the even occurs |
141 views
|
Answered | |
/ Most recent by matthewd92
in Programming
|
7 comments |

Hello community,
I am trying to calibrate a sensor, the first step is to find the pin hole(there is a screw attached to the sensor). The second step is start rotating the wrist 3 and stop it when I am receiving a signal(notify me that I am at the far right or left point) and the 3rd step to make the Wrist 3 rotate at the other direction 270 degrees(distance between far left and far right) and receive kind of similar message.
The 1st step I did it using the linear search and rotational search. The 2nd step I was able to introduce an event that pop ups a message and pause the program. My problem is with the 3rd step,because the Wrist 3 position is different every time(detects the screw head at different degrees) I would like to have a variable waypoint and that waypoint should be the robot position when the event occurs. I will try to use something like WaypointEvent=get_target_joint_positions(), but I would like your suggestions.
I hope I was clear enough
I am trying to calibrate a sensor, the first step is to find the pin hole(there is a screw attached to the sensor). The second step is start rotating the wrist 3 and stop it when I am receiving a signal(notify me that I am at the far right or left point) and the 3rd step to make the Wrist 3 rotate at the other direction 270 degrees(distance between far left and far right) and receive kind of similar message.
The 1st step I did it using the linear search and rotational search. The 2nd step I was able to introduce an event that pop ups a message and pause the program. My problem is with the 3rd step,because the Wrist 3 position is different every time(detects the screw head at different degrees) I would like to have a variable waypoint and that waypoint should be the robot position when the event occurs. I will try to use something like WaypointEvent=get_target_joint_positions(), but I would like your suggestions.
I hope I was clear enough
Tagged:
Best Answer
-
matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,267 Handy
@agiakos tonget the motion to stop properly when the signal is reached place the waypoint inside an if statement, on the setup screen use the signal is low as the condition and check the box for monitoring continuously. This will cause the motion to exit as soon as the signal is reached. You may want to place a stopj(8) command right after the if statement just to make sure motion stops correctly.
Then you can use a pose_trans() function to calculate waypoint 3. You will use the pose Tool from the pose drop down list in the formula editor.
waypoint3=pose_trans(Tool,p[0,0,0,0,0,-d2r(270)])
this assumes that you you want to rotate around the Z axis of the tool. If you need a different axis place the rotation in the correct axis as well as use the correct sign to change the rotation direction. The d2r() function allows the system to convert degrees to radians as the function needs the new angle in radians and any linear move in meters if there were a linear component.
What this function will will do is take where you currently are situated and calculate a new waypoint based on the changes desired to the existing point.
I don't know how to define the waypoint_3 and I am getting an error can you guide me?Inside the if statement I would like to start the rotation of Wrist 3
The easiest away around this is instead of using a script line is to use the assignment line. Click assignment, rename your variable to waypoint_3 and then place your formula in the assignment screen. It will use the correct equal sign automatically. I would place that line just before your if statement and then place a waypoint inside the if. On the waypoint you can choose variable as the type of waypoint and then select the variable you want to use.
Do you might know how to get the motion to stop properly when the signal is reached but with a register value?