55#include < cstring>
66#include < utility>
77
8- namespace proto = robot_server::protocol;
8+ namespace proto = robot_server::protocol;
99namespace sockets = robot_server::sockets;
1010
1111namespace robot_server {
@@ -15,8 +15,8 @@ namespace {
1515bool send_message (sockets::socket_handle fd, uint16_t op, uint32_t request_id, const std::vector<uint8_t > & payload,
1616 std::string & error) {
1717 proto::header h;
18- h.op = op;
19- h.request_id = request_id;
18+ h.op = op;
19+ h.request_id = request_id;
2020 h.payload_len = payload.size ();
2121
2222 std::vector<uint8_t > header;
@@ -55,7 +55,7 @@ bool make_predict_request(const ModelObservation & obs, proto::predict_request &
5555 return false ;
5656 }
5757
58- req.task = obs.prompt ;
58+ req.task = obs.prompt ;
5959 req.state = obs.state ;
6060 req.images .clear ();
6161 req.images .reserve (obs.images .size ());
@@ -75,11 +75,11 @@ bool make_predict_request(const ModelObservation & obs, proto::predict_request &
7575
7676 const size_t image_size = (size_t )stride * (size_t )src.height ;
7777 proto::image_payload image;
78- image.name = src.name .empty () ? " image" + std::to_string (i) : src.name ;
78+ image.name = src.name .empty () ? " image" + std::to_string (i) : src.name ;
7979 image.image_format = proto::image_raw_rgb_u8;
80- image.width = src.width ;
81- image.height = src.height ;
82- image.channels = 3 ;
80+ image.width = src.width ;
81+ image.height = src.height ;
82+ image.channels = 3 ;
8383 image.stride_bytes = stride;
8484 image.data .resize (image_size);
8585 std::memcpy (image.data .data (), src.rgb_hwc_u8 , image_size);
@@ -157,10 +157,10 @@ bool ModelClient::predict(const ModelObservation & obs, ModelResponse & response
157157 return false ;
158158 }
159159
160- response.chunk_size = resp.chunk_size ;
161- response.action_dim = resp.action_dim ;
160+ response.chunk_size = resp.chunk_size ;
161+ response.action_dim = resp.action_dim ;
162162 response.actions_flat = std::move (resp.actions );
163- response.metrics = std::move (resp.metrics );
163+ response.metrics = std::move (resp.metrics );
164164 return true ;
165165}
166166
@@ -177,7 +177,7 @@ bool ModelClient::call(uint16_t op, const std::vector<uint8_t> & request_payload
177177 }
178178
179179 const uint32_t request_id = next_request_id_++;
180- bool ok = send_message (fd, op, request_id, request_payload, error);
180+ bool ok = send_message (fd, op, request_id, request_payload, error);
181181 proto::header response_header;
182182 if (ok) {
183183 ok = recv_message (fd, response_header, response_payload, error);
0 commit comments