Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
f7686a9
Add K4A_RESULT_UNSUPPORTED to result enums.
AntonClaytonBursch Nov 6, 2020
70eaf43
Structs for device, color, depth. Enum for calibration. Functions to …
AntonClaytonBursch Nov 11, 2020
143cd46
Updates examples, src, tests and tools to use new config and color an…
AntonClaytonBursch Nov 11, 2020
7496015
Added fps mode structs and functions.
AntonClaytonBursch Nov 11, 2020
163d176
Updated code to reflect change to using fps mode.
AntonClaytonBursch Nov 11, 2020
bdb2ed3
Moded color, depth and fps enums from k4a/k4atypes.h to k4ainternal/m…
AntonClaytonBursch Nov 13, 2020
dc0db6b
Updated c++ wrapper to use new color and depth modes.
AntonClaytonBursch Nov 17, 2020
b7de2fb
Updated C++ wrapper with get device, depth, color and fps functions. …
AntonClaytonBursch Nov 17, 2020
f9dda0a
Update k4arecord/types.h and examples to use color, depth and fps mod…
AntonClaytonBursch Nov 19, 2020
051f8eb
added depth range to k4a_depth_mode_info, updated get color/depth/fps…
AntonClaytonBursch Nov 23, 2020
14ccb08
Update k4astaticimageproperties.h to use k4a.hpp instead of k4a.h
AntonClaytonBursch Nov 23, 2020
4bc4c00
Quick fix: forgot to add K4A_EXPORT to get mode and mode count functi…
AntonClaytonBursch Nov 23, 2020
e3d04a3
examples, tests, tools refactored to use new get mode functions
AntonClaytonBursch Nov 30, 2020
9ceb3e1
quick comments fix in calibration example and updates to color_ft tes…
AntonClaytonBursch Dec 3, 2020
b5b3806
Changed get modes loops for fps, color and depth.
AntonClaytonBursch Dec 9, 2020
33c964f
Viewer mode selection from radio to comboboxes
AntonClaytonBursch Dec 17, 2020
fcac45f
using mode info types instead of mode info type index
AntonClaytonBursch Dec 30, 2020
eed589a
refactor to use mode info instead of mode id
AntonClaytonBursch Dec 31, 2020
fc655bd
using depth/color/fps mode info instead of mode id
AntonClaytonBursch Jan 4, 2021
a85ed66
mode id changes and GUI cleanup
AntonClaytonBursch Jan 5, 2021
9c97825
revert back from using device mode info to device mode id for fps/col…
AntonClaytonBursch Jan 11, 2021
a488ed1
Use constants defined in usb_cmd_priv.h to set the vendor id and devi…
AntonClaytonBursch Jan 13, 2021
0289b22
Used const for color/depth/fps mode info initializers.
AntonClaytonBursch Jan 14, 2021
01893b2
Passing depth mode info down to point cloud viewer. Moved static k4a…
AntonClaytonBursch Jan 19, 2021
a1b772d
color, depth and fps mode infos saved in and parsed from recordings
AntonClaytonBursch Jan 20, 2021
158b641
Initialize the size and version of the mode structs
AntonClaytonBursch Jan 22, 2021
66bc1e5
Moved K4A_MSFT_VID, K4A_RGB_PID and K4A_DEPTH_PID to usbcommand.h. A…
AntonClaytonBursch Jan 22, 2021
2a70cd1
error handling for saving modes and device info in recording
AntonClaytonBursch Jan 22, 2021
5f99801
color, depth, fps mode info and device info saved in and parse from r…
AntonClaytonBursch Jan 22, 2021
af6d217
Fixing K4A build errors in src/record/internal/matroska_read.cpp abou…
JonathanESantos Jan 26, 2021
c541fde
SDK: docstring changes for Doxygen to run without errors.
JonathanESantos Jan 26, 2021
7a7854a
Merge pull request #1 from AntonClaytonBursch/user/jonsanto/Bug5456_F…
AntonClaytonBursch Jan 26, 2021
8f573d2
Merge pull request #2 from AntonClaytonBursch/user/jonsanto/Story5373…
AntonClaytonBursch Jan 26, 2021
e8fe464
K4A API: Adding to docstrings that functions may return status of UNS…
JonathanESantos Jan 26, 2021
d592958
linked k4a_math in viewer
AntonClaytonBursch Jan 26, 2021
5d51a26
Recording description from mode info saved in recording (or legacy de…
AntonClaytonBursch Jan 26, 2021
e3bfdb2
Merge pull request #3 from AntonClaytonBursch/user/jonsanto/Task5460_…
AntonClaytonBursch Jan 26, 2021
81b9de6
Use modes for k4arecorder
AntonClaytonBursch Jan 27, 2021
7a91853
Recorder mode option listed.
AntonClaytonBursch Jan 27, 2021
1bc8889
Merge branch 'api-update' of https://github.com/AntonClaytonBursch/Az…
AntonClaytonBursch Jan 27, 2021
162a016
k4aviewer: Removing audio support. To turn on audio support, in tools…
JonathanESantos Jan 27, 2021
1ccc23f
k4aviewer: Removing support for audio and clangformat wants to format…
JonathanESantos Jan 27, 2021
a828c1e
working on recorder command line validation
AntonClaytonBursch Jan 27, 2021
5be389d
Merge branch 'api-update' into user/jonsanto/Task5467_RemoveSupportFo…
JonathanESantos Jan 27, 2021
46e53da
k4arecorder: Minor editing.
JonathanESantos Jan 27, 2021
b493720
k4a: Adding functional tests for calling the added functions in k4a.h.
JonathanESantos Jan 28, 2021
b32f3ac
Removing commented-out code.
JonathanESantos Jan 28, 2021
6d28e16
k4a: Fixing a test in depth_ft.
JonathanESantos Jan 28, 2021
e8c0f22
Update main.cpp
JonathanESantos Jan 28, 2021
c7279c3
Update main.cpp
JonathanESantos Jan 28, 2021
da96ffc
Update main.cpp
JonathanESantos Jan 28, 2021
235ba8f
Update main.cpp
JonathanESantos Jan 28, 2021
8d2a3b1
Update main.cpp
JonathanESantos Jan 28, 2021
fa07ae8
Merge pull request #5 from AntonClaytonBursch/user/jonsanto/Task5466_…
AntonClaytonBursch Jan 28, 2021
df3b755
validate recorder cmd options
AntonClaytonBursch Jan 28, 2021
f82b42d
finished validating recording cmd options
AntonClaytonBursch Jan 28, 2021
1166777
Fixed get fps mode in recorder.
AntonClaytonBursch Jan 28, 2021
bab38b8
Merge branch 'api-update' into user/jonsanto/Task5467_RemoveSupportFo…
AntonClaytonBursch Jan 28, 2021
d9f616d
Merge pull request #4 from AntonClaytonBursch/user/jonsanto/Task5467_…
AntonClaytonBursch Jan 28, 2021
a5f6512
Fix broken Linux build.
JonathanESantos Jan 29, 2021
b4df263
k4a: ninja clangformat made these formatting changes.
JonathanESantos Jan 29, 2021
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
Prev Previous commit
Next Next commit
Fixing K4A build errors in src/record/internal/matroska_read.cpp abou…
…t not being able to convert from float to enum, and in tools/k4aviewer/k4arecordingdockcontrol.cpp about mismatched signed/unsigned comparison.

The rest of the changes are formatting enforced by clang with the command line command "ninja clangformat". The command line build enforces this step before building.

Fixed Bug 5456.
  • Loading branch information
JonathanESantos committed Jan 26, 2021
commit af6d21799cedb7539d69e201bd87563fc13758f1
4 changes: 2 additions & 2 deletions examples/fastpointcloud/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ int main(int argc, char **argv)
goto Exit;
}

