Skip to content

Commit

Permalink
Merge pull request IntelRealSense#241 from eraikhel/ds41t_klockwork
Browse files Browse the repository at this point in the history
Fix SR300 color modes
  • Loading branch information
dorodnic committed Sep 5, 2016
2 parents e9a0350 + c77c39b commit b18bf6d
Show file tree
Hide file tree
Showing 26 changed files with 502 additions and 109 deletions.
4 changes: 2 additions & 2 deletions examples/cpp-config-ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ int main(int argc, char * argv[])
dev->stop();
}

if (has_motion_module)
if (has_motion_module && motion_tracking_enable)
{
running = false;
dev->stop(rs::source::motion_data);
Expand All @@ -707,7 +707,7 @@ int main(int argc, char * argv[])
dev->start();
}

if (has_motion_module)
if (has_motion_module && motion_tracking_enable)
{
running = true;
dev->start(rs::source::motion_data);
Expand Down
3 changes: 3 additions & 0 deletions librealsense.vc12/cpp-alignimages/cpp-alignimages.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@
<ProjectReference Include="..\..\examples\third_party\glfw\msvc120\glfw3.vcxproj">
<Project>{979d0add-6ab7-403a-bb17-5434615e4446}</Project>
</ProjectReference>
<ProjectReference Include="..\realsense\realsense.vcxproj">
<Project>{1ae4ceb5-9a0b-4b9f-9505-824fd56bb41f}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\examples\example.hpp" />
Expand Down
3 changes: 0 additions & 3 deletions librealsense.vc12/cpp-callback/cpp-callback.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,6 @@
<ClCompile Include="..\..\examples\cpp-callback.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\examples\third_party\glfw\msvc120\glfw3.vcxproj">
<Project>{979d0add-6ab7-403a-bb17-5434615e4446}</Project>
</ProjectReference>
<ProjectReference Include="..\realsense\realsense.vcxproj">
<Project>{1ae4ceb5-9a0b-4b9f-9505-824fd56bb41f}</Project>
</ProjectReference>
Expand Down
3 changes: 3 additions & 0 deletions librealsense.vc12/cpp-capture/cpp-capture.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@
<ProjectReference Include="..\..\examples\third_party\glfw\msvc120\glfw3.vcxproj">
<Project>{979d0add-6ab7-403a-bb17-5434615e4446}</Project>
</ProjectReference>
<ProjectReference Include="..\realsense\realsense.vcxproj">
<Project>{1ae4ceb5-9a0b-4b9f-9505-824fd56bb41f}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\examples\example.hpp" />
Expand Down
3 changes: 3 additions & 0 deletions librealsense.vc12/cpp-config-ui/cpp-config-ui.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@
<ProjectReference Include="..\..\examples\third_party\glfw\msvc120\glfw3.vcxproj">
<Project>{979d0add-6ab7-403a-bb17-5434615e4446}</Project>
</ProjectReference>
<ProjectReference Include="..\realsense\realsense.vcxproj">
<Project>{1ae4ceb5-9a0b-4b9f-9505-824fd56bb41f}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\examples\concurrency.hpp" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@
<ItemGroup>
<ClCompile Include="..\..\examples\cpp-enumerate-devices.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\realsense\realsense.vcxproj">
<Project>{1ae4ceb5-9a0b-4b9f-9505-824fd56bb41f}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
5 changes: 5 additions & 0 deletions librealsense.vc12/cpp-headless/cpp-headless.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
<ItemGroup>
<ClCompile Include="..\..\examples\cpp-headless.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\realsense\realsense.vcxproj">
<Project>{1ae4ceb5-9a0b-4b9f-9505-824fd56bb41f}</Project>
</ProjectReference>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{7F7D0E8C-1614-411C-AD0A-C3D583EC5811}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
Expand Down
3 changes: 3 additions & 0 deletions librealsense.vc12/cpp-multicam/cpp-multicam.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@
<ProjectReference Include="..\..\examples\third_party\glfw\msvc120\glfw3.vcxproj">
<Project>{979d0add-6ab7-403a-bb17-5434615e4446}</Project>
</ProjectReference>
<ProjectReference Include="..\realsense\realsense.vcxproj">
<Project>{1ae4ceb5-9a0b-4b9f-9505-824fd56bb41f}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\examples\example.hpp" />
Expand Down
3 changes: 3 additions & 0 deletions librealsense.vc12/cpp-pointcloud/cpp-pointcloud.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@
<ProjectReference Include="..\..\examples\third_party\glfw\msvc120\glfw3.vcxproj">
<Project>{979d0add-6ab7-403a-bb17-5434615e4446}</Project>
</ProjectReference>
<ProjectReference Include="..\realsense\realsense.vcxproj">
<Project>{1ae4ceb5-9a0b-4b9f-9505-824fd56bb41f}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
Expand Down
3 changes: 3 additions & 0 deletions librealsense.vc12/cpp-restart/cpp-restart.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@
<ProjectReference Include="..\..\examples\third_party\glfw\msvc120\glfw3.vcxproj">
<Project>{979d0add-6ab7-403a-bb17-5434615e4446}</Project>
</ProjectReference>
<ProjectReference Include="..\realsense\realsense.vcxproj">
<Project>{1ae4ceb5-9a0b-4b9f-9505-824fd56bb41f}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\examples\example.hpp" />
Expand Down
18 changes: 17 additions & 1 deletion librealsense.vc12/realsense.sln
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
VisualStudioVersion = 12.0.40629.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "realsense", "realsense\realsense.vcxproj", "{1AE4CEB5-9A0B-4B9F-9505-824FD56BB41F}"
ProjectSection(ProjectDependencies) = postProject
{622186C4-6D7D-4288-B8FD-8F08419181C2} = {622186C4-6D7D-4288-B8FD-8F08419181C2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-capture", "cpp-capture\cpp-capture.vcxproj", "{4074122F-153D-4761-9539-7B7D5E72B11D}"
ProjectSection(ProjectDependencies) = postProject
Expand Down Expand Up @@ -112,12 +115,25 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glfw3", "..\examples\third_party\glfw\msvc120\glfw3.vcxproj", "{979D0ADD-6AB7-403A-BB17-5434615E4446}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-callback", "cpp-callback\cpp-callback.vcxproj", "{22315D69-5DB9-4C89-98FE-B45F1A5D6674}"
ProjectSection(ProjectDependencies) = postProject
{1AE4CEB5-9A0B-4B9F-9505-824FD56BB41F} = {1AE4CEB5-9A0B-4B9F-9505-824FD56BB41F}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-motion-module", "cpp-motion-module\cpp-motion-module.vcxproj", "{D1A726B7-DF03-4F04-AEC8-936AB88FC372}"
ProjectSection(ProjectDependencies) = postProject
{1AE4CEB5-9A0B-4B9F-9505-824FD56BB41F} = {1AE4CEB5-9A0B-4B9F-9505-824FD56BB41F}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-callback-2", "cpp-callback-2\cpp-callback-2.vcxproj", "{C3CB58F0-844A-4B8F-B3C6-159A9677E868}"
ProjectSection(ProjectDependencies) = postProject
{1AE4CEB5-9A0B-4B9F-9505-824FD56BB41F} = {1AE4CEB5-9A0B-4B9F-9505-824FD56BB41F}
{979D0ADD-6AB7-403A-BB17-5434615E4446} = {979D0ADD-6AB7-403A-BB17-5434615E4446}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-stride", "cpp-stride\cpp-stride.vcxproj", "{78B5B485-34B9-4462-A284-B19118D3D0DA}"
ProjectSection(ProjectDependencies) = postProject
{1AE4CEB5-9A0B-4B9F-9505-824FD56BB41F} = {1AE4CEB5-9A0B-4B9F-9505-824FD56BB41F}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unit-tests-live-lr200", "unit-tests-live-lr200\unit-tests-live-lr200.vcxproj", "{9D0CA8E1-96E2-4A56-9000-F52035256190}"
ProjectSection(ProjectDependencies) = postProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
<ClCompile Include="..\..\unit-tests\unit-tests-live-f200.cpp" />
<ClCompile Include="..\..\unit-tests\unit-tests-live.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\realsense\realsense.vcxproj">
<Project>{1ae4ceb5-9a0b-4b9f-9505-824fd56bb41f}</Project>
</ProjectReference>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{D37BF473-AEE1-4097-9E0B-C1A8A5BF97EC}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
<ClCompile Include="..\..\unit-tests\unit-tests-live-lr200.cpp" />
<ClCompile Include="..\..\unit-tests\unit-tests-live.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\realsense\realsense.vcxproj">
<Project>{1ae4ceb5-9a0b-4b9f-9505-824fd56bb41f}</Project>
</ProjectReference>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{9D0CA8E1-96E2-4A56-9000-F52035256190}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
<ClCompile Include="..\..\unit-tests\unit-tests-live-r200.cpp" />
<ClCompile Include="..\..\unit-tests\unit-tests-live.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\realsense\realsense.vcxproj">
<Project>{1ae4ceb5-9a0b-4b9f-9505-824fd56bb41f}</Project>
</ProjectReference>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{7B497980-3BB8-4699-A459-0F3091D24E03}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@
<ClCompile Include="..\..\unit-tests\unit-tests-live-sr300.cpp" />
<ClCompile Include="..\..\unit-tests\unit-tests-live.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\realsense\realsense.vcxproj">
<Project>{1ae4ceb5-9a0b-4b9f-9505-824fd56bb41f}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
<ClCompile Include="..\..\unit-tests\unit-tests-live-zr300.cpp" />
<ClCompile Include="..\..\unit-tests\unit-tests-live.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\realsense\realsense.vcxproj">
<Project>{1ae4ceb5-9a0b-4b9f-9505-824fd56bb41f}</Project>
</ProjectReference>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{1B6AC368-20CD-4016-9452-8621E06349CE}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
<ItemGroup>
<ClCompile Include="..\..\unit-tests\unit-tests-offline.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\realsense\realsense.vcxproj">
<Project>{1ae4ceb5-9a0b-4b9f-9505-824fd56bb41f}</Project>
</ProjectReference>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B57FBF49-D142-4CCA-AFCB-E5F1687EE217}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
<ClCompile Include="..\..\unit-tests\unit-tests-live-f200.cpp" />
<ClCompile Include="..\..\unit-tests\unit-tests-live.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\realsense-s\realsense-s.vcxproj">
<Project>{622186c4-6d7d-4288-b8fd-8f08419181c2}</Project>
</ProjectReference>
<ProjectReference Include="..\realsense\realsense.vcxproj">
<Project>{1ae4ceb5-9a0b-4b9f-9505-824fd56bb41f}</Project>
</ProjectReference>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{D37BF473-AEE1-4097-9E0B-C1A8A5BF97EC}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
Expand Down
6 changes: 3 additions & 3 deletions src/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ void rs_device_base::start_video_streaming()
// dispatching the uvc configuration for a requested stream to the hardware
for(auto mode_selection : selected_modes)
{
assert(mode_selection.mode.subdevice <= timestamp_readers.size());
assert((size_t)mode_selection.mode.subdevice <= timestamp_readers.size());
auto timestamp_reader = timestamp_readers[mode_selection.mode.subdevice];

// Create a stream buffer for each stream served by this subdevice mode
Expand Down Expand Up @@ -522,8 +522,8 @@ const char * rs_device_base::get_option_description(rs_option option) const
case RS_OPTION_R200_LR_EXPOSURE : return "This control allows manual adjustment of the exposure time value for the L/R imagers";
case RS_OPTION_R200_EMITTER_ENABLED : return "Enables / disables R200 emitter";
case RS_OPTION_R200_DEPTH_UNITS : return "Micrometers per increment in integer depth values, 1000 is default (mm scale). Set before streaming";
case RS_OPTION_R200_DEPTH_CLAMP_MIN : return "Minimum depth in current depth units that will be output. Any values less than ‘Min Depth’ will be mapped to 0 during the conversion between disparity and depth. Set before streaming";
case RS_OPTION_R200_DEPTH_CLAMP_MAX : return "Maximum depth in current depth units that will be output. Any values greater than ‘Max Depth’ will be mapped to 0 during the conversion between disparity and depth. Set before streaming";
case RS_OPTION_R200_DEPTH_CLAMP_MIN : return "Minimum depth in current depth units that will be output. Any values less than 'Min Depth' will be mapped to 0 during the conversion between disparity and depth. Set before streaming";
case RS_OPTION_R200_DEPTH_CLAMP_MAX : return "Maximum depth in current depth units that will be output. Any values greater than 'Max Depth' will be mapped to 0 during the conversion between disparity and depth. Set before streaming";
case RS_OPTION_R200_DISPARITY_MULTIPLIER : return "The disparity scale factor used when in disparity output mode. Can only be set before streaming";
case RS_OPTION_R200_DISPARITY_SHIFT : return "{0 - 512}. Can only be set before streaming starts";
case RS_OPTION_R200_AUTO_EXPOSURE_MEAN_INTENSITY_SET_POINT : return "(Requires LR-Auto-Exposure ON) Mean intensity set point";
Expand Down
12 changes: 10 additions & 2 deletions src/f200.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace rsimpl
};
static const cam_mode f200_depth_modes[] = {
{{640, 480}, {2,5,15,30,60}},
{{640, 240}, {2,5,15,30,60,110}}
{{640, 240}, {2,5,15,30,60}} // 110 FPS is excluded due to a bug in timestamp field
};
static const cam_mode f200_ir_only_modes[] = {
{{640, 480}, {30,60,120,240,300}},
Expand Down Expand Up @@ -88,7 +88,15 @@ namespace rsimpl
info.presets[RS_STREAM_DEPTH ][RS_PRESET_HIGHEST_FRAMERATE] = {true, 640, 480, RS_FORMAT_Z16, 60};
info.presets[RS_STREAM_COLOR ][RS_PRESET_HIGHEST_FRAMERATE] = {true, 640, 480, RS_FORMAT_RGB8, 60};

update_supported_options(*device.get(), ivcam::depth_xu, eu_F200_depth_controls, info.options);
// Hardcoded extension controls
// option min max step def
// ------ --- --- ---- ---
info.options.push_back({ RS_OPTION_F200_LASER_POWER, 0, 16, 1, 16 });
info.options.push_back({ RS_OPTION_F200_ACCURACY, 1, 3, 1, 2 });
info.options.push_back({ RS_OPTION_F200_MOTION_RANGE, 0, 100, 1, 0 });
info.options.push_back({ RS_OPTION_F200_FILTER_OPTION, 0, 7, 1, 5 });
info.options.push_back({ RS_OPTION_F200_CONFIDENCE_THRESHOLD, 0, 15, 1, 6 });
info.options.push_back({ RS_OPTION_F200_DYNAMIC_FPS, 0, 1000, 1, 60 });

rsimpl::pose depth_to_color = {transpose((const float3x3 &)c.Rt), (const float3 &)c.Tt * 0.001f}; // convert mm to m
info.stream_poses[RS_STREAM_DEPTH] = info.stream_poses[RS_STREAM_INFRARED] = inverse(depth_to_color);
Expand Down
26 changes: 13 additions & 13 deletions src/sr300.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ namespace rsimpl
{rs_option::RS_OPTION_F200_CONFIDENCE_THRESHOLD, 0x06}};

static const cam_mode sr300_color_modes[] = {
{{1920, 1080}, {5,15,30}},
{{1280, 720}, {5,15,30,60}},
{{ 960, 540}, {5,15,30,60}},
{{ 848, 480}, {5,15,30,60}},
{{ 640, 480}, {5,15,30,60}},
{{ 640, 360}, {5,15,30,60}},
{{ 424, 240}, {5,15,30,60}},
{{ 320, 240}, {5,15,30,60}},
{{ 320, 180}, {5,15,30,60}}
{{1920, 1080}, { 10,30 } },
{{1280, 720}, { 10,30,60 } },
{{ 960, 540}, { 10,30,60 } },
{{ 848, 480}, { 10,30,60 } },
{{ 640, 480}, { 10,30,60 } },
{{ 640, 360}, { 10,30,60 } },
{{ 424, 240}, { 10,30,60 } },
{{ 320, 240}, { 10,30,60 } },
{{ 320, 180}, { 10,30,60 } },
};

static const cam_mode sr300_depth_modes[] = {
{{640, 480}, {5,15,30,60}},
{{640, 240}, {5,15,30,60,110}}
{{640, 480}, {10,30,60}},
{{640, 240}, {10,30,60,110}}
};

static const cam_mode sr300_ir_only_modes[] = {
{{640, 480}, {30,60,120,200}}
};
{{640, 480}, {30,60,120,200}}
};

static static_device_info get_sr300_info(std::shared_ptr<uvc::device> device, const ivcam::camera_calib_params & c)
{
Expand Down
2 changes: 1 addition & 1 deletion src/stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace rsimpl
{
struct stream_interface : rs_stream_interface
{
stream_interface(calibration_validator in_validator, rs_stream in_stream) : validator(in_validator), stream(in_stream){};
stream_interface(calibration_validator in_validator, rs_stream in_stream) : stream(in_stream), validator(in_validator){};

virtual rs_extrinsics get_extrinsics_to(const rs_stream_interface & other) const override;
virtual rsimpl::pose get_pose() const = 0;
Expand Down
Loading

0 comments on commit b18bf6d

Please sign in to comment.