Advertisement
Trainlover08

VEX_AI_SIM/robot_controller/include/devices.h

Oct 29th, 2024
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.54 KB | None | 0 0
  1. // (VEX_AI_SIM/robot_controller/include/devices.h)
  2.  
  3. #include "include/libraries.h"
  4. // main robot
  5. Supervisor *robot = new Supervisor();
  6.  
  7. // drivetrain motors
  8. Motor *left1 = robot->getMotor("left1");
  9. Motor *left2 = robot->getMotor("left2");
  10. Motor *left3 = robot->getMotor("left3");
  11. Motor *right1 = robot->getMotor("right1");
  12. Motor *right2 = robot->getMotor("right2");
  13. Motor *right3 = robot->getMotor("right3");
  14.  
  15. // other motors/pneumatics
  16. Motor *Hook = robot->getMotor("hookPneumatic");
  17. Motor *topRingArm = robot->getMotor("topRingArm");
  18. Motor *intakeHold = robot->getMotor("intakeHold");
  19. Motor *intakeRoll = robot->getMotor("intakeRoll");
  20. Motor *conveyor = robot->getMotor("conveyor");
  21. Motor *ringClampL = robot->getMotor("ringClampL");
  22. Motor *ringClampR = robot->getMotor("ringClampR");
  23.  
  24. // other deivces
  25. Emitter *emit = robot->getEmitter("emit");
  26. Receiver *receiv = robot->getReceiver("receiv");
  27. Camera *invisVision = robot->getCamera("invisVision");
  28. GPS *yes = robot->getGPS("yes");
  29.  
  30. // nodes
  31. // robot and goals
  32. Node *mainBotNode = robot->getFromDef("mainBot");
  33. Node *goalNode1 = robot->getFromDef("goal1");
  34. Node *goalNode2 = robot->getFromDef("goal2");
  35. Node *goalNode3 = robot->getFromDef("goal3");
  36. Node *goalNode4 = robot->getFromDef("goal4");
  37. Node *goalNode5 = robot->getFromDef("goal5");
  38.  
  39. // rings
  40. // red rings
  41. Node *redRing1 = robot->getFromDef("redRing1");
  42. Node *redRing2 = robot->getFromDef("redRing2");
  43. Node *redRing3 = robot->getFromDef("redRing3");
  44. Node *redRing4 = robot->getFromDef("redRing4");
  45. Node *redRing5 = robot->getFromDef("redRing5");
  46. Node *redRing6 = robot->getFromDef("redRing6");
  47. Node *redRing7 = robot->getFromDef("redRing7");
  48. Node *redRing8 = robot->getFromDef("redRing8");
  49. Node *redRing9 = robot->getFromDef("redRing9");
  50. Node *redRing10 = robot->getFromDef("redRing10");
  51. Node *redRing11 = robot->getFromDef("redRing11");
  52. Node *redRing12 = robot->getFromDef("redRing12");
  53. Node *redRing13 = robot->getFromDef("redRing13");
  54. Node *redRing14 = robot->getFromDef("redRing14");
  55. Node *redRing15 = robot->getFromDef("redRing15");
  56. Node *redRing16 = robot->getFromDef("redRing16");
  57. Node *redRing17 = robot->getFromDef("redRing17");
  58. Node *redRing18 = robot->getFromDef("redRing18");
  59. Node *redRing19 = robot->getFromDef("redRing19");
  60. Node *redRing20 = robot->getFromDef("redRing20");
  61. Node *redRing21 = robot->getFromDef("redRing21");
  62. Node *redRing22 = robot->getFromDef("redRing22");
  63. Node *redRing23 = robot->getFromDef("redRing23");
  64.  
  65. // blue rings
  66. Node *blueRing1 = robot->getFromDef("blueRing1");
  67. Node *blueRing2 = robot->getFromDef("blueRing2");
  68. Node *blueRing3 = robot->getFromDef("blueRing3");
  69. Node *blueRing4 = robot->getFromDef("blueRing4");
  70. Node *blueRing5 = robot->getFromDef("blueRing5");
  71. Node *blueRing6 = robot->getFromDef("blueRing6");
  72. Node *blueRing7 = robot->getFromDef("blueRing7");
  73. Node *blueRing8 = robot->getFromDef("blueRing8");
  74. Node *blueRing9 = robot->getFromDef("blueRing9");
  75. Node *blueRing10 = robot->getFromDef("blueRing10");
  76.  
  77. // fields
  78. // robot and goals
  79. Field *translateFieldBot = mainBotNode->getField("translation");
  80. Field *rotateFieldBot = mainBotNode->getField("rotation");
  81. Field *translateGoal1 = goalNode1->getField("translation");
  82. Field *translateGoal2 = goalNode2->getField("translation");
  83. Field *translateGoal3 = goalNode3->getField("translation");
  84. Field *translateGoal4 = goalNode4->getField("translation");
  85. Field *translateGoal5 = goalNode5->getField("translation");
  86.  
  87. // rings
  88. // red rings
  89. Field *translateRedRing1 = redRing1->getField("translation");
  90. Field *translateRedRing2 = redRing2->getField("translation");
  91. Field *translateRedRing3 = redRing3->getField("translation");
  92. Field *translateRedRing4 = redRing4->getField("translation");
  93. Field *translateRedRing5 = redRing5->getField("translation");
  94. Field *translateRedRing6 = redRing6->getField("translation");
  95. Field *translateRedRing7 = redRing7->getField("translation");
  96. Field *translateRedRing8 = redRing8->getField("translation");
  97. Field *translateRedRing9 = redRing9->getField("translation");
  98. Field *translateRedRing10 = redRing10->getField("translation");
  99. Field *translateRedRing11 = redRing11->getField("translation");
  100. Field *translateRedRing12 = redRing12->getField("translation");
  101. Field *translateRedRing13 = redRing13->getField("translation");
  102. Field *translateRedRing14 = redRing14->getField("translation");
  103. Field *translateRedRing15 = redRing15->getField("translation");
  104. Field *translateRedRing16 = redRing16->getField("translation");
  105. Field *translateRedRing17 = redRing17->getField("translation");
  106. Field *translateRedRing18 = redRing18->getField("translation");
  107. Field *translateRedRing19 = redRing19->getField("translation");
  108. Field *translateRedRing20 = redRing20->getField("translation");
  109. Field *translateRedRing21 = redRing21->getField("translation");
  110. Field *translateRedRing22 = redRing22->getField("translation");
  111. Field *translateRedRing23 = redRing23->getField("translation");
  112.  
  113. // blue rings
  114. Field *translateBlueRing1 = blueRing1->getField("translation");
  115. Field *translateBlueRing2 = blueRing2->getField("translation");
  116. Field *translateBlueRing3 = blueRing3->getField("translation");
  117. Field *translateBlueRing4 = blueRing4->getField("translation");
  118. Field *translateBlueRing5 = blueRing5->getField("translation");
  119. Field *translateBlueRing6 = blueRing6->getField("translation");
  120. Field *translateBlueRing7 = blueRing7->getField("translation");
  121. Field *translateBlueRing8 = blueRing8->getField("translation");
  122. Field *translateBlueRing9 = blueRing9->getField("translation");
  123. Field *translateBlueRing10 = blueRing10->getField("translation");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement