Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 1 | #include "y2016/dashboard/dashboard.h" |
| 2 | |
Austin Schuh | f2a50ba | 2016-12-24 16:16:26 -0800 | [diff] [blame] | 3 | #include <chrono> |
| 4 | #include <complex> |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 5 | #include <iostream> |
| 6 | #include <sstream> |
| 7 | #include <string> |
| 8 | #include <thread> |
| 9 | #include <vector> |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 10 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 11 | #include "aos/events/shm_event_loop.h" |
John Park | 398c74a | 2018-10-20 21:17:39 -0700 | [diff] [blame] | 12 | #include "aos/init.h" |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 13 | #include "aos/logging/logging.h" |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 14 | #include "aos/realtime.h" |
Austin Schuh | 86cd572 | 2019-04-14 13:34:20 -0700 | [diff] [blame] | 15 | #include "aos/seasocks/seasocks_logger.h" |
Brian Silverman | 1463c09 | 2020-10-30 17:28:24 -0700 | [diff] [blame] | 16 | #include "aos/stl_mutex/stl_mutex.h" |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 17 | #include "aos/time/time.h" |
| 18 | #include "aos/util/phased_loop.h" |
Austin Schuh | ed5b26d | 2019-12-05 20:51:59 -0800 | [diff] [blame] | 19 | #include "frc971/autonomous/auto_mode_generated.h" |
Philipp Schrader | 790cb54 | 2023-07-05 21:06:52 -0700 | [diff] [blame] | 20 | #include "internal/Embedded.h" |
| 21 | #include "seasocks/Server.h" |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 22 | #include "y2016/control_loops/superstructure/superstructure_status_generated.h" |
| 23 | #include "y2016/queues/ball_detector_generated.h" |
| 24 | #include "y2016/vision/vision_generated.h" |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 25 | |
Austin Schuh | f2a50ba | 2016-12-24 16:16:26 -0800 | [diff] [blame] | 26 | namespace chrono = ::std::chrono; |
| 27 | |
Stephan Pleines | f63bde8 | 2024-01-13 15:59:33 -0800 | [diff] [blame] | 28 | namespace y2016::dashboard { |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 29 | namespace big_indicator { |
| 30 | constexpr int kBlack = 0; |
| 31 | constexpr int kBallIntaked = 1; |
| 32 | constexpr int kAiming = 2; |
| 33 | constexpr int kLockedOn = 3; |
| 34 | } // namespace big_indicator |
| 35 | |
| 36 | namespace superstructure_indicator { |
| 37 | constexpr int kBlack = 0; |
| 38 | constexpr int kNotZeroed = 1; |
| 39 | constexpr int kEstopped = 2; |
| 40 | } // namespace superstructure_indicator |
| 41 | |
| 42 | // Define the following if we want to use a local www directory and feed in |
| 43 | // dummy data. |
Austin Schuh | 50e3dca | 2023-07-23 14:34:27 -0700 | [diff] [blame] | 44 | // #define DASHBOARD_TESTING |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 45 | |
| 46 | // Define the following if we want to read from the vision queue, which has |
| 47 | // caused problems in the past when auto aiming that still need to be addressed. |
Austin Schuh | 50e3dca | 2023-07-23 14:34:27 -0700 | [diff] [blame] | 48 | // #define DASHBOARD_READ_VISION_QUEUE |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 49 | |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 50 | DataCollector::DataCollector(::aos::EventLoop *event_loop) |
Austin Schuh | d32b362 | 2019-06-23 18:49:06 -0700 | [diff] [blame] | 51 | : event_loop_(event_loop), |
| 52 | vision_status_fetcher_( |
Brian Silverman | 1463c09 | 2020-10-30 17:28:24 -0700 | [diff] [blame] | 53 | event_loop->MakeFetcher<::y2016::vision::VisionStatus>("/vision")), |
Austin Schuh | 4b652c9 | 2019-05-27 13:22:27 -0700 | [diff] [blame] | 54 | ball_detector_fetcher_( |
| 55 | event_loop->MakeFetcher<::y2016::sensors::BallDetector>( |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 56 | "/superstructure")), |
Austin Schuh | a250b2d | 2019-05-27 16:14:02 -0700 | [diff] [blame] | 57 | autonomous_mode_fetcher_( |
| 58 | event_loop->MakeFetcher<::frc971::autonomous::AutonomousMode>( |
Tyler Chatow | 24b5db1 | 2020-01-06 21:16:56 -0800 | [diff] [blame] | 59 | "/autonomous")), |
Austin Schuh | 9481d0d | 2019-06-29 21:56:17 -0700 | [diff] [blame] | 60 | superstructure_status_fetcher_( |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 61 | event_loop |
| 62 | ->MakeFetcher<::y2016::control_loops::superstructure::Status>( |
| 63 | "/superstructure")), |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 64 | cur_raw_data_("no data"), |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 65 | sample_id_(0), |
| 66 | measure_index_(0), |
Comran Morshed | 40a1800 | 2016-04-28 13:40:26 -0700 | [diff] [blame] | 67 | overflow_id_(1) {} |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 68 | |
| 69 | void DataCollector::RunIteration() { |
Brian Silverman | 1463c09 | 2020-10-30 17:28:24 -0700 | [diff] [blame] | 70 | std::unique_lock<aos::stl_mutex> locker(mutex_); |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 71 | measure_index_ = 0; |
| 72 | |
| 73 | // Add recorded data here. ///// |
| 74 | #ifdef DASHBOARD_TESTING |
| 75 | // The following feeds data into the webserver when we do not have a process |
| 76 | // feeding data to the queues. |
| 77 | // To test, we are sending three streams holding randomly generated numbers. |
| 78 | AddPoint("test", ::std::rand() % 4); |
| 79 | AddPoint("test2", ::std::rand() % 3); |
| 80 | AddPoint("test3", ::std::rand() % 3 - 1); |
| 81 | (void)big_indicator::kBlack; |
| 82 | (void)big_indicator::kBallIntaked; |
| 83 | (void)big_indicator::kAiming; |
| 84 | (void)big_indicator::kLockedOn; |
| 85 | (void)superstructure_indicator::kBlack; |
| 86 | (void)superstructure_indicator::kNotZeroed; |
| 87 | (void)superstructure_indicator::kEstopped; |
| 88 | #else |
| 89 | int big_indicator = big_indicator::kBlack; |
| 90 | int superstructure_state_indicator = superstructure_indicator::kBlack; |
| 91 | // We should never have a -1 here, so this is an indicator that somethings |
| 92 | // gone wrong with reading the auto queue. |
| 93 | int auto_mode_indicator = -1; |
| 94 | |
Austin Schuh | a250b2d | 2019-05-27 16:14:02 -0700 | [diff] [blame] | 95 | autonomous_mode_fetcher_.Fetch(); |
Austin Schuh | 9481d0d | 2019-06-29 21:56:17 -0700 | [diff] [blame] | 96 | superstructure_status_fetcher_.Fetch(); |
Austin Schuh | 4b652c9 | 2019-05-27 13:22:27 -0700 | [diff] [blame] | 97 | ball_detector_fetcher_.Fetch(); |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 98 | vision_status_fetcher_.Fetch(); |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 99 | |
Comran Morshed | 3896733 | 2016-04-23 19:26:48 -0700 | [diff] [blame] | 100 | // Caused glitching with auto-aim at NASA, so be cautious with this until |
| 101 | // we find a good fix. |
| 102 | #ifdef DASHBOARD_READ_VISION_QUEUE |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 103 | if (vision_status_fetcher_.get() && |
| 104 | (vision_status_fetcher_->left_image_valid || |
| 105 | vision_status_fetcher_->right_image_valid)) { |
Comran Morshed | 3896733 | 2016-04-23 19:26:48 -0700 | [diff] [blame] | 106 | big_indicator = big_indicator::kAiming; |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 107 | if (::std::abs(vision_status_fetcher_->horizontal_angle) < 0.002) { |
Comran Morshed | 3896733 | 2016-04-23 19:26:48 -0700 | [diff] [blame] | 108 | big_indicator = big_indicator::kLockedOn; |
| 109 | } |
| 110 | } |
| 111 | #else |
| 112 | (void)big_indicator::kAiming; |
| 113 | (void)big_indicator::kLockedOn; |
| 114 | #endif |
| 115 | |
| 116 | // Ball detector comes after vision because we want to prioritize that |
| 117 | // indication. |
Austin Schuh | 4b652c9 | 2019-05-27 13:22:27 -0700 | [diff] [blame] | 118 | if (ball_detector_fetcher_.get()) { |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 119 | // TODO(comran): Grab detected voltage from joystick_reader. Except this |
| 120 | // value may not change, so it may be worth it to keep it as it is right |
| 121 | // now. |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 122 | if (ball_detector_fetcher_->voltage() > 2.5) { |
Comran Morshed | 3896733 | 2016-04-23 19:26:48 -0700 | [diff] [blame] | 123 | big_indicator = big_indicator::kBallIntaked; |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 124 | } |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 125 | } |
| 126 | |
Austin Schuh | 9481d0d | 2019-06-29 21:56:17 -0700 | [diff] [blame] | 127 | if (superstructure_status_fetcher_.get()) { |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 128 | if (!superstructure_status_fetcher_->zeroed()) { |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 129 | superstructure_state_indicator = superstructure_indicator::kNotZeroed; |
| 130 | } |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 131 | if (superstructure_status_fetcher_->estopped()) { |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 132 | superstructure_state_indicator = superstructure_indicator::kEstopped; |
| 133 | } |
| 134 | } |
| 135 | |
Austin Schuh | a250b2d | 2019-05-27 16:14:02 -0700 | [diff] [blame] | 136 | if (autonomous_mode_fetcher_.get()) { |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 137 | auto_mode_indicator = autonomous_mode_fetcher_->mode(); |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 138 | } |
| 139 | |
| 140 | AddPoint("big indicator", big_indicator); |
| 141 | AddPoint("superstructure state indicator", superstructure_state_indicator); |
James Kuszmaul | 651fc3f | 2019-05-15 21:14:25 -0700 | [diff] [blame] | 142 | if (auto_mode_indicator != 15) { |
Campbell Crowley | 9ed61a5 | 2016-11-05 17:13:07 -0700 | [diff] [blame] | 143 | AddPoint("auto mode indicator", auto_mode_indicator); |
| 144 | } |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 145 | #endif |
| 146 | |
| 147 | // Get ready for next iteration. ///// |
| 148 | sample_id_++; |
| 149 | } |
| 150 | |
| 151 | void DataCollector::AddPoint(const ::std::string &name, double value) { |
| 152 | // Mutex should be locked when this method is called to synchronize packets. |
Brian Silverman | 1463c09 | 2020-10-30 17:28:24 -0700 | [diff] [blame] | 153 | AOS_CHECK(mutex_islocked(mutex_.native_handle())); |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 154 | |
| 155 | size_t index = GetIndex(sample_id_); |
| 156 | |
Austin Schuh | f2a50ba | 2016-12-24 16:16:26 -0800 | [diff] [blame] | 157 | ItemDatapoint datapoint{value, ::aos::monotonic_clock::now()}; |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 158 | if (measure_index_ >= sample_items_.size()) { |
| 159 | // New item in our data table. |
| 160 | ::std::vector<ItemDatapoint> datapoints; |
| 161 | SampleItem item{name, datapoints}; |
| 162 | sample_items_.emplace_back(item); |
| 163 | } else if (index >= sample_items_.at(measure_index_).datapoints.size()) { |
| 164 | // New data point for an already existing item. |
| 165 | sample_items_.at(measure_index_).datapoints.emplace_back(datapoint); |
| 166 | } else { |
| 167 | // Overwrite an already existing data point for an already existing item. |
| 168 | sample_items_.at(measure_index_).datapoints.at(index) = datapoint; |
| 169 | } |
| 170 | |
| 171 | measure_index_++; |
| 172 | } |
| 173 | |
| 174 | ::std::string DataCollector::Fetch(int32_t from_sample) { |
Brian Silverman | 1463c09 | 2020-10-30 17:28:24 -0700 | [diff] [blame] | 175 | std::unique_lock<aos::stl_mutex> locker(mutex_); |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 176 | |
| 177 | ::std::stringstream message; |
| 178 | message.precision(10); |
| 179 | |
| 180 | // Send out the names of each item when requested by the client. |
| 181 | // Example: *item_one_name,item_two_name,item_three_name |
| 182 | if (from_sample == 0) { |
| 183 | message << "*"; // Begin name packet. |
| 184 | |
| 185 | // Add comma-separated list of names. |
| 186 | for (size_t cur_data_name = 0; cur_data_name < sample_items_.size(); |
| 187 | cur_data_name++) { |
| 188 | if (cur_data_name > 0) { |
| 189 | message << ","; |
| 190 | } |
| 191 | message << sample_items_.at(cur_data_name).name; |
| 192 | } |
| 193 | return message.str(); |
| 194 | } |
| 195 | |
| 196 | // Send out one sample containing the data. |
| 197 | // Samples are split with dollar signs, info with percent signs, and |
| 198 | // measurements with commas. |
| 199 | // Example of data with two samples: $289%2803.13%10,67$290%2803.14%12,68 |
| 200 | |
| 201 | // Note that we are ignoring the from_sample being sent to keep up with the |
| 202 | // live data without worrying about client lag. |
Comran Morshed | 40a1800 | 2016-04-28 13:40:26 -0700 | [diff] [blame] | 203 | int32_t cur_sample = sample_id_; |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 204 | int32_t adjusted_index = GetIndex(cur_sample); |
| 205 | message << "$"; // Begin data packet. |
| 206 | |
| 207 | // Make sure we are not out of range. |
Comran Morshed | 40a1800 | 2016-04-28 13:40:26 -0700 | [diff] [blame] | 208 | if (sample_items_.size() > 0) { |
| 209 | if (static_cast<size_t>(adjusted_index) < |
| 210 | sample_items_.at(0).datapoints.size()) { |
| 211 | message << cur_sample << "%" |
James Kuszmaul | 651fc3f | 2019-05-15 21:14:25 -0700 | [diff] [blame] | 212 | << ::aos::time::DurationInSeconds( |
Austin Schuh | f2a50ba | 2016-12-24 16:16:26 -0800 | [diff] [blame] | 213 | sample_items_.at(0) |
| 214 | .datapoints.at(adjusted_index) |
| 215 | .time.time_since_epoch()) |
Austin Schuh | f2a50ba | 2016-12-24 16:16:26 -0800 | [diff] [blame] | 216 | << "%"; // Send time. |
Comran Morshed | 40a1800 | 2016-04-28 13:40:26 -0700 | [diff] [blame] | 217 | // Add comma-separated list of data points. |
| 218 | for (size_t cur_measure = 0; cur_measure < sample_items_.size(); |
| 219 | cur_measure++) { |
| 220 | if (cur_measure > 0) { |
| 221 | message << ","; |
| 222 | } |
| 223 | message << sample_items_.at(cur_measure) |
| 224 | .datapoints.at(adjusted_index) |
| 225 | .value; |
| 226 | } |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 227 | } |
| 228 | } |
| 229 | |
| 230 | return message.str(); |
| 231 | } |
| 232 | |
| 233 | size_t DataCollector::GetIndex(size_t sample_id) { |
| 234 | return sample_id % overflow_id_; |
| 235 | } |
| 236 | |
| 237 | void DataCollector::operator()() { |
| 238 | ::aos::SetCurrentThreadName("DashboardData"); |
| 239 | |
Austin Schuh | f2a50ba | 2016-12-24 16:16:26 -0800 | [diff] [blame] | 240 | ::aos::time::PhasedLoop phased_loop(chrono::milliseconds(100), |
Austin Schuh | d32b362 | 2019-06-23 18:49:06 -0700 | [diff] [blame] | 241 | event_loop_->monotonic_now(), |
Austin Schuh | f2a50ba | 2016-12-24 16:16:26 -0800 | [diff] [blame] | 242 | chrono::seconds(0)); |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 243 | while (run_) { |
Austin Schuh | f2a50ba | 2016-12-24 16:16:26 -0800 | [diff] [blame] | 244 | phased_loop.SleepUntilNext(); |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 245 | RunIteration(); |
| 246 | } |
| 247 | } |
| 248 | |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 249 | SocketHandler::SocketHandler(::aos::EventLoop *event_loop) |
| 250 | : data_collector_(event_loop), |
| 251 | data_collector_thread_(::std::ref(data_collector_)) {} |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 252 | |
| 253 | void SocketHandler::onConnect(seasocks::WebSocket *connection) { |
| 254 | connections_.insert(connection); |
Austin Schuh | f257f3c | 2019-10-27 21:00:43 -0700 | [diff] [blame] | 255 | AOS_LOG(INFO, "Connected: %s : %s\n", connection->getRequestUri().c_str(), |
| 256 | seasocks::formatAddress(connection->getRemoteAddress()).c_str()); |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 257 | } |
| 258 | |
| 259 | void SocketHandler::onData(seasocks::WebSocket *connection, const char *data) { |
| 260 | int32_t from_sample = atoi(data); |
| 261 | |
| 262 | ::std::string send_data = data_collector_.Fetch(from_sample); |
| 263 | connection->send(send_data.c_str()); |
| 264 | } |
| 265 | |
| 266 | void SocketHandler::onDisconnect(seasocks::WebSocket *connection) { |
| 267 | connections_.erase(connection); |
Austin Schuh | f257f3c | 2019-10-27 21:00:43 -0700 | [diff] [blame] | 268 | AOS_LOG(INFO, "Disconnected: %s : %s\n", connection->getRequestUri().c_str(), |
| 269 | seasocks::formatAddress(connection->getRemoteAddress()).c_str()); |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 270 | } |
| 271 | |
| 272 | void SocketHandler::Quit() { |
| 273 | data_collector_.Quit(); |
| 274 | data_collector_thread_.join(); |
| 275 | } |
| 276 | |
Stephan Pleines | f63bde8 | 2024-01-13 15:59:33 -0800 | [diff] [blame] | 277 | } // namespace y2016::dashboard |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 278 | |
Austin Schuh | 094d09b | 2020-11-20 23:26:52 -0800 | [diff] [blame] | 279 | int main(int argc, char **argv) { |
Brian Silverman | acdabeb | 2019-03-23 14:04:36 -0700 | [diff] [blame] | 280 | // Make sure to reference this to force the linker to include it. |
| 281 | findEmbeddedContent(""); |
| 282 | |
Austin Schuh | 094d09b | 2020-11-20 23:26:52 -0800 | [diff] [blame] | 283 | ::aos::InitGoogle(&argc, &argv); |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 284 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 285 | aos::FlatbufferDetachedBuffer<aos::Configuration> config = |
Austin Schuh | c5fa6d9 | 2022-02-25 14:36:28 -0800 | [diff] [blame] | 286 | aos::configuration::ReadConfig("aos_config.json"); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 287 | |
| 288 | ::aos::ShmEventLoop event_loop(&config.message()); |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 289 | |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 290 | ::seasocks::Server server(::std::shared_ptr<seasocks::Logger>( |
Austin Schuh | 86cd572 | 2019-04-14 13:34:20 -0700 | [diff] [blame] | 291 | new ::aos::seasocks::SeasocksLogger(::seasocks::Logger::Level::Info))); |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 292 | ::y2016::dashboard::SocketHandler socket_handler(&event_loop); |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 293 | |
| 294 | server.addWebSocketHandler( |
| 295 | "/ws", |
| 296 | ::std::shared_ptr<::y2016::dashboard::SocketHandler>(&socket_handler)); |
| 297 | #ifdef DASHBOARD_TESTING |
| 298 | server.serve("www", 1180); |
| 299 | #else |
| 300 | // Absolute directory of www folder on the robot. |
Austin Schuh | c0ec2a8 | 2022-02-24 17:26:29 -0800 | [diff] [blame] | 301 | server.serve("/home/admin/bin/www", 1180); |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 302 | #endif |
| 303 | |
| 304 | socket_handler.Quit(); |
| 305 | |
Comran Morshed | daf6923 | 2016-04-20 22:25:37 -0700 | [diff] [blame] | 306 | return 0; |
| 307 | } |