From 3078c52150c41751326f9d8d923eeea907fe6f7f Mon Sep 17 00:00:00 2001 From: husky-robotics Date: Fri, 12 Apr 2024 03:04:54 +0000 Subject: [PATCH] deploy: 08a9174559937d1b4e2e8c4491b4077177cd0177 --- Constants_8h_source.html | 175 ++++++++++++++++++++------------------- 1 file changed, 88 insertions(+), 87 deletions(-) diff --git a/Constants_8h_source.html b/Constants_8h_source.html index f70c7d6d..a35299e9 100644 --- a/Constants_8h_source.html +++ b/Constants_8h_source.html @@ -130,93 +130,94 @@
59// TODO: We need to recalibrate the camera, since we replaced it with a different one.
60// TODO: rename cameras (in MC as well) as appropriate
61constexpr const char* MAST_CAMERA_CONFIG_PATH = "../camera-config/MastCameraCalibration.yml";
-
62const robot::types::CameraID MAST_CAMERA_ID = "front"; // TODO: replace with real camera name
-
63
-
64constexpr const char* FOREARM_CAMERA_CONFIG_PATH =
-
65 "../camera-config/ForearmCameraCalibration.yml";
-
66const robot::types::CameraID FOREARM_CAMERA_ID = "rear";
-
67
-
68constexpr const char* HAND_CAMERA_CONFIG_PATH = "../camera-config/HandCameraCalibration.yml";
-
69const robot::types::CameraID HAND_CAMERA_ID = "upperArm";
-
70
-
74constexpr uint16_t PLANVIZ_SERVER_PORT = 9002;
-
75constexpr uint16_t WS_SERVER_PORT = 3001;
-
76
-
80constexpr const char* MC_PROTOCOL_NAME = "/mission-control";
-
84constexpr const char* SIM_PROTOCOL_NAME = "/simulator";
-
88constexpr const char* DGPS_PROTOCOL_NAME = "/dgps";
-
92constexpr const char* ARDUPILOT_PROTOCOL_NAME = "/ardupilot";
-
93
-
94constexpr std::chrono::milliseconds JOINT_POWER_REPEAT_PERIOD(333);
-
95constexpr std::chrono::milliseconds ARM_IK_UPDATE_PERIOD(50);
-
96
-
97namespace Nav {
-
98// Distance (m) we could have traveled forward in the time it takes to turn 1 radian
-
99constexpr double RADIAN_COST = EFF_WHEEL_BASE / 2.0;
-
100// Planner stays this far away from obstacles (m)
-
101constexpr double SAFE_RADIUS = Constants::ROBOT_LENGTH * 1.3;
-
102constexpr int MAX_ITERS = 3000; // Max number of nodes expanded during A* search
-
103constexpr double PLAN_RESOLUTION = Constants::ROBOT_LENGTH; // m
-
104constexpr double SEARCH_RADIUS_INCREMENT = Constants::ROBOT_LENGTH * 3;
-
105constexpr double GPS_WAYPOINT_RADIUS = Constants::ROBOT_LENGTH * 1.5;
-
106constexpr double LANDMARK_WAYPOINT_RADIUS = Constants::ROBOT_LENGTH * 1.3;
-
107constexpr double EPS = 2.0; // heuristic weight for weighted A*
-
108} // namespace Nav
-
109
-
110// Lidar
-
111namespace Lidar {
-
112const std::string RP_PATH = "/dev/ttyUSB0";
-
113constexpr double MM_PER_M = 1000;
-
114constexpr uint32_t RPLIDAR_A1_BAUDRATE = 115200;
-
115constexpr uint32_t RPLIDAR_S1_BAUDRATE = 256000;
-
116} // namespace Lidar
-
117
-
118// Video encoding
-
119namespace video {
-
120constexpr int H264_RF_CONSTANT = 40;
-
121} // namespace video
-
122
-
126constexpr frozen::unordered_map<robot::types::jointid_t, robot::types::motorid_t, 7>
-
127 JOINT_MOTOR_MAP{{robot::types::jointid_t::armBase, robot::types::motorid_t::armBase},
-
128 {robot::types::jointid_t::shoulder, robot::types::motorid_t::shoulder},
-
129 {robot::types::jointid_t::elbow, robot::types::motorid_t::elbow},
-
130 {robot::types::jointid_t::forearm, robot::types::motorid_t::forearm},
-
131 {robot::types::jointid_t::wrist, robot::types::motorid_t::wrist},
-
132 {robot::types::jointid_t::hand, robot::types::motorid_t::hand},
-
133 {robot::types::jointid_t::activeSuspension,
-
134 robot::types::motorid_t::activeSuspension}};
-
135
-
136// Arm inverse kinematics
-
137namespace arm {
-
141constexpr double SAFETY_FACTOR = 0.95;
-
142
-
146constexpr double MAX_EE_VEL = 0.1;
-
147constexpr double IK_SOLVER_THRESH = 0.001;
-
148
-
149constexpr int IK_SOLVER_MAX_ITER = 50;
-
150
-
155constexpr std::array<robot::types::jointid_t, 2> IK_MOTOR_JOINTS = {
-
156 robot::types::jointid_t::shoulder, robot::types::jointid_t::elbow};
-
157
-
162constexpr std::array<robot::types::motorid_t, 2> IK_MOTORS = ([]() constexpr {
-
163 std::array<robot::types::motorid_t, IK_MOTOR_JOINTS.size()> ret{};
-
164 for (size_t i = 0; i < IK_MOTOR_JOINTS.size(); i++) {
-
165 ret[i] = JOINT_MOTOR_MAP.at(IK_MOTOR_JOINTS[i]);
-
166 }
-
167 return ret;
-
168})();
-
169
-
173constexpr frozen::unordered_map<robot::types::motorid_t, std::pair<int, int>, IK_MOTORS.size()>
-
174 JOINT_LIMITS{{robot::types::motorid_t::shoulder, {18200, 152500}},
-
175 {robot::types::motorid_t::elbow, {-169100, 0}}};
-
176
-
180constexpr frozen::unordered_map<robot::types::motorid_t, double, IK_MOTORS.size()>
-
181 SEGMENT_LENGTHS{{robot::types::motorid_t::shoulder, 0.3848608},
-
182 {robot::types::motorid_t::elbow, 0.461264}};
-
183} // namespace arm
-
184
-
185constexpr double CONTROL_HZ = 10.0;
-
186} // namespace Constants
+
62const robot::types::CameraID MAST_CAMERA_ID =
+
63 "upperArm"; // TODO: replace with real camera name
+
64
+
65constexpr const char* FOREARM_CAMERA_CONFIG_PATH =
+
66 "../camera-config/ForearmCameraCalibration.yml";
+
67const robot::types::CameraID FOREARM_CAMERA_ID = "rear";
+
68
+
69constexpr const char* HAND_CAMERA_CONFIG_PATH = "../camera-config/HandCameraCalibration.yml";
+
70const robot::types::CameraID HAND_CAMERA_ID = "front";
+
71
+
75constexpr uint16_t PLANVIZ_SERVER_PORT = 9002;
+
76constexpr uint16_t WS_SERVER_PORT = 3001;
+
77
+
81constexpr const char* MC_PROTOCOL_NAME = "/mission-control";
+
85constexpr const char* SIM_PROTOCOL_NAME = "/simulator";
+
89constexpr const char* DGPS_PROTOCOL_NAME = "/dgps";
+
93constexpr const char* ARDUPILOT_PROTOCOL_NAME = "/ardupilot";
+
94
+
95constexpr std::chrono::milliseconds JOINT_POWER_REPEAT_PERIOD(333);
+
96constexpr std::chrono::milliseconds ARM_IK_UPDATE_PERIOD(50);
+
97
+
98namespace Nav {
+
99// Distance (m) we could have traveled forward in the time it takes to turn 1 radian
+
100constexpr double RADIAN_COST = EFF_WHEEL_BASE / 2.0;
+
101// Planner stays this far away from obstacles (m)
+
102constexpr double SAFE_RADIUS = Constants::ROBOT_LENGTH * 1.3;
+
103constexpr int MAX_ITERS = 3000; // Max number of nodes expanded during A* search
+
104constexpr double PLAN_RESOLUTION = Constants::ROBOT_LENGTH; // m
+
105constexpr double SEARCH_RADIUS_INCREMENT = Constants::ROBOT_LENGTH * 3;
+
106constexpr double GPS_WAYPOINT_RADIUS = Constants::ROBOT_LENGTH * 1.5;
+
107constexpr double LANDMARK_WAYPOINT_RADIUS = Constants::ROBOT_LENGTH * 1.3;
+
108constexpr double EPS = 2.0; // heuristic weight for weighted A*
+
109} // namespace Nav
+
110
+
111// Lidar
+
112namespace Lidar {
+
113const std::string RP_PATH = "/dev/ttyUSB0";
+
114constexpr double MM_PER_M = 1000;
+
115constexpr uint32_t RPLIDAR_A1_BAUDRATE = 115200;
+
116constexpr uint32_t RPLIDAR_S1_BAUDRATE = 256000;
+
117} // namespace Lidar
+
118
+
119// Video encoding
+
120namespace video {
+
121constexpr int H264_RF_CONSTANT = 40;
+
122} // namespace video
+
123
+
127constexpr frozen::unordered_map<robot::types::jointid_t, robot::types::motorid_t, 7>
+
128 JOINT_MOTOR_MAP{{robot::types::jointid_t::armBase, robot::types::motorid_t::armBase},
+
129 {robot::types::jointid_t::shoulder, robot::types::motorid_t::shoulder},
+
130 {robot::types::jointid_t::elbow, robot::types::motorid_t::elbow},
+
131 {robot::types::jointid_t::forearm, robot::types::motorid_t::forearm},
+
132 {robot::types::jointid_t::wrist, robot::types::motorid_t::wrist},
+
133 {robot::types::jointid_t::hand, robot::types::motorid_t::hand},
+
134 {robot::types::jointid_t::activeSuspension,
+
135 robot::types::motorid_t::activeSuspension}};
+
136
+
137// Arm inverse kinematics
+
138namespace arm {
+
142constexpr double SAFETY_FACTOR = 0.95;
+
143
+
147constexpr double MAX_EE_VEL = 0.1;
+
148constexpr double IK_SOLVER_THRESH = 0.001;
+
149
+
150constexpr int IK_SOLVER_MAX_ITER = 50;
+
151
+
156constexpr std::array<robot::types::jointid_t, 2> IK_MOTOR_JOINTS = {
+
157 robot::types::jointid_t::shoulder, robot::types::jointid_t::elbow};
+
158
+
163constexpr std::array<robot::types::motorid_t, 2> IK_MOTORS = ([]() constexpr {
+
164 std::array<robot::types::motorid_t, IK_MOTOR_JOINTS.size()> ret{};
+
165 for (size_t i = 0; i < IK_MOTOR_JOINTS.size(); i++) {
+
166 ret[i] = JOINT_MOTOR_MAP.at(IK_MOTOR_JOINTS[i]);
+
167 }
+
168 return ret;
+
169})();
+
170
+
174constexpr frozen::unordered_map<robot::types::motorid_t, std::pair<int, int>, IK_MOTORS.size()>
+
175 JOINT_LIMITS{{robot::types::motorid_t::shoulder, {18200, 152500}},
+
176 {robot::types::motorid_t::elbow, {-169100, 0}}};
+
177
+
181constexpr frozen::unordered_map<robot::types::motorid_t, double, IK_MOTORS.size()>
+
182 SEGMENT_LENGTHS{{robot::types::motorid_t::shoulder, 0.3848608},
+
183 {robot::types::motorid_t::elbow, 0.461264}};
+
184} // namespace arm
+
185
+
186constexpr double CONTROL_HZ = 10.0;
+
187} // namespace Constants