forked from microsoft/Azure_Kinect_ROS_Driver
-
Notifications
You must be signed in to change notification settings - Fork 1
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
DO NOT MERGE Azure Kinect Auto Tune Exposure Node #6
Open
ShannonPlusOne
wants to merge
497
commits into
plusone-robotics:plusone
Choose a base branch
from
ShannonPlusOne:plusone
base: plusone
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 250 commits
Commits
Show all changes
497 commits
Select commit
Hold shift + click to select a range
dde672a
corrected node handle name
ShannonPlusOne 8d9c689
remove mock image for now
ShannonPlusOne e4ad4ee
updated testing param names
ShannonPlusOne 3b44611
fixing makefile
ShannonPlusOne cd21522
update cmake to include when testing
ShannonPlusOne 0160db1
fixing makefile
ShannonPlusOne a1203a2
fixing make file
ShannonPlusOne 02e6d74
fixing cmake file
ShannonPlusOne c1e1798
added sanity prints
ShannonPlusOne a024a88
is ros too powerful when in control of time
ShannonPlusOne 5ba80d3
sanity checks
ShannonPlusOne 6481e25
like a record baby
ShannonPlusOne f4aa43c
initialize node with node handle
ShannonPlusOne 9690980
updated test params
ShannonPlusOne 2d3179e
added time limit
ShannonPlusOne 6b23828
refactoring node to check error codes
ShannonPlusOne 3604de3
updated test file
ShannonPlusOne 685daea
fixed return type in header file
ShannonPlusOne bee4c20
fixed variable typo
ShannonPlusOne cea37fd
blue check
ShannonPlusOne 9479f08
fixed variable typo, shortened test time out allowance
ShannonPlusOne 35ea7dd
fixed typos (rearranged arguments to be more uniform)
ShannonPlusOne 1bb15f1
fixing image transport
ShannonPlusOne 1c7edce
semicolons will be the end of me
ShannonPlusOne 5b92f05
added opencv requirement for testing
ShannonPlusOne 75c0417
updated testing requirements for catkin in cmake
ShannonPlusOne 33141d1
fixed cmake
ShannonPlusOne a00dd7a
fixing makefile
ShannonPlusOne 7e5fefa
fixed cmake
ShannonPlusOne f2021f1
pinpointing where error is coming from
ShannonPlusOne 68dff3c
fixing make file and test calls
ShannonPlusOne e336f32
fixed param typo
ShannonPlusOne 15377a5
pls build
ShannonPlusOne 1db6d7e
Merge pull request #6 from ShannonPlusOne/azure-tests
ShannonPlusOne c63eccb
removed original test file
ShannonPlusOne 531b059
target blue check
ShannonPlusOne 1dd2c7a
target blue in header file
ShannonPlusOne 2d67da8
target blue check tests
ShannonPlusOne f94f056
corrected assert true to assert false
ShannonPlusOne c2c77b8
added more tests, refactored error code calls
ShannonPlusOne 8ec9b87
updated header file
ShannonPlusOne 6120eff
updated calls, fixed parameter errors
ShannonPlusOne aebe065
missed semicolon
ShannonPlusOne b08afe4
refactoring exp bounds and blue value bounds
ShannonPlusOne 88e9fbb
fixed param typos
ShannonPlusOne da51f2a
fixed param typos
ShannonPlusOne bff5394
added custom dynamic reconfig back to tests
ShannonPlusOne 9c0bfa6
added exposure bounds test
ShannonPlusOne 310a516
fixed param typo
ShannonPlusOne ff6e306
blue bounds check
ShannonPlusOne e0ef477
fixed error code call typo
ShannonPlusOne 7b1a8bc
fixed typo
ShannonPlusOne f77bf42
fixed test_message typo for blue bound check
ShannonPlusOne a83ec7f
cleaned up tests
ShannonPlusOne 35f24a0
removed in progress code
ShannonPlusOne f125216
added empty image check
ShannonPlusOne c9a978c
corrected header file
ShannonPlusOne b1323a5
fixed mat param
ShannonPlusOne f768202
fixed pointer call
ShannonPlusOne df10b5c
cleaned up
ShannonPlusOne fe23cfe
fixed error code typo
ShannonPlusOne 6457b99
mock published images and dynamic reconfigured callback
ShannonPlusOne 11406fa
fixed test param typo
ShannonPlusOne f683c6e
Merge pull request #7 from ShannonPlusOne/azure-tests
ShannonPlusOne 04892ac
Update README.md
ShannonPlusOne 829f572
updated header file to #pragma once
ShannonPlusOne 7b364ec
added more thorough documentation, removed points2 code
ShannonPlusOne d25eb94
added default constructor/deconstructor back to appease catkin test
ShannonPlusOne 1f864e8
removed points header for now
ShannonPlusOne 662334a
fixed typo header file
ShannonPlusOne af46134
removed pseudo publisher from test file
ShannonPlusOne f26948a
added back mock image data
ShannonPlusOne 24f40b2
call constructor with node handle in test file
ShannonPlusOne 8ec7562
removed fake image publisher and mock dynamic reconfigure in test file
ShannonPlusOne 6f5979e
updated cmake, removed fake publisher in test
ShannonPlusOne 338e82d
added header file to library
ShannonPlusOne 61f111a
fixing cmake
ShannonPlusOne 0cd2ac1
fixing cmake, moving heavy libraries from h to cpp
ShannonPlusOne 9d0fd7d
added #include <opencv2/core/mat.hpp> to test file
ShannonPlusOne 6acad90
moved cv bridge h file back to node h file
ShannonPlusOne fe329ac
moved image transport
ShannonPlusOne f09d417
go back
ShannonPlusOne 8cef2ca
fixing cmake
ShannonPlusOne e48a1f4
image_transport.h is deprecated, using .hpp
ShannonPlusOne 41af02b
correcting header file path
ShannonPlusOne 2546047
wrong header file, hpp is ros2
ShannonPlusOne 411e9f4
updated cmake
ShannonPlusOne 5a0d512
removed ros init in test file
ShannonPlusOne ce34b51
updating package file
ShannonPlusOne 3ad31f1
adding ros init back to test file
ShannonPlusOne 71dfa43
moved image transport and opencv to cpp file
ShannonPlusOne 84ec608
declare k4acvimgptr in callback
ShannonPlusOne c9d9753
added opencv header back to node header
ShannonPlusOne e77e1fc
revert
ShannonPlusOne 0b71ce7
linking header file cmake
ShannonPlusOne 42c8deb
fixing cmake
ShannonPlusOne 7cfcec4
fixing cmake
ShannonPlusOne a021180
cmake
ShannonPlusOne 6523d46
fixing make file required
ShannonPlusOne 281c8fa
revert
ShannonPlusOne 8a8b5c3
removed portesting library
ShannonPlusOne da130e8
removed libraries
ShannonPlusOne f5b1730
fixing makefile
ShannonPlusOne 9fb1000
fixing cmake
ShannonPlusOne 6e1c513
include node for gtest
ShannonPlusOne 434b08b
multiple main, only include header file
ShannonPlusOne 5eb1c5a
fix makefile
ShannonPlusOne 3209e65
fixing makefile
ShannonPlusOne e596e1a
removed main from calibration node, added init to Microsoft node
ShannonPlusOne 7a7a367
typo
ShannonPlusOne e885bd0
revert
ShannonPlusOne 3fc142b
removed main from node
ShannonPlusOne 2799540
fdjkldlkjfaljkfdaldjfslj
ShannonPlusOne 90ce033
fixing header files, refactored node
ShannonPlusOne 1765264
rearranging cmake
ShannonPlusOne baab7f3
moved include
ShannonPlusOne c9efe40
fixing cmake
ShannonPlusOne c6d37f1
install lib
ShannonPlusOne dcd5de0
removed header files from cpp files
ShannonPlusOne 2b20ced
cleaned up and added por labels
ShannonPlusOne 5f9dec1
Merge pull request #8 from ShannonPlusOne/azure-polish
ShannonPlusOne e9f6082
changed int to unit32_t or uint8_t
ShannonPlusOne 25fdf16
updated int types to appropriate uint
ShannonPlusOne e86652a
corrected error code to int8_t (needs to be + and -)
ShannonPlusOne 2222117
consts
ShannonPlusOne d5b5711
added consistent _ to private members
ShannonPlusOne 2afab2c
fixed int type in msg
ShannonPlusOne 3714baf
fixed srv files
ShannonPlusOne 8780cd9
fixed srv files
ShannonPlusOne ed65238
updated srv to reflect const changes
ShannonPlusOne 7457abe
revert
ShannonPlusOne c53f906
revert
ShannonPlusOne c9b3f31
generate messages sooner
ShannonPlusOne d63bbd9
wrong order
ShannonPlusOne 05ae3fd
revert error code name
ShannonPlusOne 86a2655
cannot use consts in ros msg files, updated header and cpp to reflect
ShannonPlusOne 88cc2a2
ros pls
ShannonPlusOne 391a5cb
ros msg primitive type doesn't follow cpp types TIL
ShannonPlusOne a37f48e
appeasing catkin test default tors
ShannonPlusOne fcf552d
tors in cpp
ShannonPlusOne 6cf296c
fixed consts in utest
ShannonPlusOne a41aaf0
updated utest error codes to correct int8
ShannonPlusOne db7272b
by nature of uint8 blue vals can only be 0-255 therefore always in range
ShannonPlusOne 3423ecd
by using uint8 as the type for anything blue value related the variab…
ShannonPlusOne 73809e3
Merge pull request #9 from ShannonPlusOne/azure-polish2
ShannonPlusOne 559ca1a
added white balance reconfigure support
ShannonPlusOne de78261
updated header file with appropriate methods, fixed duplicate/incorre…
ShannonPlusOne bedec73
corrected test typos
ShannonPlusOne 418c65a
fixed test typos, calling exposure checks not wb checks
ShannonPlusOne 24e5811
Merge pull request #10 from ShannonPlusOne/azure-polish2
ShannonPlusOne 138d9e4
fleshed out white balance service
ShannonPlusOne 2fb3303
corrected includes in header file for new srv
ShannonPlusOne 021e0fb
renamed node for broader definition
ShannonPlusOne df0dffc
corrected test file with updated naming convention
ShannonPlusOne 8adc00c
added sgd algorithm for exposure/white balance tuning
ShannonPlusOne 6c50e38
updated service with appropriate var types
ShannonPlusOne b394182
fixed brackets typo
ShannonPlusOne f4512f3
added sgd tune srv file to cmake
ShannonPlusOne 6850ba3
fixed msg float type to float32
ShannonPlusOne b679d4f
fixed type typo in header
ShannonPlusOne c900fc1
corrected string formatting for double
ShannonPlusOne 844d2fd
corrected cv color convert for hls
ShannonPlusOne 30438e6
corrected opencv calls for hls image conversion
ShannonPlusOne 1930dbf
testing starting from minimum exposure and minimum white balance
ShannonPlusOne 5f4f834
added bound checks for sgd
ShannonPlusOne ff8c8ff
added info messages for current errors/avgs
ShannonPlusOne 967c568
updated sgd
ShannonPlusOne be0f311
exposure bgr, white balance white
ShannonPlusOne 7b1718f
was exiting loop early due to typo, oops
ShannonPlusOne 7327676
added rmse
ShannonPlusOne 0e66c6e
starting at default exposure, fixed normal dist to be 0-1
ShannonPlusOne 7b1880d
normal dist -1 to 1
ShannonPlusOne 29ff7a6
changing learning rate
ShannonPlusOne 3b62bc5
starting from min camera params
ShannonPlusOne 2966b4a
updating exposure settings through pointers
ShannonPlusOne 73da0db
updated errors
ShannonPlusOne 2dc1c93
updated header file for updated rmse
ShannonPlusOne 2516763
starting at default values
ShannonPlusOne 51f05a6
added random dis back
ShannonPlusOne 67c8751
reduced num iterations
ShannonPlusOne 704dfe2
pointers
ShannonPlusOne 77b90f1
subtract for updates
ShannonPlusOne 0789bb0
removed normal dis
ShannonPlusOne f17d6be
testing one param at a time
ShannonPlusOne df9241f
updated rgbcallback to update hls image
ShannonPlusOne 0ec4304
removed mutex lock for image conversion in rgb callback
ShannonPlusOne a40ae03
added normal distribution back
ShannonPlusOne f5ab56c
added exposure calculations back in
ShannonPlusOne 750f3ac
updated exposure info to only allow for actual exposure options for K…
ShannonPlusOne 6247cba
corrected array init, updated update exposure to check closest value …
ShannonPlusOne a6bf068
updated update exposure with checks for closest exp
ShannonPlusOne 1ba937c
fixed typo
ShannonPlusOne 0beaa8a
appeasing abs gods
ShannonPlusOne b834eb9
added break statements
ShannonPlusOne fecb776
made separate exposure conversion function
ShannonPlusOne 7a7cf75
added testing for kinect exposure standardization
ShannonPlusOne 5abeee3
gave tests own array
ShannonPlusOne bb8f378
fixed typo in test file
ShannonPlusOne 57d4ab7
fixing uint32 weirdness
ShannonPlusOne e8c9f52
what is happening
ShannonPlusOne 4b1b9a5
trying to fix incorrect num comparisons
ShannonPlusOne 49a9f9f
do the other tests that large fail?
ShannonPlusOne c8ee50f
corrected typo in loop (facepalm)
ShannonPlusOne 82703ab
cleaning up auto tune
ShannonPlusOne 01a7bbc
fixed typo re added color channels dec
ShannonPlusOne 654e5fd
fixed typo
ShannonPlusOne c18fad8
standardize exposure in sgd
ShannonPlusOne eef5de0
normal dis for exp
ShannonPlusOne 7d5783a
we're gonna break it, learning rate 100
ShannonPlusOne 94516c3
ok 100 was too much how about 10
ShannonPlusOne 41e96a1
updated learning rate
ShannonPlusOne cd6c413
updated error calculations
ShannonPlusOne 0387323
updated sgd error calculations
ShannonPlusOne 8bfc5e7
removed prediction/cost/gradient functions for now
ShannonPlusOne 1d148a7
updated error calculations
ShannonPlusOne 77d3dc7
updated sgd service for better readability
ShannonPlusOne ddb2a57
updated header file for updated sgd tune params
ShannonPlusOne 146c066
updated rmse
ShannonPlusOne 267cba2
corrected param order
ShannonPlusOne 5dfb703
added check for div by 0
ShannonPlusOne dbd1238
fixed rmse calculation
ShannonPlusOne 1eca6bc
iterations need to be float or else all rmse will be 0
ShannonPlusOne a46fdb2
updated rmse, using vectors to calculate correctly
ShannonPlusOne c9d65eb
fixed include for vector
ShannonPlusOne 5b6dcd4
fixed vectors
ShannonPlusOne 765bde2
exposure isn't changing at all
ShannonPlusOne 86c61c0
normal dist
ShannonPlusOne 8793829
include random
ShannonPlusOne e96852e
updated iterations (rmse vector getting too large)
ShannonPlusOne fae3e5f
added all bgrw error to both metrics
ShannonPlusOne d8300cb
exposure time is making no changes
ShannonPlusOne 5095b0f
updating exposure changes
ShannonPlusOne ba39df5
updating error calculations
ShannonPlusOne 4dc3e60
normalizing white rmse 0-1 to use index for exposure setting
ShannonPlusOne 059577e
fixed typos
ShannonPlusOne 6744af6
revert
ShannonPlusOne 41a1456
updated exposure update calc
ShannonPlusOne cd5491b
sanity print out for final blue value
ShannonPlusOne 7277747
standardizing input for rmse
ShannonPlusOne 0104dde
fixed typo
ShannonPlusOne 778ace7
fixed typo on param list
ShannonPlusOne 719f1fa
update header file
ShannonPlusOne b5b7544
updated for demo
ShannonPlusOne d409e5f
Merge pull request #11 from ShannonPlusOne/azure-polish2
ShannonPlusOne 9e8319e
Update k4a_por_calibration.h
ShannonPlusOne 4dbd513
Update k4a_por_calibration.cpp
ShannonPlusOne 4bb071d
Update k4a_por_calibration.h
ShannonPlusOne 35047a2
Update CMakeLists.txt
ShannonPlusOne 19b7a33
Update CMakeLists.txt
ShannonPlusOne d8d54fc
Add files via upload
ShannonPlusOne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
158 changes: 158 additions & 0 deletions
158
include/azure_kinect_ros_driver/k4a_exposure_calibration.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
// PlusOne Robotics | ||
// Author: Shannon Stoehr | ||
// email: [email protected] | ||
|
||
#pragma once | ||
|
||
// Library headers | ||
#include <ros/ros.h> | ||
#include <sensor_msgs/Image.h> | ||
#include <image_transport/image_transport.h> | ||
#include <cv_bridge/cv_bridge.h> | ||
#include <opencv2/opencv.hpp> | ||
#include <dynamic_reconfigure/client.h> | ||
#include <k4a/k4a.h> | ||
#include <mutex> | ||
|
||
// Project headers | ||
#include "azure_kinect_ros_driver/AzureKinectParamsConfig.h" | ||
#include "azure_kinect_ros_driver/k4a_update_exposure.h" | ||
#include "azure_kinect_ros_driver/k4a_auto_tune_exposure.h" | ||
#include "azure_kinect_ros_driver/k4aCameraExposureServiceErrorCode.h" | ||
|
||
/** | ||
* @brief Class that allows the user to tune exposure in real time from the command line | ||
*/ | ||
class K4AExposureCalibration | ||
{ | ||
public: | ||
/** @brief default constructor and destructor*/ | ||
K4AExposureCalibration(); | ||
~K4AExposureCalibration(); | ||
|
||
/** | ||
* @brief initializes calibrator with a provided node handle | ||
* @details Subscribes the node to /rgb/raw/image. | ||
* Advertises the k4a_update_exposure service and the k4a_auto_tune_exposure service. | ||
* @param[in] nh ROS node handle | ||
*/ | ||
K4AExposureCalibration(ros::NodeHandle& nh); | ||
ShannonPlusOne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/** | ||
* @brief call k4a_nodelet_manager/set_parameters to update exposure value | ||
* @param[in] req_exposure new exposure | ||
* @param[out] error_code error code included in response | ||
* @param[out] res_msg human-readable error message included in response | ||
* @return true if exposure is successfully updated | ||
*/ | ||
bool k4aUpdateExposure(int req_exposure, int& error_code, std::string& res_msg); | ||
ShannonPlusOne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/** | ||
* @brief auto tune exposure with given target blue value | ||
* @param[in] target_blue_value requested blue value to tune exposure to | ||
* @param[out] final_exposure exposure camera is set to after call | ||
* @param[out] error_code error code included in response | ||
* @param[out] res_msg human-readable error message included in response | ||
* @return true if auto tuning exposure is successfully completed | ||
*/ | ||
bool k4aAutoTuneExposure(int target_blue_value, int& final_exposure, int& error_code, std::string& res_msg); | ||
ShannonPlusOne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/** | ||
* @brief check if dynamic_reconfigure response has correctly updated exposure | ||
* @param[in] requested_exposure exposure originally requested in k4aUpdateExposure | ||
* @param[out] updated_exposure exposure that was returned by the dynamic_reconfigure call | ||
* @param[out] error_code error code included in response | ||
* @param[out] res_msg human-readable error message included in response | ||
* @return true if requested_exposure == updated_exposure | ||
*/ | ||
bool k4aCameraExposureUpdateCheck(int requested_exposure, int updated_exposure, int& error_code, std::string& res_msg); | ||
ShannonPlusOne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/** | ||
* @brief check if requested_exposure is in appropriate bounds | ||
* @param[in] requested_exposure exposure originally requested in k4aUpdateExposure | ||
* @param[out] updated_exposure exposure that was returned by the dynamic_reconfigure call | ||
ShannonPlusOne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* @param[out] error_code error code included in response | ||
* @param[out] res_msg human-readable error message included in response | ||
* @return true if requested_exposure == updated_exposure | ||
*/ | ||
bool k4aCameraExposureBoundsCheck(int requested_exposure, int& error_code, std::string& res_msg); | ||
ShannonPlusOne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/** | ||
* @brief check if target_blue_value has been achieved | ||
* @details When conducting the auto tune loop, this method compares the average blue | ||
* value of the image at a particular exposure to the desired target average | ||
* blue value provided by the user in k4aAutoTuneExposure | ||
* @param[in] target_blue_val target blue value originally requested in k4aAutoTuneExposure | ||
* @param[in] current_average_blue_value the average blue value of the image at a point in time | ||
* @param[out] error_code error code included in response | ||
* @param[out] res_msg human-readable error message included in response | ||
*/ | ||
bool k4aTargetBlueCheck(int target_blue_val, int current_avg_blue_value, int& error_code, std::string& res_msg); | ||
|
||
/** | ||
* @brief check if target_blue_value is in appropriate range | ||
* @param[in] target_blue_value target blue value originally requested in k4aAutoTuneExposure | ||
* @param[out] error_code error code included in response | ||
* @param[out] res_msg human-readable error message included in response | ||
*/ | ||
bool k4aBlueBoundsCheck(int target_blue_value, int& error_code, std::string& res_msg); | ||
|
||
/** | ||
* @brief did the node receive an image at all? | ||
* @param[in] mat current OpenCV mat stored in latest_k4a_image for k4aAutoTuneExposure loop | ||
* @param[out] error_code error code included in response | ||
* @param[out] res_msg human-readable error message included in response | ||
*/ | ||
bool k4aImagePopulatedCheck(cv::Mat& mat, int& error_code, std::string& res_msg); | ||
|
||
private: | ||
/** | ||
* @brief callback for /rgb/raw/image subscription | ||
* @details This callback handles updating the current image for the node. | ||
* It converts the ROS image message to an OpenCV mat for auto tuning calculations. | ||
* @param[out] msg message received from image transport subscriber subscribed to /rgb/raw/image | ||
ShannonPlusOne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
*/ | ||
void rgbRawImageCallback(const sensor_msgs::ImageConstPtr& msg); | ||
|
||
/** | ||
* @brief callback for k4aUpdateExposure | ||
* @details This callback handles requests to update the camera exposure from the | ||
* k4a_update_exposure service. | ||
* @param[in] req request received from calling k4a_update_exposure | ||
* @param[out] res response sent from k4a_update_exposure | ||
*/ | ||
bool k4aUpdateExposureCallback(azure_kinect_ros_driver::k4a_update_exposure::Request &req, | ||
azure_kinect_ros_driver::k4a_update_exposure::Response &res); | ||
|
||
/** | ||
* @brief callback for k4aAutoTuneExposure | ||
* @details This callback handles requests to update the camera exposure from the | ||
* k4a_auto_tune_exposure service. | ||
* @param[in] req request received from calling k4a_auto_tune_exposure | ||
* @param[out] res response sent from k4a_auto_tune_exposure | ||
*/ | ||
bool k4aAutoTuneExposureCallback(azure_kinect_ros_driver::k4a_auto_tune_exposure::Request &req, | ||
azure_kinect_ros_driver::k4a_auto_tune_exposure::Response &res); | ||
|
||
// private members | ||
ros::NodeHandle nh_; | ||
image_transport::Subscriber subRGBRaw; | ||
ShannonPlusOne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ros::ServiceServer update_exposure_service; | ||
ros::ServiceServer auto_tune_exposure_service; | ||
|
||
// allocate memory space to store latest image | ||
cv::Mat latest_k4a_image; /** @brief latest image*/ | ||
cv::Mat* const latest_k4a_image_ptr = &latest_k4a_image; /** @brief pointer to latest image*/ | ||
ShannonPlusOne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cv_bridge::CvImageConstPtr k4aCvImagePtr; /** @brief pointer to convert ROS image to OpenCV mat*/ | ||
std::mutex latest_k4a_image_mutex; /** @brief mutex to protect latest image*/ | ||
azure_kinect_ros_driver::k4aCameraExposureServiceErrorCode k4a_error_code; /** @brief error codes*/ | ||
|
||
// config file info | ||
// TODO: PULL THESE VALUES FROM CONFIG FILE "azure_kinect_ros_driver/AzureKinectParamsConfig.h" | ||
const int MIN_EXPOSURE = 488; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use uint32_t or uint64_t instead of int. Make it unsigned and either 32 bit or 64 bit. Up to you. |
||
const int MAX_EXPOSURE = 1000000; | ||
const int DEFAULT_EXPOSURE = 15625; | ||
const int EXPOSURE_INC = 250; | ||
const int MIN_BLUE = 0; | ||
const int MAX_BLUE = 255; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Overall successful exposure calibration | ||
int8 SUCCESS = 1 | ||
|
||
# Failure to call service '/set_parameters' | ||
int8 CAMERA_EXPOSURE_SET_FAILURE = -1 | ||
|
||
# Failure to receive Image from callback | ||
int8 IMAGE_NOT_RECEIVED_FAILURE = -2 | ||
|
||
# Requested camera exposure is out of bounds Failure | ||
ShannonPlusOne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
int8 REQUESTED_CAMERA_EXPOSURE_OUT_OF_BOUNDS_FAILURE = -3 | ||
|
||
# Requested camera blue value is out of bounds Failure | ||
int8 REQUESTED_CAMERA_BLUE_VALUE_OUT_OF_BOUNDS_FAILURE = -4 | ||
|
||
# Requested camera blue value hasn't been achieved yet | ||
int8 REQUESTED_CAMERA_BLUE_VALUE_NOT_MET = -5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd remove the default constructor so as not to allow it. It doesn't make much sense without a NodeHandle anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, unfortunately for now these are required in order for the current catkin testing setup to work.