Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera crash ubuntu 22 gcc 9 5 #137

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions src/simulation/sensors/camera/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,37 +36,9 @@
/*! The constructor for the Camera module. It also sets some default values at its creation. */
Camera::Camera()
{
this->pointImageOut = NULL;

/*! Default values for the camera. */
this->cameraID = 1;
this->resolution[0] = 512;
this->resolution[1] = 512;
this->renderRate = (uint64_t) (60*1E9);
v3SetZero(this->cameraPos_B);
v3SetZero(this->sigma_CB);
this->cameraIsOn = 0;
this->filename = "";
this->fieldOfView = 0.7;
strcpy(this->skyBox, "black");
this->saveImages = 0;
this->saveDir = "";
this->postProcessingOn = 0;
this->ppAperture = 0;
this->ppFocalLength = 0;
this->ppFocusDistance = 0;
this->ppMaxBlurSize = 0;

/*! Default values for the perturbations. */
this->gaussian = 0;
this->darkCurrent = 0;
this->saltPepper = 0;
this->cosmicRays = 0;
this->blurParam = 0;
this->hsv = std::vector<double>{0., 0., 0.};
this->bgrPercent = std::vector<int>{0, 0, 0};

return;
Comment on lines -39 to -69
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely

}


Expand Down
53 changes: 26 additions & 27 deletions src/simulation/sensors/camera/camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,44 +52,43 @@ class Camera: public SysModel {
void AddCosmicRayBurst(const cv::Mat, cv::Mat &mDst, double);
void ApplyFilters(cv::Mat, cv::Mat &mDst, double gaussian, double darkCurrent, double saltPepper, double cosmicRays, double blurparam);
public:
std::string filename; //!< Filename for module to read an image directly
std::string filename{}; //!< Filename for module to read an image directly
ReadFunctor<CameraImageMsgPayload> imageInMsg; //!< camera image input message
Message<CameraImageMsgPayload> imageOutMsg; //!< camera image output message
Message<CameraConfigMsgPayload> cameraConfigOutMsg; //!< The name of the CameraConfigMsg output message
std::string saveDir; //!< The name of the directory to save images
uint64_t sensorTimeTag; //!< [ns] Current time tag for sensor out
int32_t saveImages; //!< [-] 1 to save images to file for debugging
std::string saveDir{}; //!< The name of the directory to save images
uint64_t sensorTimeTag{}; //!< [ns] Current time tag for sensor out
int32_t saveImages{}; //!< [-] 1 to save images to file for debugging

/*! Camera parameters */
int cameraIsOn; //!< [-] Is the camera currently taking images
int cameraID; //!< [-] Is the camera currently taking images
int resolution[2]; //!< [-] Camera resolution, width/height in pixels (pixelWidth/pixelHeight in Unity) in pixels
uint64_t renderRate; //!< [ns] Frame time interval at which to capture images in units of nanosecond
double fieldOfView; //!< [r] camera y-axis field of view edge-to-edge
double cameraPos_B[3]; //!< [m] Camera position in body frame
double sigma_CB[3]; //!< [-] MRP defining the orientation of the camera frame relative to the body frame
char skyBox[MAX_STRING_LENGTH]; //!< [-] name of skyboz in use
int postProcessingOn; //!< Enable post-processing of camera image. Value of 0 (protobuffer default) to use viz default which is off, -1 for false, 1 for true
double ppFocusDistance; //!< Distance to the point of focus, minimum value of 0.1, Value of 0 to turn off this parameter entirely.
double ppAperture; //!< Ratio of the aperture (known as f-stop or f-number). The smaller the value is, the shallower the depth of field is. Valid Setting Range: 0.05 to 32. Value of 0 to turn off this parameter entirely.
double ppFocalLength; //!< [m] Valid setting range: 0.001m to 0.3m. Value of 0 to turn off this parameter entirely.
int ppMaxBlurSize; //!< Convolution kernel size of the bokeh filter, which determines the maximum radius of bokeh. It also affects the performance (the larger the kernel is, the longer the GPU time is required). Depth textures Value of 1 for Small, 2 for Medium, 3 for Large, 4 for Extra Large. Value of 0 to turn off this parameter entirely.

char parentName[MAX_STRING_LENGTH]{}; //!< [-] Name of the parent body to which the camera should be attached
int cameraIsOn{}; //!< [-] Is the camera currently taking images
int cameraID{1}; //!< [-] Is the camera currently taking images
int resolution[2]{512, 512}; //!< [-] Camera resolution, width/height in pixels (pixelWidth/pixelHeight in Unity) in pixels
uint64_t renderRate{}; //!< [ns] Frame time interval at which to capture images in units of nanosecond
double fieldOfView{0.7}; //!< [r] camera y-axis field of view edge-to-edge
double cameraPos_B[3]{}; //!< [m] Camera position in body frame
double sigma_CB[3]{}; //!< [-] MRP defining the orientation of the camera frame relative to the body frame
char skyBox[MAX_STRING_LENGTH]{"black"}; //!< [-] name of skyboz in use
int postProcessingOn{}; //!< Enable post-processing of camera image. Value of 0 (protobuffer default) to use viz default which is off, -1 for false, 1 for true
double ppFocusDistance{}; //!< Distance to the point of focus, minimum value of 0.1, Value of 0 to turn off this parameter entirely.
double ppAperture{}; //!< Ratio of the aperture (known as f-stop or f-number). The smaller the value is, the shallower the depth of field is. Valid Setting Range: 0.05 to 32. Value of 0 to turn off this parameter entirely.
double ppFocalLength{}; //!< [m] Valid setting range: 0.001m to 0.3m. Value of 0 to turn off this parameter entirely.
int ppMaxBlurSize{}; //!< Convolution kernel size of the bokeh filter, which determines the maximum radius of bokeh. It also affects the performance (the larger the kernel is, the longer the GPU time is required). Depth textures Value of 1 for Small, 2 for Medium, 3 for Large, 4 for Extra Large. Value of 0 to turn off this parameter entirely.

/*! Noise paramters */
double gaussian; //!< Gaussian noise level
double darkCurrent; //!< Dark current intensity
double saltPepper; //!< Stuck and Dark pixels probability
double cosmicRays; //!< Random cosmic rays (number)
double blurParam; //!< Blur over image in pixels
std::vector<double> hsv; //!< (double) HSV color correction, H (-pi/pi) hue shift, S and V are percent multipliers
std::vector<int> bgrPercent; //!< (int) BGR color correction values as percent
double gaussian{}; //!< Gaussian noise level
double darkCurrent{}; //!< Dark current intensity
double saltPepper{}; //!< Stuck and Dark pixels probability
double cosmicRays{}; //!< Random cosmic rays (number)
double blurParam{}; //!< Blur over image in pixels
std::vector<double> hsv{}; //!< (double) HSV color correction, H (-pi/pi) hue shift, S and V are percent multipliers
std::vector<int> bgrPercent{}; //!< (int) BGR color correction values as percent

BSKLogger bskLogger; //!< -- BSK Logging
private:
uint64_t CurrentSimNanos;
void* pointImageOut; //!< void pointer for image memory passing
uint64_t CurrentSimNanos{};
void* pointImageOut{nullptr}; //!< void pointer for image memory passing
};

/* @} */
Expand Down