config.depth_mode_id = 3;// K4A_DEPTH_MODE_WFOV_2X2BINNED
config.fps_mode_id = 2;// K4A_FRAMES_PER_SECOND_30
config.depth_mode_id = 3; // K4A_DEPTH_MODE_WFOV_2X2BINNED
config.fps_mode_id = 2; // K4A_FRAMES_PER_SECOND_30

k4a_calibration_t calibration;
if (K4A_RESULT_SUCCEEDED !=
Expand Down
2 changes: 1 addition & 1 deletion examples/green_screen/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ static k4a_device_configuration_t get_default_config()
camera_config.color_mode_id = 1; // K4A_COLOR_RESOLUTION_720P
camera_config.depth_mode_id = 4; // K4A_DEPTH_MODE_WFOV_UNBINNED // No need for depth during calibration
camera_config.fps_mode_id = 1; // K4A_FRAMES_PER_SECOND_15 // Don't use all USB bandwidth
camera_config.subordinate_delay_off_master_usec = 0; // Must be zero for master
camera_config.subordinate_delay_off_master_usec = 0; // Must be zero for master
camera_config.synchronized_images_only = true;
return camera_config;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/k4arecord_custom_track/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int main(int argc, char **argv)
k4a_device_get_fps_mode(device, 2, &fps_mode_info); // K4A_FRAMES_PER_SECOND_30

k4a_device_configuration_t device_config = K4A_DEVICE_CONFIG_INIT_DISABLE_ALL;
device_config.depth_mode_id = depth_mode_info.mode_id;
device_config.depth_mode_id = depth_mode_info.mode_id;
device_config.fps_mode_id = fps_mode_info.mode_id;

VERIFY(k4a_device_start_cameras(device, &device_config));
Expand Down
2 changes: 1 addition & 1 deletion examples/streaming/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int main(int argc, char **argv)

k4a_device_configuration_t config = K4A_DEVICE_CONFIG_INIT_DISABLE_ALL;
config.color_format = K4A_IMAGE_FORMAT_COLOR_MJPG;
config.color_mode_id = color_mode_info.mode_id;
config.color_mode_id = color_mode_info.mode_id;
config.depth_mode_id = depth_mode_info.mode_id;
config.fps_mode_id = fps_mode_info.mode_id;

Expand Down
6 changes: 3 additions & 3 deletions examples/transformation/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ static int capture(std::string output_dir, uint8_t deviceId = K4A_DEVICE_DEFAULT
}

config.color_format = K4A_IMAGE_FORMAT_COLOR_BGRA32;
config.color_mode_id = 1; // K4A_COLOR_RESOLUTION_720P
config.depth_mode_id = 2; // K4A_DEPTH_MODE_NFOV_UNBINNED
config.fps_mode_id = 2; // K4A_FRAMES_PER_SECOND_30
config.color_mode_id = 1; // K4A_COLOR_RESOLUTION_720P
config.depth_mode_id = 2; // K4A_DEPTH_MODE_NFOV_UNBINNED
config.fps_mode_id = 2; // K4A_FRAMES_PER_SECOND_30
config.synchronized_images_only = true; // ensures that depth and color images are both available in the capture

k4a_calibration_t calibration;
Expand Down
4 changes: 2 additions & 2 deletions examples/undistort/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@ int main(int argc, char **argv)
goto Exit;
}

config.depth_mode_id = 3;// K4A_DEPTH_MODE_WFOV_2X2BINNED
config.fps_mode_id = 2;// K4A_FRAMES_PER_SECOND_30
config.depth_mode_id = 3; // K4A_DEPTH_MODE_WFOV_2X2BINNED
config.fps_mode_id = 2; // K4A_FRAMES_PER_SECOND_30

k4a_calibration_t calibration;
if (K4A_RESULT_SUCCEEDED !=
Expand Down
3 changes: 1 addition & 2 deletions examples/viewer/opengl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ int main()
//
ColorizeDepthImage(depthImage,
K4ADepthPixelColorizer::ColorizeBlueToRed,
{ (uint16_t)depth_mode_info.min_range,
(uint16_t)depth_mode_info.max_range },
{ (uint16_t)depth_mode_info.min_range, (uint16_t)depth_mode_info.max_range },
&depthTextureBuffer);
depthTexture.Update(&depthTextureBuffer[0]);

Expand Down
1 change: 0 additions & 1 deletion include/k4a/k4a.h
Original file line number Diff line number Diff line change
Expand Up @@ -2291,7 +2291,6 @@ K4A_EXPORT k4a_result_t k4a_device_get_fps_mode(k4a_device_t device_handle,
int mode_index,
k4a_fps_mode_info_t *mode_info);


/**
* @}
*/
Expand Down
40 changes: 16 additions & 24 deletions include/k4a/k4a.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -764,17 +764,12 @@ struct calibration : public k4a_calibration_t
*
* \sa k4a_calibration_get_from_raw
*/
static calibration get_from_raw(char *raw_calibration,
size_t raw_calibration_size,
uint32_t depth_mode_id,
uint32_t color_mode_id)
static calibration
get_from_raw(char *raw_calibration, size_t raw_calibration_size, uint32_t depth_mode_id, uint32_t color_mode_id)
{
calibration calib;
k4a_result_t result = k4a_calibration_get_from_raw(raw_calibration,
raw_calibration_size,
depth_mode_id,
color_mode_id,
&calib);
k4a_result_t result =
k4a_calibration_get_from_raw(raw_calibration, raw_calibration_size, depth_mode_id, color_mode_id, &calib);

if (K4A_RESULT_SUCCEEDED != result)
{
Expand All @@ -788,10 +783,8 @@ struct calibration : public k4a_calibration_t
*
* \sa k4a_calibration_get_from_raw
*/
static calibration get_from_raw(uint8_t *raw_calibration,
size_t raw_calibration_size,
uint32_t depth_mode_id,
uint32_t color_mode_id)
static calibration
get_from_raw(uint8_t *raw_calibration, size_t raw_calibration_size, uint32_t depth_mode_id, uint32_t color_mode_id)
{
return get_from_raw(reinterpret_cast<char *>(raw_calibration),
raw_calibration_size,
Expand Down Expand Up @@ -1449,16 +1442,15 @@ class device
return k4a_device_get_installed_count();
}


// TODO: add comments
k4a_device_info_t get_info()
{
K4A_INIT_STRUCT(k4a_device_info_t, info);
k4a_device_get_info(m_handle, &info);

return info;
}
}

// TODO: add comments
std::vector<k4a_color_mode_info_t> get_color_modes()
{
Expand All @@ -1480,8 +1472,8 @@ class device
}

return modes;
}
}

// TODO: add comments
k4a_color_mode_info_t get_color_mode(int color_mode_id)
{
Expand All @@ -1501,8 +1493,8 @@ class device
}

return mode;
}
}

