Commit 299c1090 authored by Svetlana's avatar Svetlana
Browse files

Minor changes to TORCS clients

parent c8549d76
...@@ -18,9 +18,10 @@ int main(int argc, char **argv) ...@@ -18,9 +18,10 @@ int main(int argc, char **argv)
{ {
std_msgs::Int8MultiArray::Ptr msg(new std_msgs::Int8MultiArray); std_msgs::Int8MultiArray::Ptr msg(new std_msgs::Int8MultiArray);
msg->data.resize(torcs::IMAGE_SIZE_BYTES); msg->data.resize(torcs::IMAGE_SIZE_BYTES);
constexpr auto SCALED_IMAGE_SIZE_BYTES = 280*210*3u;
const auto imageData = client.getScreenshot(); const auto imageData = client.getScreenshot();
memcpy(msg->data.data(), imageData->data(), imageData->size()); memcpy(msg->data.data(), imageData->data(), SCALED_IMAGE_SIZE_BYTES);
ROS_INFO("%f", msg->data[0]); ROS_INFO("%f", msg->data[0]);
chatter_pub.publish(msg); chatter_pub.publish(msg);
......
...@@ -63,7 +63,7 @@ class TorcsClient ...@@ -63,7 +63,7 @@ class TorcsClient
{ {
public: public:
TorcsClient(); TorcsClient();
void sendCommand(Command cmd); std::unique_ptr<DataContainer> getScreenshot();
private: private:
struct shared_use_st *shared; struct shared_use_st *shared;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment