-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
37 lines (28 loc) · 1.02 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Explore self-driving car sensors by creating a 3D highway environment using PCL
#include "ukf/highway.h"
int main()
{
pcl::visualization::PCLVisualizer::Ptr viewer(new pcl::visualization::PCLVisualizer("3D Viewer"));
viewer->setBackgroundColor(0, 0, 0);
// set camera position and angle
viewer->initCameraParameters();
float x_pos = 0;
viewer->setCameraPosition(x_pos - 26, 0, 15.0, x_pos + 25, 0, 0, 0, 0, 1);
Highway highway(viewer);
//initHighway(viewer);
int frame_per_sec = 30;
int sec_interval = 10;
int frame_count = 0;
int time_us = 0;
double ego_velocity = 25;
while(frame_count < (frame_per_sec * sec_interval))
{
viewer->removeAllPointClouds();
viewer->removeAllShapes();
//stepHighway(egoVelocity,time_us, frame_per_sec, viewer);
highway.StepHighway(ego_velocity, time_us, frame_per_sec, viewer);
viewer->spinOnce(1000 / frame_per_sec);
frame_count++;
time_us = 1000000 * frame_count / frame_per_sec;
}
}