<commit_before><commit_msg>added new drawing method for ponit cloud data<commit_after>#ifndef DRAW_POINTS2_H
#define DRAW_POINTS2_H

#include <cnoid/SceneView>
#include <sensor_msgs/LaserScan.h>

namespace grasp
{

class SgPointsDrawing2;

class SgPointsDrawing2 : public cnoid::SgCustomGLNode
{
public:
  EIGEN_MAKE_ALIGNED_OPERATOR_NEW

  SgPointsDrawing2(sensor_msgs::LaserScan* raw_data)
  {
    setRenderingFunction2(boost::bind(&SgPointsDrawing2::renderLaserRawData2, this));
    this->laser_raw_data_ = raw_data;
  }

  void renderLaserRawData2() {
    glPushAttrib(GL_LIGHTING_BIT | GL_CURRENT_BIT);
    glDisable(GL_LIGHTING);
    glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
    float r=0,g=0,b=0;
    glPointSize(3.0);
    glBegin(GL_POINTS);

    float angle, distance, lrf_x, lrf_y;
    float lrf_set_x;
    float lrf_set_y;

    r=1,g=0,b=0;
    glColor3f(r,g,b);

    lrf_set_x = 2.5;
    lrf_set_y = 0.15;

    for(int i=0; i<laser_raw_data1_->ranges.size(); i++)
    {
      angle = (i * 0.25 - 45)* M_PI/180.;
      if(angle>=0 && angle<=M_PI)
      {
        distance = laser_raw_data1_->ranges[i];
        lrf_x = distance * cos(angle) + lrf_set_x;
        lrf_y = distance * sin(angle) + lrf_set_y;
        glVertex3d(lrf_x,lrf_y,0.875);
       }
    }

    SgVertexArrayPtr vertices = new SgVertexArray();
    //vertices->reserve(numPoints); a lot of PCD
    SgVector3 vertex = SgVector3(1,1,1);
    vertices->push_back(vertex);
    SgPointSetPtr pointSet = new SgPointSet();
    pointSet->setVertices(vertices);

    if (pointSet)
    {
      SgInvariantGroupPtr group = new SgInvariantGroup();
      group->addChild(pointSet);
      SceneView::instance()->addEntity(group);
      //os << pointSet->vertices()->size() << " points have been added.";
    }

    glEnd();
    glPopAttrib();
  }

  sensor_msgs::LaserScan*   laser_raw_data1_;
};

}
#endif // DRAW_POINTS2_H
{'fraction_non_alphanumeric': 0.12857142857142856, 'fraction_numerical': 0.02486772486772487, 'mean_word_length': 3.5898058252427183, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 16, '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': '2879657', 'n_tokens_mistral': 769, 'n_tokens_neox': 750, 'n_words': 117}