<commit_before>#include <ros/ros.h>
#include <geometry_msgs/Point.h>
#include <geometry_msgs/TransformStamped.h>
#include <tf2_ros/transform_broadcaster.h>

int offset_x, offset_y, offset_z;

void pointCallback(const geometry_msgs::Point::ConstPtr& msg) {
  static tf2_ros::TransformBroadcaster br;
  geometry_msgs::TransformStamped transform_stamped;
  
  transform_stamped.header.stamp = ros::Time::now();
  transform_stamped.header.frame_id = "kinect";
  transform_stamped.child_frame_id = "tomato";
  transform_stamped.transform.translation.x = msg->x + offset_x;
  transform_stamped.transform.translation.y = msg->y + offset_y;
  transform_stamped.transform.translation.z = msg->z + offset_z;
  transform_stamped.transform.rotation.x = 0;
  transform_stamped.transform.rotation.y = 0;
  transform_stamped.transform.rotation.z = 0;
  transform_stamped.transform.rotation.w = 1;

  br.sendTransform(transform_stamped);
}

int main(int argc, char** argv){
  ros::init(argc, argv, "tomato_broadcaster");
  ros::NodeHandle node;
  ros::NodeHandle offset_nh {"~offset"};

  offset_nh.getParam("x", offset_x);
  offset_nh.getParam("y", offset_y);
  offset_nh.getParam("z", offset_z);

  ros::Subscriber sub = node.subscribe("tomato_point", 1, &pointCallback);<commit_msg>Reset broadcaster<commit_after>#include <ros/ros.h>
#include <geometry_msgs/Point.h>
#include <geometry_msgs/TransformStamped.h>
#include <tf2_ros/transform_broadcaster.h>

int offsetX, offsetY, offsetZ;

void pointCallback(const geometry_msgs::Point::ConstPtr& msg) {
  static tf2_ros::TransformBroadcaster br;
  geometry_msgs::TransformStamped transformStamped;
  
  transformStamped.header.stamp = ros::Time::now();
  transformStamped.header.frame_id = "kinect";
  transformStamped.child_frame_id = "tomato";
  transformStamped.transform.translation.x = msg->x + offsetX;
  transformStamped.transform.translation.y = msg->y + offsetY;
  transformStamped.transform.translation.z = msg->z + offsetZ;
  transformStamped.transform.rotation.x = 0;
  transformStamped.transform.rotation.y = 0;
  transformStamped.transform.rotation.z = 0;
  transformStamped.transform.rotation.w = 1;

  br.sendTransform(transformStamped);
}

int main(int argc, char** argv){
  ros::init(argc, argv, "tomato_broadcaster");
  ros::NodeHandle node;
  ros::NodeHandle private_node;

  private_node.getParam("kinect_offset_x", offsetX);
  private_node.getParam("kinect_offset_y", offsetY);
  private_node.getParam("kinect_offset_z", offsetZ);

  ros::Subscriber sub = node.subscribe("/tomato_point", 1, &pointCallback);
{'fraction_non_alphanumeric': 0.13026521060842433, 'fraction_numerical': 0.00546021840873635, 'mean_word_length': 6.286931818181818, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, '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': '6609658', 'n_tokens_mistral': 899, 'n_tokens_neox': 868, 'n_words': 137}