// TODO: add comments
std::vector<k4a_depth_mode_info_t> get_depth_modes()
{
Expand All @@ -1522,7 +1514,7 @@ class device
}
}
}

return modes;
}

Expand All @@ -1545,7 +1537,7 @@ class device
}

return mode;
}
}

// TODO: add comments
std::vector<k4a_fps_mode_info_t> get_fps_modes()
Expand Down Expand Up @@ -1589,10 +1581,10 @@ class device
}

return mode;
}
}

// TODO: add comments
int get_common_factor(int width, int height)
int get_common_factor(int width, int height)
{
return (height == 0) ? width : get_common_factor(height, width % height);
}
Expand Down
12 changes: 5 additions & 7 deletions include/k4a/k4atypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,11 @@ K4A_DECLARE_HANDLE(k4a_image_t);
K4A_DECLARE_HANDLE(k4a_transformation_t);

// TODO: comment
#define K4A_INIT_STRUCT(T, S) \
T S{}; \
S.struct_size = sizeof(T); \
#define K4A_INIT_STRUCT(T, S) \
T S{}; \
S.struct_size = sizeof(T); \
S.struct_version = K4A_ABI_VERSION;


// TODO: comment
#define K4A_ABI_VERSION 1

Expand Down Expand Up @@ -1254,9 +1253,8 @@ typedef struct _k4a_imu_sample_t
* </requirements>
* \endxmlonly
*/
static const k4a_device_configuration_t K4A_DEVICE_CONFIG_INIT_DISABLE_ALL = {
K4A_IMAGE_FORMAT_COLOR_MJPG, 0, 0, 2, false, 0, K4A_WIRED_SYNC_MODE_STANDALONE, 0, false
};
static const k4a_device_configuration_t K4A_DEVICE_CONFIG_INIT_DISABLE_ALL =
{ K4A_IMAGE_FORMAT_COLOR_MJPG, 0, 0, 2, false, 0, K4A_WIRED_SYNC_MODE_STANDALONE, 0, false };

