/Software/LowLevel/VisionBoard/src/PacketConfig.c

https://gitlab.com/TTYRobotiklubi/Follower · C · 108 lines · 62 code · 11 blank · 35 comment · 0 complexity · 21eec884ad75e407f0ab9e1de4fbb69f MD5 · raw file

  1. // ----------------------------------------------------------------------------
  2. //
  3. // Casecatcher generated packet configuration source file
  4. //
  5. // ----------------------------------------------------------------------------
  6. // ----------------------------------------------------------------------------
  7. // Includes
  8. // ----------------------------------------------------------------------------
  9. #include "PacketConfig.h"
  10. // ----------------------------------------------------------------------------
  11. // Packet "RobotFeedback" parameters table
  12. // ----------------------------------------------------------------------------
  13. const PacketParameter packetRobotFeedbackParameterList[4] =
  14. {
  15. { DLParamRobotFeedback1, 0, 16 },
  16. { DLParamRobotFeedback2, 16, 16 },
  17. { DLParamRobotFeedback3, 32, 16 },
  18. { DLParamRobotFeedback4, 48, 16 }
  19. };
  20. // ----------------------------------------------------------------------------
  21. // Packet "DistanceSensors" parameters table
  22. // ----------------------------------------------------------------------------
  23. const PacketParameter packetDistanceSensorsParameterList[8] =
  24. {
  25. { DLParamDistanceSensor1, 0, 8 },
  26. { DLParamDistanceSensor2, 8, 8 },
  27. { DLParamDistanceSensor3, 16, 8 },
  28. { DLParamDistanceSensor4, 24, 8 },
  29. { DLParamDistanceSensor5, 32, 8 },
  30. { DLParamDistanceSensor6, 40, 8 },
  31. { DLParamDistanceSensor7, 48, 8 },
  32. { DLParamDistanceSensor8, 56, 8 }
  33. };
  34. // ----------------------------------------------------------------------------
  35. // Packet "Quaternions" parameters table
  36. // ----------------------------------------------------------------------------
  37. const PacketParameter packetQuaternionsParameterList[4] =
  38. {
  39. { DLParamQw, 0, 16 },
  40. { DLParamQx, 16, 16 },
  41. { DLParamQy, 32, 16 },
  42. { DLParamQz, 48, 16 }
  43. };
  44. // ----------------------------------------------------------------------------
  45. // Packet "MotorSpeeds" parameters table
  46. // ----------------------------------------------------------------------------
  47. const PacketParameter packetMotorSpeedsParameterList[2] =
  48. {
  49. { DLParamMotor1RequestSpeed, 0, 16 },
  50. { DLParamMotor2RequestSpeed, 16, 16 }
  51. };
  52. // ----------------------------------------------------------------------------
  53. // Packet "RobotControl" parameters table
  54. // ----------------------------------------------------------------------------
  55. const PacketParameter packetRobotControlParameterList[2] =
  56. {
  57. { DLParamRequestTranslationSpeed, 0, 16 },
  58. { DLParamRequestRotationSpeed, 16, 16 }
  59. };
  60. // ----------------------------------------------------------------------------
  61. // Packet "PidSetup" parameters table
  62. // ----------------------------------------------------------------------------
  63. const PacketParameter packetPidSetupParameterList[3] =
  64. {
  65. { DLParamPidParameter, 0, 8 },
  66. { DLParamPidValue, 8, 32 },
  67. { DLParamPidUpdating, 40, 1 }
  68. };
  69. // ----------------------------------------------------------------------------
  70. // Packet "CameraControl" parameters table
  71. // ----------------------------------------------------------------------------
  72. const PacketParameter packetCameraControlParameterList[2] =
  73. {
  74. { DLParamCameraRequestXDegree, 0, 8 },
  75. { DLParamCameraRequestZDegree, 8, 8 }
  76. };
  77. // ----------------------------------------------------------------------------
  78. // Packet "Visualization" parameters table
  79. // ----------------------------------------------------------------------------
  80. const PacketParameter packetVisualizationParameterList[1] =
  81. {
  82. { DLParamVisualizationActivity, 0, 8 }
  83. };
  84. // ----------------------------------------------------------------------------
  85. // Packets table
  86. // ----------------------------------------------------------------------------
  87. PacketDescriptor PacketDescriptorList[NumberOfPackets] =
  88. {
  89. /* RobotFeedback */ { 0xD4, packetRobotFeedbackParameterList, 4, 8 },
  90. /* DistanceSensors */ { 0xF0, packetDistanceSensorsParameterList, 8, 8 },
  91. /* Quaternions */ { 0xF2, packetQuaternionsParameterList, 4, 8 },
  92. /* MotorSpeeds */ { 0xD0, packetMotorSpeedsParameterList, 2, 4 },
  93. /* RobotControl */ { 0xD3, packetRobotControlParameterList, 2, 4 },
  94. /* PidSetup */ { 0xD5, packetPidSetupParameterList, 3, 6 },
  95. /* CameraControl */ { 0xE0, packetCameraControlParameterList, 2, 2 },
  96. /* Visualization */ { 0xFA, packetVisualizationParameterList, 1, 1 }
  97. };