void draw_velodyne_360(velodyne_360_drawer* v_drawer, carmen_pose_3D_t car_pose)
{
	glPushMatrix();
		glTranslatef(car_pose.position.x, car_pose.position.y, car_pose.position.z);
		glRotatef(carmen_radians_to_degrees(car_pose.orientation.yaw), 0.0f, 0.0f, 1.0f);
		glRotatef(carmen_radians_to_degrees(car_pose.orientation.pitch), 0.0f, 1.0f, 0.0f);
		glRotatef(carmen_radians_to_degrees(car_pose.orientation.roll), 1.0f, 0.0f, 0.0f);

		glBegin(GL_POINTS);

			//glColor3f(0.0,0.0,1.0);

			int num_points_current = v_drawer->num_points_current;

			int i;
			for(i=0; i<num_points_current; i++)
			{
				set_laser_point_color(v_drawer->points_current[i].x, v_drawer->points_current[i].y, v_drawer->points_current[i].z);
				glVertex3f(v_drawer->points_current[i].x, v_drawer->points_current[i].y, v_drawer->points_current[i].z);
			}

			int num_points_last = v_drawer->num_points_last;

			if(num_points_current > 0)
			{
				double last_current_angle = v_drawer->angles_current[num_points_current - 1];
				int last_start_index = get_index_angle_last(v_drawer, last_current_angle);

				for(i=last_start_index; i>=0 && i<num_points_last; i++)
				{
					set_laser_point_color(v_drawer->points_last[i].x, v_drawer->points_last[i].y, v_drawer->points_last[i].z);
					glVertex3f(v_drawer->points_last[i].x, v_drawer->points_last[i].y, v_drawer->points_last[i].z);
				}
			}

		glEnd();

	glPopMatrix();
}
Example #2
0
void
draw_velodyne_points (point_cloud *velodyne_points, int cloud_size)
{
   // glPointSize (5);
    glBegin (GL_POINTS);

    //glColor3d(0.0,0.0,1.0);

    int i;
    for (i = 0; i < cloud_size; i++)
    {
        int j;
        for (j = 0; j < velodyne_points[i].num_points; j++)
        {
            set_laser_point_color (velodyne_points[i].points[j].x, velodyne_points[i].points[j].y, velodyne_points[i].points[j].z - velodyne_points[i].car_position.z);
            glVertex3d (velodyne_points[i].points[j].x, velodyne_points[i].points[j].y, velodyne_points[i].points[j].z);
        }
    }

    glEnd ();

}
Example #3
0
void
draw_laser_points (point_cloud *laser_points, point_cloud *laser_points_car, int laser_size)
{
    laser_points_car = laser_points_car;

    glBegin (GL_POINTS);

    //glColor3d(0.0,0.0,1.0);

    int i;
    for (i = 0; i < laser_size; i++)
    {
        int j;
        for (j = 10; j < laser_points[i].num_points - 10; j++)
        {
            set_laser_point_color (laser_points[i].points[j].x, laser_points[i].points[j].y, laser_points[i].points[j].z - laser_points[i].car_position.z);
            glVertex3d (laser_points[i].points[j].x, laser_points[i].points[j].y, laser_points[i].points[j].z);
        }
    }

    glEnd ();
}