I downloaded the Astra SDK for mac and was going through the tutorials for HelloWorld. But when I run g++ main.cpp, it tells me:
main.cpp:8:10: fatal error: ‘astra/astra.hpp’ file not found
Where should I be putting this file for the Hello World? Are there any issues with this code?
Here is my code so far
#include < astra/astra.hpp> //ignore space after the < it won’t appear without the space here
#include < cstdio>
#include < iostream>
using namespace std;
int main(int argc, char** argv)
{
astra::initialize(); //initialize ASTRA
//connecting to the Astra
{
//talking to the Astra sensor, connecting to the first available Astra sensor
astra::StreamSet streamset;
//access the stream of the Astra
astra::StreamReader reader = streamSet.create_reader();
//start the depth stream using StreamReader, the depth stream gives of anything the camera sees in pixels
reader.stream<astra::DepthStream>().start();
//grabs a frame from the StreamReader
astra::Frame frame = reader.get_latest_frame();
//gets the depth frame data from the frame
const auto depthFrame = frame.get<astra::DepthFrame>();
//print info from the frame
const int frameIndex = depthFrame.frame_index();
const short pixelValue = depthFrame.data()[0];
cout<<std::endl
<< "Depth frameIndex: " << frameIndex
<< " pixelValue " << pixelValue
<< endl
<< endl
}
astra::terminate(); //terminate Astra
cout << "hit enter to to exit program" << endl;
std::cin.get();
return 0;
}