<commit_before>#include "ros/ros.h"
#include "boost/asio.hpp"
#include "jaws_msgs/Thrusters.h"

class Arbotix
{
  private:
    ros::NodeHandle nh;
    ros::Subscriber sub;
    boost::asio::io_service i_o;
    boost::asio::serial_port s_p;
  public:
    Arbotix() : nh(), i_o(), s_p(i_o, "/dev/ttyACM0")
    {
      sub = nh.subscribe<jaws_msgs::Thrusters>("thrusters", 1, &Arbotix::callback, this);
    }
    void callback(const jaws_msgs::Thrusters::ConstPtr& thrusters)
    {
      int size = 11;
      unsigned char d[size];

      d[0] = '-';
      d[1] = thrusters->port_angle & 0xFF;
      d[2] = (thrusters->port_angle >> 8) & 0xFF;

      d[3] = thrusters->stbd_angle & 0xFF;
      d[4] = (thrusters->stbd_angle >> 8) & 0xFF;

      d[5] = thrusters->port_power & 0xFF;
      d[6] = (thrusters->port_power >> 8) & 0xFF;

      d[7] = thrusters->stbd_power & 0xFF;
      d[8] = (thrusters->stbd_power >> 8) & 0xFF;

      d[9] = thrusters->aft_power & 0xFF;
      d[10] = (thrusters->aft_power >> 8) & 0xFF;

      s_p.write_some(boost::asio::buffer(&d, size));
    }
    void loop()
    {
      ros::spin();
    }
};

int main(int argc, char **argv)
{<commit_msg>Tested the night of February the 25th in the year of our Robot 2015.<commit_after>#include "ros/ros.h"
#include "boost/asio.hpp"
#include "jaws_msgs/Thrusters.h"

class Arbotix
{
  private:
    ros::NodeHandle nh;
    ros::Subscriber sub;
    boost::asio::io_service i_o;
    boost::asio::serial_port s_p;
  public:
    Arbotix() : nh(), i_o(), s_p(i_o, "/dev/ttyUSB0")
    {
	s_p.set_option(boost::asio::serial_port_base::baud_rate(38400));
      sub = nh.subscribe<jaws_msgs::Thrusters>("thrusters", 1, &Arbotix::callback, this);
    }
    void callback(const jaws_msgs::Thrusters::ConstPtr& thrusters)
    {
      int size = 11;
      unsigned char d[size];
	char c;
      d[0] = '-';
      d[1] = thrusters->port_angle & 0xFF;
      d[2] = (thrusters->port_angle >> 8) & 0xFF;

      d[3] = thrusters->stbd_angle & 0xFF;
      d[4] = (thrusters->stbd_angle >> 8) & 0xFF;

      d[5] = thrusters->port_power & 0xFF;
      d[6] = (thrusters->port_power >> 8) & 0xFF;

      d[7] = thrusters->stbd_power & 0xFF;
      d[8] = (thrusters->stbd_power >> 8) & 0xFF;

      d[9] = thrusters->aft_power & 0xFF;
      d[10] = (thrusters->aft_power >> 8) & 0xFF;
      s_p.write_some(boost::asio::buffer(&d, size));
while(1){
	boost::asio::read(s_p,boost::asio::buffer(&c,1));
	if(c=='\n'){
		break;
	}
}
 
   }
    void loop()
    {
      ros::spin();
    }
};

int main(int argc, char **argv)
{
{'fraction_non_alphanumeric': 0.1828125, 'fraction_numerical': 0.029296875, 'mean_word_length': 3.0141065830721003, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1316603', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1040, 'n_words': 188}