Home
Appendices - helix - Georgia Institute of Technology
Contents
1. reat G Jos oo As a Me a f i L 4 F EE ECOLE NATIONALE D INGENIEURS DE METZ Olivier Marchal Nicolas Ponsart March June 2001 Supervised by Dr Harvey Lipkin Associate Professor at Georgia Institute of Technology Thierry Nowak Electrical Engineering Professor at Ecole Nationale d Ingenieurs de Metz Final Year Project 2001 LIAR ia Appendices Contents l Appendix 1 Hardware configuration of our system sessessesee P 3 Appendix 2 Visual Basic Program cccceeee cece ee eeee eens P 4 Appendix 3 Introduction to TCP IP c cee cece eee ee ne eee ee ees P 25 Appendix 4 Excel Platform 2 c0sscsissiestevsssvevensenneanserecueciessen P 26 Appendix 5 Quasi Newton Method 0c cceecce cence eee e eee es P27 Appendix 6 Matlab M Files 00sec cece ce ene eee e ences ene enee eens P 28 Appendix 7 User Manual 0 0 60 sescesesenascaeedsseveedewseseeueneswnesn P 39 Olivier Marchal Nicolas Ponsart 2 Real Time Visual Servoing Appendices ECOLE NATIONALE D INGENIEURS DE METZ Appendix 1 Hardware configuration of our system Here is the structure with our target and our robot Here is our camera which is mounted on the same structure Supply FEFAP comeclhaon Camera The distance between the robot and the camera is of 1200 mm Olivier Marchal Nicolas Ponsart 3 Real Time V
2. Controller Static View RMS Error Ready FixedStepDiscrete You may stop the application anytime by clicking on Stop or by closing windows Olivier Marchal Nicolas Ponsart 40 Real Time Visual Servoing Appendices LIVAR ECOLE NATIONALE D INGENIEURS DE METZ This report has been written with MS Word 2000 Achieved and printed on June the 15 2001 Olivier Marchal Nicolas Ponsart Real Time Visual Servoing Appendices 41
3. RetCode Exit Sub End If Display robot info in labels on the main form IbRobotInfo Caption Robot built IbRobotName Caption Name amp RobotName IbRobotServos Caption Servos amp ServoCount IbRobotAuxOuts Caption AuxOutputs amp AuxOutputCount TKKK 24g K 3K K 3K 3K 3K 3K K 3K K 3K K K 2k K 2 ok Restart robot TK 3K of 3K oft 3K 3K K ok 3K of 2K 2K K ok K of ok K K ok We have now built a logical robot of some servo and aux outputs by loading the config file but a logical robot could also be built piece by piece using command such as rbxEiEnable roxRobotCreate rbxRobotServoAssign and rbxRobotAuxOutputAssign In any case after a logical robot is built the physical Ei s that it uses must be initialized Failure to restart the robot before use may cause its servos to behave erratically When a robot is restarted it will quickly come to attention by sending each servo to its initial position initpos Restart robot Note return code RetCode rbxRobotRestart RobotHandle Check return code Olivier Marchal Nicolas Ponsart 14 Real Time Visual Servoing Appendices If RetCode lt gt RBX _E SUCCESS Then DisplayRobixError Error restarting robot RetCode Exit Sub End If l End Sub tkkkkkk kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk k This error reporting function accepts a variable number of items
4. Nicolas Ponsart 26 Real Time Visual Servoing Appendices LIVAR Geor gia Appendix 5 QUASI NEWTON METHOD Here is the quasi Newton algorithm Its explanation is well described in Jenelle Piepmeier thesis Please refer to it for further indications Algorithm Dynamic Quasi Newton Method with RLS estimation Given f R R bo 01 R Jo E R Po R A 0 1 Do for k 1 2 Af fx fr 1 ho Ok Ok 1 hehar Ota A Ve A A Hn hE Pes Py 5 Pe A hf Pehe PrahhhoPe1 Okai On i St h agtn End for With k denotes Kth iteration forgetting factor da joint angle f the residual error in the sensor space Jk the Jacobian at iteration k Olivier Marchal Nicolas Ponsart 27 Real Time Visual Servoing Appendices LA Geor gia l Appendix 6 MATLAB M FILES Following are some interesting M Files linked to our main Simulink application Y Y0 Yoo YoYo Yo Yo Yo Yo Yo Yo YoYo Yoo YoYo Yo Yo Yo Yo Yo o Ao o A bA hh Ahh AdeptFKProc m This function uses the foward kinematics of the adept robot to determine the position of the end effector in XYZ coordinates from the joint angles of the robot Z coordinates will be ignored INPUT joint angles of adept OUTPUT xy coordinates of end effector 0 Y0 Yo 0o Yo Yo YoYo Yo Yo YoYo o Yo Yo Yo Yoo Yo Yo Yoo Yo Yo Vo Ao Yo o A hA Ah AoA
5. E Emulator Add Delete Edit oe J oo o Olivier Marchal Nicolas Ponsart 39 Real Time Visual Servoing Appendices ECOLE NATIONALE D INGENIEURS DE METZ 7 Now select the Robot Control product on the Framework menu and click Start Minimize the window 8 Launch Visual Servoing exe by clicking on the icon eaj l 9 Click Initialization For test purpose you may want to click Test the Robot and verify the robot moved its both joints Once the test is done don t forget to click Restart the Robot 10 When you are ready to launch the application click on the Start button is Robot Control Window ioj x Initialization Ei not enabled fa UUS Robot not built i NA Name aa Servos s ae AuxOutputs To run this application First click on Initialization then click on the Start icon Finally launch the Simulink application so Start Stop pera can calculate the joint For test purpose Exit Test the robot Restart the robot 11 Launch Matlab by clicking its icon pr Open the Simulink file called Algorithm MATLAB R12 12 Click Initialize and then Start The application is now running JAlgorithminProgress File Edit View Simulation Format Tools Help Die te 22 eet S gt Model Browser Bah x AlgorithmlnProgress 2 Camera Plots 2 Controller2 2 Determine Error2 ims_error 2 Velocity Prediction
6. K K FK K K K K 2K K FK K 3K K K 2K K 3K K 3K K K K K 2s K 3K K 3K 2 ok 3K 2k Sends the move command to the robot PKK KK 3K K 3K K 3K 3K K 3K K 3K K 3K 3K K 2K K 3K K 3K K K 2K K 3K K 3K K K 2K K 3K K 3K K K K K 3K K 3K K K 2K K FK K 3K K K K K 3K K 3K K K 2K K 3K K 3K K 3K 2K K 3K K Write the script to be executed Script Move to strMoveJ1 2 to strMoveJ2 Execute the script RetCode rbxScriptExecute RobotHandle Script waits for the robot to be done with the string execution Do Allow other applications to process their events DoEvents Loop Until rbxRobotAction Wait realizes a pause so the camera has time to update the coordinates Dim pausetime Start Make a pause to be sure Framework has time enough to update coordinates pausetime 0 2 Start Timer Do While Timer lt Start pausetime Allow other applications to process their events DoEvents Loop Tell Matlab to make a new calculation NextCalculation 1 XLApp Cells 18 7 NextCalculation Else Allow other applications to process their events DoEvents End If End If End If End Sub Olivier Marchal Nicolas Ponsart 24 Real Time Visual Servoing Appendices CANTINA leoga ECOLE NATIONALE D INGENIEURS DE METZ Appendix 3 Introduction to TCP IP TCP and IP were developed by a Department of Defense DOD research project to connect a number different networks designed by different vendo
7. joint values at time increment k global JointsK1 joint values at time increment k 1 global MaxJointRates maximum joint velocity global dJoints desired joint changes global dfdt calculated velocity of target global fk error values at time increment k global fk1 error values at time increment k 1 dJoints 0 0 dfdt 0 0 fk 0 0 Joints 3 4 and 5 are hardwired for now only a 3 DOF problem IMPORTANT if you change these reinitialize manually global J3 global J4 global J5 J3 0 J4 0 J5 0 RLS Controller global lambda memory or forgetting factor for Jacobian update lambda 1 AR_JOINTCOUNT 2 Joint Initialization IMPORTANT If you change this value you must double click on initialize because this file is normally called by CameraModel which is after MATLAB initilizes the blocks AR_JOINTSTART 100 100 AR_JOINTSTART 0 0 MaxJointRates 7 7 MaxJointRates 70 70 MaxJointRates 500 500 global JK the Jacobian at time increment k global PK the P matrix at time increment K used in finding new Jacobian Olivier Marchal Nicolas Ponsart 33 Real Time Visual Servoing Appendices LIV ialnstitute JK eye AR_JOINTCOUNT PK eye AR_JOINTCOUNT initialization of P matrix Initialize Joints JointsK AR_JOINTSTART set joints to initial values JointsK1 JointsK give the k 1 time increment joint values also Initialize MaxJoint values global MaxJo
8. 0 sin inTheta cos inTheta 0 0 0 0 1 function T Ry inTheta inTheta inTheta pi 180 T cos inTheta 0 sin inTheta 0 0 1 0 0 sin inTheta 0 cos inTheta 0 0 0 0 1 function T Rz inTheta inTheta inTheta pi 180 T cos inTheta sin inTheta 0 0 sin inTheta cos inTheta O O 0 0 1 0 0 0 0 1 Olivier Marchal Nicolas Ponsart 29 Real Time Visual Servoing Appendices LA jea pat PWV VV Yo o Yo o Yo o Yo o Yo Yo Yo Yo Yo o Yo Yo Yo Yo Yo Yo Yo Yo Yo Yo Vo oVo oVo o Vo oVo o Vo AnglesOutput m This function sends new joint angles onto the Excel Spreadsheet PWV o Yo o Yo o Yo o Yo o Yo Yo Yo Yo Yo Yo Yo o Yo o Yo Yo Yo Yo Yo Yo Yo Yo Yo Y0 Yo Yo o V0 Ao o Vo function A B sys 1 1 initiate a conversation with Excel from spreadsheet Global_ Spreadsheet xls channel ddeinit excel Global_ Spreadsheet xls A sys 1 B sys 2 Set ranges of cells in Excel for poking range r20c2 range2 r20c3 enter the datas we want to export a A b B send a matrix to Excel rc ddepoke channel range1 a rc ddepoke channel range2 b terminate the communication with Excel rc ddeterm channel Olivier Marchal Nicolas Ponsart 30 Real Time Visual Servoing Appendices LIVAR Geor gia o o o Yo o Yo o Yo o Yo o Vo o Yo o Yo Yo Yo o Yo Yo Yo Yo Yo Yo Yo Yo Yo Yo Vo oVo oVo
9. Servoing Appendices LIVAR Georgia Create message ErrMsg Unknown error reading Adc amp AdcID amp ErrMsg ErrMsg Adc mod not updated within maximum timeout period Display message in a message box with buttons Retry and Cancel RetryCancel MsgBox ErrMsg vbRetryCancel Robix Error If Retry was clicked reset InitialTime If Cancel was clicked exit this function If RetryCancel vbRetry Then InitialTime Time Else AdcParkAndRead 1 Exit Function End If End If PK K 3K 3K 3K K 3K K 3k 3K 3k 3K 3K 3K K 3K K 3K 24s K 2s K 2k K K K Read current mod PKK KKK K K K K K K K K K K K K K of ok K of K K K K Now we read current mod Note return code RetCode rbxAdcModGet EiHand AdcID CurrMod Check return code If RetCode lt gt RBX_E SUCCESS Then DisplayRobixError Error reading mod for Adc amp AdcID amp RetCode AdcParkAndRead 1 Exit Function End If Allow other applications to process their events DoEvents Loop While CurrMod FirstMod We get here when the current mod is different from the first mod This indicates that the Adc s value has been refreshed Read fresh Adc value If this function returns RBX E SUCCESS AdcValue will contain the current Adc value Note return code RetCode rbxAdcValueGet EiHand AdcID AdcValue Check return code If RetCode lt gt RBX_E SUCCESS Then DisplayRobixError Error reading value for Adc
10. Voie K 3K K 3K K 3K 3k 3K 3K 3k 3K K 2s K 3K 3K 3K 24s K os K ok Check Ei status TKK KKK K K K K K K K K K K K K K K K K K K Check status of Ei If this function returns RBX E SUCCESS EiOK will contain the status of the Ei Note return code RetCode rbxLptEiResponding EiOK Check return code If RetCode lt gt RBX_E SUCCESS Then DisplayRobixError Error checking status of Ei RetCode AdcParkAndRead 1 Exit Function End If If Ei is not responding show message If E10K 0 Then Create message ErrMsg Electronics Interface not responding ErrMsg ErrMsg amp Check cables and power light Display message in a message box with buttons Retry and Cancel RetryCancel MsgBox ErrMsg vbRetryCancel Robix Error If Cancel was clicked exit this function Otherwise continue trying to read Adc mod If RetryCancel vbCancel Then AdcParkAndRead 1 Exit Function End If End If PKK KK 3K K 3K K 3K 3K K 3K K 3K K 3K K 3K 2 K 3K K kx Check max time TK KKK K K oft ok 3K 2K K K of ok K of ok K of ok OK K Calculate total time parked totaltime Time InitialTime Check for max timeout period elapsed This is done to prevent the program from hanging if the Adc mod doesn t change Note that RBX MAX EI TIMEOUT is converted from milliseconds to seconds for comparison with TotalTime If totaltime gt RBX_ MAX EI TIMEOUT 1000 Then Olivier Marchal Nicolas Ponsart 21 Real Time Visual
11. amp AdcID amp RetCode AdcParkAndRead 1 Olivier Marchal Nicolas Ponsart 22 Real Time Visual Servoing Appendices ECOLE NATIONALE D INGENIEURS DE METZ Exit Function End If l Return Adc value AdcParkAndRead AdcValue End Function Private Sub Timer1_Timer tests if we started the application If ProgramRunning 1 Then MatlabReady XLApp Cells 18 5 tests if Matlab has been launched so if everything is ready If MatlabReady 1 Then tests if the robot is waiting for instruction This is to avoid problem due to the fact the robot is already executing a command If rbxRobotAction_Wait Then Tell Matlab to pause calculations NextCalculation 0 XLApp Cells 18 7 NextCalculation PKK KK 3K K 3K 24k 3K kK 3K 3K K 3K K 3K K K 2K K 3K K 3K K K 2K K is K 3K K K 2 K fe K ois K K K K 3K K K K K 2K K 2s K 3K K K 2K K 2s K 3K K K K K 2s K 3K 2K 3K 2K K 3K K Retrieve the new joints increments on the Excel sheet Tak k ak k 3K K 3K 248 3K K 3K 3K K 3K K 3K K K 2K K 3K K 3K K 3K 2K K 3K K 3K K 3K 2K K 3K K 3K 3K 3K 2K K 3K K 3K 3K 3K K 3K 3K K 3K 3K 3K K K 3K K 3K 3K 3K K 3K FK K 3K K 3K FK K 3K K strMoveJ1 XLApp Cells 18 2 strMoveJ2 XLApp Cells 18 3 Olivier Marchal Nicolas Ponsart Real Time Visual Servoing Appendices LIVAR eea pat PKK KK 3K K 3K K 3K 24g 3K 3K K 3K K 3K K K 2 K 3K K 3K 3K K 2 K 3K K 3K K K 2K K 3K K 2s K K
12. and displays them in a message box along with an OK button The user must click OK to continue tkkkkkk kkk kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk k Public Sub DisplayError ParamArray Items Loop through each item and concatenate it to the message string For Each X In Items Msg Msg amp X Next X Display error message MsgBox Msg 0 Robix Error End Sub tkkkkkk kkkk kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk k This error reporting function accepts a error message string and a Robix error code The description of the Robix error code is obtained and the error message the error code and the error description are then displayed in a message box tkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Public Sub DisplayRobixError ErrMsg As String ErrCode As Long On Error GoTo FnError Get the size of the error description so we know how big our character array will need to be in order to hold the description Note return code RetCode rbxErrMsgSizeOf ErrCode DescripSiz If RetCode lt gt RBX_E SUCCESS Then DisplayRobixError Error getting size of error description RetCode Exit Sub End If Olivier Marchal Nicolas Ponsart 15 Real Time Visual Servoing Appendices LIVAR Georgia Make sure RobotName is large enough to hold the robot s name by filling it with the required number of characters D
13. function out main inJ inJ joint values of adept declare global variables used global J3 global J4 constant value given for joint 4 of adept global J5 constant value given for joint 5 of adept inJ inJ J3 J4 J5 expand joint vector to include last three joint values T1 DHP 0 0 0 0 0 inJ 1 these transormations from the internet T2 DHP 0 0 93 28 0 inJ 2 adept web site but with all z T3 DHP 0 0 95 71 inJ 3 0 components taken out i e in T1 T6 T4 Rz inJ 4 T5 Ry inJ 5 T6 Translate 0 0 0 To Offset to flat mounting plate T T1 T2 T3 T4 T5 T6 determine total transformation matrix T 1 1 2 4 Olivier Marchal Nicolas Ponsart 28 Real Time Visual Servoing Appendices LIVAR Georgia out T o Now update the camera transformation kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk global Tcam T_Total T1 T2 T3 Tcam inv T_ Total Of ER EAELE EE LENE EEE LEER EEA ALE ALLEN ER ERE EEL ELLE LANE RL EEA EERE EI LEAL LENE EREEREER Translation function function T Translate V T eye 4 4 zeros 4 3 V 0 OL REET AERA AEEE ERE E EEL AS EN RADE ERR ER LEARN SALE SABES LEE RELA EES AERA NEEL A ES RENNES EH These functions are rotation matrices about the Y and Z axes respectively They are used above in finding the Adept transformation matrices function T Rx inTheta inTheta inTheta pi 180 T 1 0 0 0 0 cos inTheta sin inTheta 0
14. time parked totaltime Time InitialTime Check for max timeout period elapsed This is done to prevent the program from hanging if the switch mod doesn t change Note that RBX MAX EI TIMEOUT is converted from milliseconds to seconds for comparison with TotalTime If totaltime gt RBX_ MAX EI TIMEOUT 1000 Then Create message ErrMsg Unknown error reading switch amp SwitchID amp ErrMsg ErrMsg Switch mod not updated within maximum timeout period Display message in a message box with buttons Retry and Cancel RetryCancel MsgBox ErrMsg vbRetryCancel Robix Error If Retry was clicked reset InitialTime If Cancel was clicked exit this function If RetryCancel vbRetry Then InitialTime Time Else Olivier Marchal Nicolas Ponsart 18 Real Time Visual Servoing Appendices ECOLE NATIONALE D INGENIEURS DE METZ SwitchParkAndRead 1 Exit Function End If End If l TaK ois kK 3K 3K K 3K k 3K 3K ois 2K 3K 3K K 3K K 3K 3K K 3K K ok K 3K K Read current mod PKK KKK K K K K K K K K K K K K K K ok K of K K K K Now we read current mod Note return code RetCode rbxSwitchModGet EiHand SwitchID CurrMod Check return code If RetCode lt gt RBX E SUCCESS Then DisplayRobixError Error reading mod for switch amp SwitchID amp RetCode SwitchParkAndRead 1 Exit Function End If Allow other applications to process their events DoEvents Loop While Cur
15. 7 We had to reserve IRQ 7 and reboot the PC because of conflicts with our sound card that was previously using IRQ 7 Set program variables EiHandle 0 Ei handle RobotHandle 0 robot handle Configuration file path You may need to change this path to adapt this program to your application ConfigPath C My Documents Nicolas PFE Global Visual Servoing System Visual Basic VB_ Config L117 rbc End Sub Olivier Marchal Nicolas Ponsart 9 Real Time Visual Servoing Appendices LA Geor gia pat VR KKK RRR REKRERE RRR RRR RRR RRR RRRRRRRRRRRRRRRRRRRRRRERERE This subroutine is executed when the main form becomes active In here we initialize the Rascal DLL once only tkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Private Sub Form_Activate TKKK KK 3K K 2 K K 3K K 2K K 3K K 3K K 3K 2K K 2 K 3K K 3K 2K K 3K K 3K K ok Initialize the Rascal DLL TEKKE K ok K K k k k of k ok k k of k ok kk kk kkk ok of k ok k ok ok K We do this here instead of in Form_Load so that an icon will be present during initialization This helps prevent users from losing any dialog messages that may be generated during DLL initialization Make sure we only initialize the DLL once when the form first becomes active Static DoThisOnce As Boolean If DoThisOnce False Then Verify DLL version RetCode rbxDLLVersionVerify If RetCode lt gt RBX_E SUCCESS T
16. KKK 3K K 3K K 2 K 3K 3K K 2K K 3K K 3K K 3K 2K K 2 K 2k gt K ok T oad Configuration TKK K 3K 3K 3K K 3K 3K 3K 3K K 3K K 2 K is K 3K 2K 3K 2s K ok gt K ok RetCode rbxConfigFileLoad ConfigPath Check return code If RetCode lt gt RBX E SUCCESS Then DisplayRobixError Error loading configuration file RetCode Exit Sub End If Olivier Marchal Nicolas Ponsart 11 Real Time Visual Servoing Appendices TKKK KK 3K K 3K kK 3K K K 3K K 3K K 3K 3K 3K 2K K 3K K 3K K K 2K K 3K K ois 2K 3K 2K K 3K K l Get configuration information TKK K K 3K 3K K 2s k 3k 3K 3K 3K K 3K K 3K K 3K 2K K 3K K ois K 3K K K 2 K 3K K 3K FK K 3K K Now that the configuration is successfully loaded we need to acquire handles to the existing Ei s and robot s These handles will be needed for various function calls later In this demo we assume that only one Ei and only one robot exists Get handle of first Ei RetCode rbxLptEiHandleGet 1 EiHandle Check return code If RetCode lt gt RBX_E SUCCESS Then DisplayRobixError Error getting Ei handle RetCode Exit Sub End If Make sure we have a valid handle Note that handle is zero if Ei does not exist See RascalDLLDoc txt rbxEiHandleGet for further documentation If EiHandle 0 Then DisplayError Ei does not exist Exit Sub End If Get Ei port information RetCode rbxLptEiPortInfoGet EiHandle LptPort Irq Check return
17. Olivier Marchal Nicolas Ponsart 5 Real Time Visual Servoing Appendices Private Sub sckDVT_DataArrival ByVal bytesTotal As Long tkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk This subroutine executes with every arriving data packet at the TCP port specified by the Winsock control tkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk retrieves the string and stores in strData sckDVT GetData strData vbString Send strData to spreadsheet XLApp Cells 3 2 strData End Sub Private Sub Start_Click Tell the timer to start achieving commands ProgramRunning 1 tkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk This will allow to make a link with an Excel Spreadsheet which we need to communicate with Matlab tkkkk kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Set object variable to reference an existing Excel file amp open it This path may change to fit your settings XLApp Workbooks Open C My Documents Nicolas PFE Global Visual Servoing System Excel Global_Spreadsheet xls makes Excel spreadsheet visible if desired Not Required XLApp Visible True Initialize NextCalculation to 1 so Matlab does the first calculation NextCalculation 1 XLApp Cells 18 7 NextCalculation Reset MatlabReady XLApp Cells 18 5 0 Reset the strMoveJ1 and strMoveJ2 to 0 to be ready for the nex
18. ber of bytes of robot name copied by DLL Dim ServoCount As Long number of servos assigned to robot Dim AuxOutputCount As Long number of aux outputs assigned to robot Dim AdcValue Dim Joint As String set two variables to initialize the test Dim Joint2 As String Olivier Marchal Nicolas Ponsart 4 Real Time Visual Servoing Appendices LIVAR Georgia tells if Matlab is launched and is ready to calculate new joint angles increments Dim MatlabReady As Long permits a new calculation step for Matlab New picture Dim NextCalculation As Integer tells the application started To avoid errors due to timer before clicking on Start Dim ProgramRunning As Integer create an object variable that holds a reference to an excel application Dim XLApp As New Excel Application Dim strData As String holds data after retrieval from the Winsock object Dim Script As String script to make the robot move according to the desired joint angles Dim RetCode As Long scratch variable records a return value Dim ConfigPath As String path to configuration file hardware and software settings Dim EiHandle As Long Ei handle Dim RobotHandle As Long Robot handle Private Sub Restart_Click Restart robot Note return code RetCode rbxRobotRestart RobotHandle Check return code If RetCode lt gt RBX_E SUCCESS Then DisplayRobixError Error restarting robot RetCode Exit Sub End If End Sub
19. code If RetCode lt gt RBX_E SUCCESS Then DisplayRobixError Error getting Ei port information RetCode Exit Sub End If Create a message with the info we ve obtained IbEiInfo Caption Ei enabled LPT amp LptPort amp IRQ amp Irq Get handle of first robot RetCode rbxRobotHandleGet 1 RobotHandle Check return code If RetCode lt gt RBX_E SUCCESS Then DisplayRobixError Error getting robot handle RetCode Exit Sub End If Olivier Marchal Nicolas Ponsart 12 Real Time Visual Servoing Appendices LIVAR Georgia Make sure we have a valid handle Note that handle is zero if robot does not exist See RascalDLLDoc txt rbxRobotHandleGet for further documentation If RobotHandle 0 Then DisplayError Robot does not exist Exit Sub End If Get the size of our robot s name so we know how big our string will need to be in order to hold the name Note return code RetCode rbxRobotNameSizeOf RobotHandle NameSize Check return code If RetCode lt gt RBX_E SUCCESS Then DisplayRobixError Error getting size of robot name RetCode Exit Sub End If IMPORTANT Some Rascal DLL functions fill an application provided string with characters such as roxRobotNameGet below Such functions expect a string large enough to hold all of the characters In order to dynamically create strings of appropriate size VB applications must create a string and fill i
20. cos r2 sin r1 sin r2 4 I end Adept AdeptFKProc 0 120 place target in adept workspace P P Adept P Adept use to determine circle center location Olivier Marchal Nicolas Ponsart Real Time Visual Servoing Appendices 38 LIVAR Geor gia at Appendix 7 USER MANUAL To use our application you will have to follow these steps 1 First check all your PC Software On your machine should be installed Framework 2 1 Visual Basic 6 0 and Matlab 6 0 and Rascal Robix appl 2 Plug the camera correctly according to its manual on your PC ethernet card 3 Check your configuration Your ethernet card must have the following IP address 192 168 0 240 Submask 255 255 255 0 4 Check your progam paths Within Robot Control vbp you may change paths to fit your settings parameters One is in the Form_Load sub and the other in the Start_Click sub If changes are necessary modify the paths according to your system save the project and make Visual Servoing exe by choosing this option in the File menu You are now ready to use our application on your PC 5 Now launch Framework 2 1 by clicking on the appropriate icon 6 Choose Ethernet click on Camera 192 168 0 243 and click Connect Value E Serial Property Value El Ethernet Local Sensor Name Camera Camera Sensor IP Address 192 168 0 243 Camera 192 168 0 243 Default Series 600 Unit 192 168 0 242
21. cute RobotHandle Script Check return code If RetCode lt gt RBX E SUCCESS Then DisplayRobixError Error moving robot RetCode Exit Sub End If End Sub Private Sub Exit_ClickQ ends the program Unload Me End Sub Olivier Marchal Nicolas Ponsart 8 Real Time Visual Servoing Appendices LA Geor gia pat tkkkkkk kkk kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk k This subroutine is executed when the main form is loaded In here we specify our program variables tkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Private Sub Form _Load A Robix Rascal Configuration rbc file contains information about Ei s and robots Configuration files are typically generated using the Robix Rascal Software RascalGUL exe IMPORTANT Three configuration files are supplied with this program VB_ Config L1i7 rbc Ei connected to LPT1 using IRQ7 VB_Config_L115 rbc Ei connected to LPT1 using IRQ5 VB_Config_L2i5 rbc Ei connected to LPT2 using IRQ5 Please specify the appropriate configuration file below according to your hardware settings If none of the supplied configuration files match your hardware settings use the Rascal software to create and save a working configuration file and then specify that configuration file below See the Rascal help system for further discussion of hardware settings We are using Lptl and IRQ
22. d on plot target_x_data 1 p target_y_data 1 p robot_x_data 1 p robot_y data 1 p 0 title Target and Robot Positioning in Tracking fontweight bold fontsize 14 xlabel X fontweight bold fontsize 14 ylabel Y fontweight bold fontsize 14 legend target position robot position axis 10 10 10 10 Ensure true size daspect 1 1 1 AYAY Yo YoYo Yo Yo YoYo Yo YoYo Yo YYYY YA YA Vo o AAAA o Simlnit m This program initializes neccessary global variables and files This function is also called inside cameramodel m to reinitialize without having to run this file everytime o Yo Yo Yo o Yo Yo Yo Yo Yo Yo Yo Yo Yo Yo Yo Yo Yo Yo Yo Yo Yo Yo Yo Yo Yo Ao Ao Ao Ao Ao A A AA Ah A AoA global DataOut XY feature coordinate data used for plotting DataOut global rmserror XY feature coordinate data used for plotting rmserror Frame Timing global FT_TOTAL Total time of a complete update cycle global FT_ PROCESSING Time Required for image processing and controls global FT_ COMMUNICATION Time required for commands to get to the adept FT _PROCESSING 11 1000 Olivier Marchal Nicolas Ponsart 32 Real Time Visual Servoing Appendices Georgian FT _COMMUNICATION 1 1000 FT_TOTAL 25 1000 Adept Robot global AR_JOINTCOUNT number of joints in the robot global AR_JOINTSTART initial joint positions global JointsK
23. e 0 Olivier Marchal Nicolas Ponsart 16 Real Time Visual Servoing Appendices ECOLE NATIONALE D INGENIEURS DE METZ TKK K 3K K 3K K 3k 3k 3K 3K K 3K K 3K K 3K K K 3K K 3K K 2k Read initial mod PKK K K K K K K K K K K K K K K K K K K of K K K Read mod This signals DLL to obtain a fresh reading If this function returns RBX E SUCCESS FirstMod will contain the requested switch mod Note return code RetCode rbxSwitchModGet EiHand SwitchID FirstMod Check return code If RetCode lt gt RBX E SUCCESS Then DisplayRobixError Error reading mod for switch amp SwitchID amp RetCode SwitchParkAndRead 1 Exit Function End If This while loop reads the current switch mod modification count repeatedly until the current mod differs from the first mod that was read When the two differ this indicates that the switch value has been refreshed modified Also within this while loop we check to see if the Ei is responding properly and we do a check to make sure that this loop is not executed indefinitely Note to advanced programmers Readings from the Ei s switch and analog inputs can take up to about 20 milliseconds For many applications this delay is not a problem and the program can simply wait for a new reading when desired That is what we do below On the other hand for applications where several different inputs need to be read continuously th
24. e waiting time may become excessive and the programmer may need to devise appropriate techniques to maintain a continuous set of readings with little total waiting overhead This is left as an exercise to the advanced programmer Do PKK ak 3K 3K K 3K k 3K 3K 3K 3K K 2s K 3K K 3K 2s K 3K K ok Check Ei status PKK KKK K K K K K K K K K K K K K of ok ok ok K Check status of Ei If this function returns RBX E SUCCESS EiOK will contain the status of the Ei Note return code RetCode rbxLptEiResponding EiOK Check return code If RetCode lt gt RBX_E SUCCESS Then Olivier Marchal Nicolas Ponsart 17 Real Time Visual Servoing Appendices LIVAR Geor gia pat __ DisplayRobixError Error checking status of Ei RetCode SwitchParkAndRead 1 Exit Function End If If Ei is not responding show message If E10K 0 Then Create message ErrMsg Electronics Interface not responding ErrMsg ErrMsg amp Check cables and power light Display message in a message box with buttons Retry and Cancel RetryCancel MsgBox ErrMsg vbRetryCancel Robix Error If Cancel was clicked exit this function Otherwise continue trying to read switch mod If RetryCancel vbCancel Then SwitchParkAndRead 1 Exit Function End If End If PK K kK kK 3K K 3K K 3k K 3k 3K 3K 2 K 3K K 3K 2K 3K 3K K k Check max time Vos 3 KKK K K K K K K K K K K K K K K K K K Calculate total
25. ed radius Path 2 Linearly back and forth in the x direction slowing at the ends Path 3 Linearly back and forth no slowing Path 4 A square slowing at the corners Path 5 A square no slowing at the corners Path 6 A Sun Shape Path 7 Curly Shape path 1 global path_counter the target will travel in a circle w r t the x and y axes in the z 0 plane if path spc 50 r inTime 2 pi spc control speed of target around path spc sec per cycle P 40 cos r 305 40 sin r 450 1 end target travels back and forth in a line in the x direction slowing at ends if path spc 40 r inTime 2 pi spc Olivier Marchal Nicolas Ponsart 35 Real Time Visual Servoing Appendices za P 100 cos r 0 end target travels back and forth in x direction no slowing at ends if path spc 10 n 0 timer inTime 2 n spc if timer lt spc X_position timer 175 spc 175 length of line else X_position 175 timer spc 175 spc if timer gt spc n n 1 end end P X_position 87 5 subtract 87 5 center the line 0 1 end target travels in square slowing at corners if path 4 spc 10 timer inTime spc path_counter 4 if timer lt spc r timer pi spc X_position 87 5 cos r Y_ position 87 5 elseif timer lt 2 spc r timer pi spc X_position 87 5 Y_position 87 5 cos r elseif timer lt 3 spc r timer pi spc X_p
26. escripSiz was acquired by calling roxRobotNameSizeOf above Note that any character can be used here we just use zero for simplicity ErrDescrip String DescripSiz 0 Get the error description Note return code RetCode rbxErrMsgGet ErrCode ErrDescrip DescripSiz RetSiz If RetCode lt gt RBX E SUCCESS Then DisplayRobixError Error getting error description RetCode Exit Sub End If Display the entire error message Note that we display the Robix error code according to the guidelines discussed in RascalDLL bas DisplayError ErrMsg amp Chr 10 amp Robix Error Code RBX_ amp ErrCode amp Chr 10 amp Error Description amp ErrDescrip Exit Sub FnError Display the error message description unavailable DisplayError ErrMsg amp Chr 10 amp Robix Error Code RBX_ amp ErrCode amp Chr 10 amp Error Description unavailable End Sub tkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk This function illustrates how to obtain a fresh switch reading safely Ei switch values are read by the DLL only on demand i e only when requested by an application The function returns 1 if the switch is not read successfully tkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Public Function SwitchParkAndRead EiHand As Long SwitchID As Long As Long Initialize time variables Note that Time is a VB function InitialTime Time totaltim
27. hen DisplayRobixError Error verifying DLL version RetCode End End If Check DLL functions RetCode rbxDLLFunctionsCheck If RetCode lt gt RBX_E SUCCESS Then DisplayError Error checking DLL functions RetCode End End If DoThisOnce True End If End Sub Olivier Marchal Nicolas Ponsart 10 Real Time Visual Servoing Appendices LA Georgia Ine ECOLE NATIONALE D INGENIEURS DE METZ tkkkkkk kkkk kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk k This subroutine is executed when the main form is unloaded In here we clear any configuration that may be loaded into the DLL tkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Private Sub Form_Unload Cancel As Integer Clear the current configuration Note return code RetCode rbxConfigClear Check return code If RetCode lt gt RBX E SUCCESS Then DisplayRobixError Error clearing configuration RetCode Exit Sub End If End Sub tkkkkkk kkk kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk k This subroutine is executed when the button labeled Load Configuration is clicked This subroutine loads an existing Robix Rascal Configuration into the DLL displays some information about that configuration and assigns a script to an existing robot tkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Private Sub bnLoadConfiguration_ClickQ T
28. int MaxJoint 0 Initialize target path counter used in some target paths global path_counter path_counter 0 Aoo Yo o Yo o Yo o Yo o Yo o Yo Yo Yo Yo Yo Yo Yo Yo Yo Yo Yo Yo Yo Yo Vo Yo Vo Yo Yo Yo Yo Yo o Vo Ao o Vo Robotinput m This function retrieves robot coordinates from the Excel Spreadsheet o 2 Yo Yo YoYo Yo Yo YoYo Yo Yo Y0 Yo Yo Yo Yo Yo Yoo Yo Yo YoYo Yo Yo Vo o P A A Ao A function P W X W 1 initiate a conversation with Excel from spreadsheet Global_ Spreadsheet xls channel ddeinit excel Global_ Spreadsheet xls Set cells in Excel for poking C10 r10c3 D10 r10c4 request the values from the excel spreadsheet RobotX ddereg channel C10 RobotY ddereg channel D10 P RobotX RobotY terminate the communication with Excel rc ddeterm channel Olivier Marchal Nicolas Ponsart 34 Real Time Visual Servoing Appendices LIVAR Geor gia PWV Y YoYo YoYo o Yo Yo Yo Yo Yo YoYo Yoo YoYo Yo Yo Yo Yo Yo o Ao AA bA hh Aho TargetPath m This function produces a time dependant path for the target position in the XYZ robot coordinates INPUT clock time OUTPUT target position as vector P PWV Y Y0 YoYo o Yo o Yo Yo Yo YoYo Yoo Yoo YoYo Ao Yo Yo o Ao A AA hA hh Aho function P TargetPath inTime inTime time from clock Pick the Path to be followed by the target Path 1 A circle of specifi
29. isual Servoing Appendices LA gi f j ECOLE NATIONALE DINGENIEURS DE METZ Appendix 2 Visual Basic Program Here is our Visual Basic program More interesting parts are subroutines sckDVT_DataArrival Start and Timer tkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Force explicit declaration of all variables tkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Option Explicit Dim strMoveJ1 As String New joint angle increment retrieved from Matlab Dim strMoveJ2 As String Dim FirstMod As Long initial switch modification count mod Dim CurrMod As Long current switch modification count mod Dim InitialTime As Double system Time when parking begins Dim totaltime As Long total system Time in seconds parked Dim EiOK As Long Ei Responding indicator Dim SwitchValue As Long the value of the switch Dim ErrMsg As String temporary message variable Dim RetryCancel As Byte message box result holder Dim X As Variant For error displaying Dim Msg As String Dim DescripSiz As Long Dim RetSiz As Long Dim ErrDescrip As String Create string to hold error description Dim RobotName As String Create string to hold our robot s name Dim LptPort As Long LPT port to which a Robix Rascal Ei is connected Dim Irq As Long IRQ associated with the above LPT port Dim NameSize As Long size in bytes of robot name Dim RetSize As Long num
30. oVo o Vo o Vo CameraPlotsPoints m This function takes the data in the DataOut file a file of the feature points for all time increments and plots the target feature position and the end effector position together INPUT data file DataOut OUTPUT plot shown by double clicking the Cameras button in simulink PPV Yo Y0 YoYo Yo Yo YoYo Yo Yo Yo Yo Yo Yo Yo Yo Yoo Yo Yo Yoo Vo Yo Yo Ao A A P A hA A AoA function main call global variables to be used global CamDataOut file of virtual target and end effector feature positions First check to see if there is any data in the file there will be no data if the simulation has not been run and give an error message for no data if isempty CamDataOut msgbox Currently no data available Error return end n m size CamDataOut target_x_data target_y_data robot_x_data robot_y_data for i 10 30 n target_x_data target_x_data CamDataOut i 1 target_y_data target_y_data CamDataOut i 2 robot_x_data robot_x_data CamDataOut i 3 robot_y_data robot_y_ data CamDataOut i 4 end JI J Hi p q size target_x_data Olivier Marchal Nicolas Ponsart 31 Real Time Visual Servoing Appendices ECOLE NATIONALE D INGENIEURS DE METZ If there is data then the plots can be created Create a plot window figure Units normalized Position 1 1 8 8 Plot Data hol
31. ork TCP adds support to detect errors or lost data and to trigger retransmission until the data is correctly and completely received e Sockets is a name given to the package of subroutines that provide access to TCP IP on most systems Olivier Marchal Nicolas Ponsart 25 Real Time Visual Servoing Appendices ECOLE NATIONALE D INGENIEURS DE METZ LATING cegat Appendix 4 Excel Platform This Excel spreadsheet has been created to realize the link between Matlab and Visual Basic Its existence is due to the ease of use when it is linked with both of these sofwares 2 Microsoft Excel Global_Spreadsheet xls _ l8 x G8 File Edit View Insert Format Tools Data Window Help 218 xl Arial 18 B zZ u a 2ml S EELA 3 j aS C D E C a B Alz Aoo n gt o Security ARA w F E18 0 Please launch the ROBIX Simulink Application Application running jOchea S6QY sBRS Orn E5 M A B 1 2 String received from Visual Basic 3 4 Target coordinates in Framework __ 6 8 9 Please launch the ROBIX ea Simulink Application 13 pA 128 73 14 15 16 7 Joint Joint2 k om e 19 20 0 Matlab stopped 0 Robot waiting Matl 21 1 Matlab launched 1 Robot running scrip 22 23 a ea 780 26 28 29 1414 gt lpi Sheet1 Sheet2 Sheet3 Ia aie Ready ai I N n Olivier Marchal
32. osition 87 5 cos r Y_position 87 5 else r timer pi spc X_position 87 5 Y_position 87 5 cos r Olivier Marchal Nicolas Ponsart 36 Real Time Visual Servoing Appendices za LIUM jeega if round 1000 timer 4000 spc path_counter path_counter 1 end end P X_position Y_ position 1 end target travels in square with no slowing at corners if path spc 10 timer inTime spc path_counter 4 if timer lt spc t inTime spc path_counter 4 X_position t 175 spc Y_position 0 elseif timer lt 2 spc t inTime spc path_counter 4 1 X_position 175 Y_ position t 175 spc elseif timer lt 3 spc t inTime spc path_counter 4 2 X_position 175 t 175 spc Y_position 175 else t inTime spc path_counter 4 3 X_position 0 Y_position 175 t 175 spc if round 1000 t 1000 spc path_counter path_counter 1 end end P X_position 87 5 Y_position 87 5 1 end Fireball if path spc1 40 spc2 spc1 6 r1 inTime 2 pi spc 1 r2 inTime 2 pi spc2 Olivier Marchal Nicolas Ponsart 37 Real Time Visual Servoing Appendices LIVAR i l P 100 20 cos r2 cos r1 cos r2 5 100 20 cos r2 sin r1 cos r2 5 I end Curly if path spc1 25 spc2 spc1 8 r1 inTime 2 pi spc71 r2 inTime 2 pi spc2 P 100 20 cos r2 cos r1 sin r2 4 100 20
33. rMod FirstMod We get here when the current mod is different from the first mod This indicates that the switch s value has been refreshed Read fresh switch value If this function returns RBX E SUCCESS SwitchValue will contain the current switch value Note return code RetCode rbxSwitchValueGet EiHand SwitchID SwitchValue Check return code If RetCode lt gt RBX E SUCCESS Then DisplayRobixError Error reading value for switch amp SwitchID amp RetCode SwitchParkAndRead 1 Exit Function End If Return switch value SwitchParkAndRead SwitchValue End Function Olivier Marchal Nicolas Ponsart 19 Real Time Visual Servoing Appendices LA Geor gia pat VR KKK REE RRR RRR RR RRR RRR RRR RRRRRR RRR RRRRRRRRRRERERE This function illustrates how to obtain a fresh Adc reading safely Ei Adc values are read by the DLL only on demand i e only when requested by an application The function returns 1 if the Adc is not read successfully tkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Public Function AdcParkAndRead EiHand As Long AdcID As Long Initialize time variables Note that Time is a VB function InitialTime Time totaltime 0 TK kK K 3K K 3K K 3k 3k 2 3K K 3K K 3K K 3K 2K 3K 3K K 3K K 2k Read initial mod PKK K K K K KK K K K K K K K K K K K K of K K K Read mod This signals DLL to obtain a fresh reading If thi
34. rs into a network of networks the Internet It was initially successful because it delivered a few basic services that everyone needs file transfer electronic mail remote logon across a very large number of client and server systems Several computers in a small department can use TCP IP along with other protocols on a single LAN The IP component provides routing from the department to the enterprise network then to regional networks and finally to the global Internet On the battlefield a communications network will sustain damage so the DOD designed TCP IP to be robust and automatically recover from any node or phone line failure This design allows the construction of very large networks with less central management However because of the automatic recovery network problems can go undiagnosed and uncorrected for long periods of time As with all other communications protocol TCP IP is composed of layers e IP is responsible for moving packet of data from node to node IP forwards each packet based on a four byte destination address the IP number The Internet authorities assign ranges of numbers to different organizations The organizations assign groups of their numbers to departments IP operates on gateway machines that move data from department to organization to region and then around the world e TCP is responsible for verifying the correct delivery of data from client to server Data can be lost in the intermediate netw
35. s function returns RBX E SUCCESS FirstMod will contain the requested Adc mod Note return code RetCode rbxAdcModGet EiHand AdcID FirstMod Check return code If RetCode lt gt RBX E SUCCESS Then DisplayRobixError Error reading mod for Adc amp AdcID amp RetCode AdcParkAndRead 1 Exit Function End If This while loop reads the current Adc mod modification count repeatedly until the current mod differs from the first mod that was read When the two differ this indicates that the Adc value has been refreshed modified Also within this while loop we check to see if the Ei is responding properly and we do a check to make sure that this loop is not executed indefinitely Note to advanced programmers Readings from the Ei s Adc and analog inputs can take up to about 20 milliseconds For many applications this delay is not a problem and the program can simply wait for a new reading when desired That is what we do below On the other hand for applications where several different inputs need to be read continuously the waiting time may become excessive and the programmer may need to devise appropriate techniques to maintain a continuous set of readings with little total waiting overhead This is left as an exercise to the advanced programmer Olivier Marchal Nicolas Ponsart 20 Real Time Visual Servoing Appendices LIVAR Georgia i Do
36. t application launching XLApp Cells 20 2 101 27 XLApp Cells 20 3 0 Olivier Marchal Nicolas Ponsart 6 Real Time Visual Servoing Appendices IUM aeg ECOLE NATIONALE D INGENIEURS DE METZ VR KKK RRR RERERERRKRRRR RRR RRR RRERRRRERRRRRRRRRRRRRRRRRRRRRRERERSE Use the TCP IP protocol to retrieve data from Framework tkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Invoke the connect Method from the Winsock object this establishes the connection according to RemoteHost and RemotePort properties sckDVT Connect End Sub Private Sub Stop_ClickQ tells the timer to stop executing commands ProgramRunning 0 Disconnect from the RemoteHost and RemotePort sckDVT Close Save spreadsheet Not required XLApp ActiveWorkbook Save close Excel XLApp Workbooks Close End Sub Olivier Marchal Nicolas Ponsart Real Time Visual Servoing Appendices LIVAR Geor gia WI Private Sub Test_Click tkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk For test purpose only Check if the robot moves correctly with a single test script tkkkkkk kkk kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk k make a single movement For test purpose Jointl 500 Joint2 600 cancatenation of the script Script Move by Joint 2 by Joint2 Script Move 1 by 600 2 by 600 RetCode rbxScriptExe
37. t with the required amount of characters as shown below If your application passes a string of incorrect size you may receive a null pointer error code an access violation may occur or some other undesirable activity may occur Make sure RobotName is large enough to hold the robot s name by filling it with the required number of characters NameSize was acquired by calling roxRobotNameSizeOf above Note that any character can be used here we just use zero for simplicity RobotName String NameSize 0 Get our robot s name Note return code RetCode rbxRobotNameGet RobotHandle RobotName NameSize RetSize Check return code If RetCode lt gt RBX_E SUCCESS Then DisplayRobixError Error getting robot name RetCode Exit Sub End If Now let s see how many servos and aux outputs are assigned to our robot Olivier Marchal Nicolas Ponsart 13 Real Time Visual Servoing Appendices LIVAR Georgia Get our robot s servo count Note return code RetCode rbxRobotServoCountGet RobotHandle ServoCount Check return code If RetCode lt gt RBX E SUCCESS Then DisplayRobixError Error getting robot s servo count RetCode Exit Sub End If Get our robot s aux output count Note return code RetCode rbxRobotAuxOutputCountGet RobotHandle AuxOutputCount Check return code If RetCode lt gt RBX_E SUCCESS Then DisplayRobixError Error getting robot s aux output count
Download Pdf Manuals
Related Search
Related Contents
serra circular esquadrejadeira sceo/ir 2950 DANGER-- MESURES DE SÉCURITÉ IMPORTANTES MISE 1.3 Sobre este guia do usuário HTW-4DDSF取扱説明書 BOMBA DE CALOR HP 900 & HP 1200 Installation et entretien Copyright © All rights reserved.
Failed to retrieve file