/**
* @}
Expand Down
6 changes: 2 additions & 4 deletions include/k4ainternal/matroska_read.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
namespace k4arecord
{
// The depth mode string for legacy recordings
static const std::pair<k4a_depth_mode_t, std::string> legacy_depth_modes[] = {
{ K4A_DEPTH_MODE_NFOV_2X2BINNED, "NFOV_2x2BINNED" },
{ K4A_DEPTH_MODE_WFOV_2X2BINNED, "WFOV_2x2BINNED" }
};
static const std::pair<k4a_depth_mode_t, std::string> legacy_depth_modes[] =
{ { K4A_DEPTH_MODE_NFOV_2X2BINNED, "NFOV_2x2BINNED" }, { K4A_DEPTH_MODE_WFOV_2X2BINNED, "WFOV_2x2BINNED" } };

typedef struct _cluster_info_t
{
Expand Down
8 changes: 5 additions & 3 deletions src/dewrapper/dewrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ static k4a_result_t depth_engine_start_helper(dewrapper_context_t *dewrapper,
int *depth_engine_max_compute_time_ms,
size_t *depth_engine_output_buffer_size)
{
RETURN_VALUE_IF_ARG(K4A_RESULT_FAILED, fps_mode_id < K4A_FRAMES_PER_SECOND_5 || fps_mode_id > K4A_FRAMES_PER_SECOND_30);
RETURN_VALUE_IF_ARG(K4A_RESULT_FAILED, depth_mode_id <= K4A_DEPTH_MODE_OFF || depth_mode_id > K4A_DEPTH_MODE_PASSIVE_IR);
RETURN_VALUE_IF_ARG(K4A_RESULT_FAILED,
fps_mode_id < K4A_FRAMES_PER_SECOND_5 || fps_mode_id > K4A_FRAMES_PER_SECOND_30);
RETURN_VALUE_IF_ARG(K4A_RESULT_FAILED,
depth_mode_id <= K4A_DEPTH_MODE_OFF || depth_mode_id > K4A_DEPTH_MODE_PASSIVE_IR);
k4a_result_t result = K4A_RESULT_SUCCEEDED;

assert(dewrapper->depth_engine == NULL);
Expand Down Expand Up @@ -587,7 +589,7 @@ void dewrapper_stop(dewrapper_t dewrapper_handle)
(void)K4A_RESULT_FROM_BOOL(tresult == THREADAPI_OK); // Trace the issue, but we don't return a failure

// TODO: watch out for whatever was supposed to happen by having set fps = -1
dewrapper->fps_mode_id = 2; //
dewrapper->fps_mode_id = 2; //
dewrapper->depth_mode_id = 0; // K4A_DEPTH_MODE_OFF
}

Expand Down
Loading