Skip to content

Commit

Permalink
Merge pull request #5879 from ev-mp/d455
Browse files Browse the repository at this point in the history
Establish 0x0B5B, 0xB5C SKUs
  • Loading branch information
dorodnic committed Mar 5, 2020
2 parents 99dbab0 + 999401c commit 97229b7
Show file tree
Hide file tree
Showing 7 changed files with 178 additions and 35 deletions.
25 changes: 19 additions & 6 deletions common/viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,17 +689,30 @@ namespace rs2
udev_fname = udev_rules_deb;
}

std::string str((std::istreambuf_iterator<char>(f)),
const std::string str((std::istreambuf_iterator<char>(f)),
std::istreambuf_iterator<char>());

std::string udev = realsense_udev_rules;
udev.erase(udev.find_last_of("\n") + 1);
std::string tmp = realsense_udev_rules;
tmp.erase(tmp.find_last_of("\n") + 1);
const std::string udev = tmp;
float udev_file_ver{}, built_in_file_ver{};

if (udev != str)
// The udev-rules file shall start with version token expressed as ##Version=xx.yy##
std::regex udev_ver_regex("^##Version=(\\d+\\.\\d+)##");
std::smatch match;

if (std::regex_search(udev.begin(), udev.end(), match, udev_ver_regex))
built_in_file_ver = std::stof(std::string(match[1]));

if (std::regex_search(str.begin(), str.end(), match, udev_ver_regex))
udev_file_ver = std::stof(std::string(match[1]));

if (built_in_file_ver > udev_file_ver)
{
message = "RealSense UDEV-Rules file:\n " + udev_fname +"\n is not up-to date!\n" + message;
std::stringstream s;
s << "RealSense UDEV-Rules file:\n " << udev_fname <<"\n is not up-to date! Version " << built_in_file_ver << " can be applied\n";
not_model.add_notification({
message,
s.str() + message,
RS2_LOG_SEVERITY_WARN,
RS2_NOTIFICATION_CATEGORY_COUNT });
}
Expand Down
9 changes: 8 additions & 1 deletion config/99-realsense-libusb.rules
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Intel RealSense UVC cameras (R200, F200, SR300 LR200, ZR300, D400, L500)
##Version=1.1##
# Device rules for Intel RealSense devices (R200, F200, SR300 LR200, ZR300, D400, L500, T200)
SUBSYSTEMS=="usb", ATTRS{idVendor}=="8086", ATTRS{idProduct}=="0a80", MODE:="0666", GROUP:="plugdev", RUN+="/usr/local/bin/usb-R200-in_udev"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="8086", ATTRS{idProduct}=="0a66", MODE:="0666", GROUP:="plugdev"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="8086", ATTRS{idProduct}=="0aa5", MODE:="0666", GROUP:="plugdev"
Expand Down Expand Up @@ -29,6 +30,8 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="8086", ATTRS{idProduct}=="0b49", MODE:="066
SUBSYSTEMS=="usb", ATTRS{idVendor}=="8086", ATTRS{idProduct}=="0b4b", MODE:="0666", GROUP:="plugdev"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="8086", ATTRS{idProduct}=="0b4d", MODE:="0666", GROUP:="plugdev"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="8086", ATTRS{idProduct}=="0b52", MODE:="0666", GROUP:="plugdev"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="8086", ATTRS{idProduct}=="0b5b", MODE:="0666", GROUP:="plugdev"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="8086", ATTRS{idProduct}=="0b5c", MODE:="0666", GROUP:="plugdev"

# Intel RealSense recovery devices (DFU)
SUBSYSTEMS=="usb", ATTRS{idVendor}=="8086", ATTRS{idProduct}=="0ab3", MODE:="0666", GROUP:="plugdev"
Expand Down Expand Up @@ -61,3 +64,7 @@ KERNEL=="iio*", ATTRS{idVendor}=="8086", ATTRS{idProduct}=="0b4b", MODE:="0777",
DRIVER=="hid_sensor*", ATTRS{idVendor}=="8086", ATTRS{idProduct}=="0b4b", RUN+="/bin/sh -c ' chmod -R 0777 /sys/%p && chmod 0777 /dev/%k'"
KERNEL=="iio*", ATTRS{idVendor}=="8086", ATTRS{idProduct}=="0b4d", MODE:="0777", GROUP:="plugdev", RUN+="/bin/sh -c 'chmod -R 0777 /sys/%p'"
DRIVER=="hid_sensor*", ATTRS{idVendor}=="8086", ATTRS{idProduct}=="0b4d", RUN+="/bin/sh -c ' chmod -R 0777 /sys/%p && chmod 0777 /dev/%k'"
KERNEL=="iio*", ATTRS{idVendor}=="8086", ATTRS{idProduct}=="0b5b", MODE:="0777", GROUP:="plugdev", RUN+="/bin/sh -c 'chmod -R 0777 /sys/%p'"
DRIVER=="hid_sensor*", ATTRS{idVendor}=="8086", ATTRS{idProduct}=="0b5b", RUN+="/bin/sh -c ' chmod -R 0777 /sys/%p && chmod 0777 /dev/%k'"
KERNEL=="iio*", ATTRS{idVendor}=="8086", ATTRS{idProduct}=="0b5c", MODE:="0777", GROUP:="plugdev", RUN+="/bin/sh -c 'chmod -R 0777 /sys/%p'"
DRIVER=="hid_sensor*", ATTRS{idVendor}=="8086", ATTRS{idProduct}=="0b5c", RUN+="/bin/sh -c ' chmod -R 0777 /sys/%p && chmod 0777 /dev/%k'"
4 changes: 3 additions & 1 deletion src/ds5/advanced_mode/advanced_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ namespace librealsense
case ds::RS435_RGB_PID:
case ds::RS435I_PID:
case ds::RS465_PID:
case ds::RS405_PID:
case ds::RS455_PID:
default_430(p);
break;
case ds::RS405_PID:
case ds::RS405U_PID:
default_405(p);
break;
case ds::RS400_PID:
Expand Down
116 changes: 111 additions & 5 deletions src/ds5/ds5-factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ namespace librealsense
};

// DS5U_S
class rs405_device : public ds5u_device,
class rs405u_device : public ds5u_device,
public ds5_advanced_mode_base
{
public:
rs405_device(std::shared_ptr<context> ctx,
rs405u_device(std::shared_ptr<context> ctx,
const platform::backend_device_group& group,
bool register_device_notifications)
: device(ctx, group, register_device_notifications),
Expand Down Expand Up @@ -823,6 +823,92 @@ namespace librealsense
};
};

class rs405_device : public ds5_active,
public ds5_color,
public ds5_motion,
public ds5_advanced_mode_base
{
public:
rs405_device(std::shared_ptr<context> ctx,
const platform::backend_device_group group,
bool register_device_notifications)
: device(ctx, group, register_device_notifications),
ds5_device(ctx, group),
ds5_active(ctx, group),
ds5_color(ctx, group),
ds5_motion(ctx, group),
ds5_advanced_mode_base(ds5_device::_hw_monitor, get_depth_sensor())
{}

std::shared_ptr<matcher> create_matcher(const frame_holder& frame) const override;

std::vector<tagged_profile> get_profiles_tags() const override
{
std::vector<tagged_profile> tags;
auto usb_spec = get_usb_spec();
bool usb3mode = (usb_spec >= platform::usb3_type || usb_spec == platform::usb_undefined);

uint32_t depth_width = usb3mode ? 848 : 640;
uint32_t depth_height = usb3mode ? 480 : 480;
uint32_t color_width = usb3mode ? 1280 : 640;
uint32_t color_height = usb3mode ? 720 : 480;
uint32_t fps = usb3mode ? 30 : 15;

tags.push_back({ RS2_STREAM_COLOR, -1, color_width, color_height, RS2_FORMAT_RGB8, fps, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT });
tags.push_back({ RS2_STREAM_DEPTH, -1, depth_width, depth_height, RS2_FORMAT_Z16, fps, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT });
tags.push_back({ RS2_STREAM_INFRARED, -1, depth_width, depth_height, RS2_FORMAT_Y8, fps, profile_tag::PROFILE_TAG_SUPERSET });
tags.push_back({RS2_STREAM_GYRO, -1, 0, 0, RS2_FORMAT_MOTION_XYZ32F, (int)odr::IMU_FPS_200, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT });
tags.push_back({RS2_STREAM_ACCEL, -1, 0, 0, RS2_FORMAT_MOTION_XYZ32F, (int)odr::IMU_FPS_63, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT });

return tags;
}

bool compress_while_record() const override { return false; }
};

class rs455_device : public ds5_active,
public ds5_color,
public ds5_motion,
public ds5_advanced_mode_base
{
public:
rs455_device(std::shared_ptr<context> ctx,
const platform::backend_device_group group,
bool register_device_notifications)
: device(ctx, group, register_device_notifications),
ds5_device(ctx, group),
ds5_active(ctx, group),
ds5_color(ctx, group),
ds5_motion(ctx, group),
ds5_advanced_mode_base(ds5_device::_hw_monitor, get_depth_sensor())
{}

std::shared_ptr<matcher> create_matcher(const frame_holder& frame) const override;

std::vector<tagged_profile> get_profiles_tags() const override
{
std::vector<tagged_profile> tags;
auto usb_spec = get_usb_spec();
bool usb3mode = (usb_spec >= platform::usb3_type || usb_spec == platform::usb_undefined);

uint32_t depth_width = usb3mode ? 848 : 640;
uint32_t depth_height = usb3mode ? 480 : 480;
uint32_t color_width = usb3mode ? 1280 : 640;
uint32_t color_height = usb3mode ? 720 : 480;
uint32_t fps = usb3mode ? 30 : 15;

tags.push_back({ RS2_STREAM_COLOR, -1, color_width, color_height, RS2_FORMAT_RGB8, fps, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT });
tags.push_back({ RS2_STREAM_DEPTH, -1, depth_width, depth_height, RS2_FORMAT_Z16, fps, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT });
tags.push_back({ RS2_STREAM_INFRARED, -1, depth_width, depth_height, RS2_FORMAT_Y8, fps, profile_tag::PROFILE_TAG_SUPERSET });
tags.push_back({RS2_STREAM_GYRO, -1, 0, 0, RS2_FORMAT_MOTION_XYZ32F, (int)odr::IMU_FPS_200, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT });
tags.push_back({RS2_STREAM_ACCEL, -1, 0, 0, RS2_FORMAT_MOTION_XYZ32F, (int)odr::IMU_FPS_63, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT });

return tags;
}

bool compress_while_record() const override { return false; }
};

std::shared_ptr<device_interface> ds5_info::create(std::shared_ptr<context> ctx,
bool register_device_notifications) const
{
Expand All @@ -836,8 +922,8 @@ namespace librealsense
{
case RS400_PID:
return std::make_shared<rs400_device>(ctx, group, register_device_notifications);
case RS405_PID:
return std::make_shared<rs405_device>(ctx, group, register_device_notifications);
case RS405U_PID:
return std::make_shared<rs405u_device>(ctx, group, register_device_notifications);
case RS410_PID:
case RS460_PID:
return std::make_shared<rs410_device>(ctx, group, register_device_notifications);
Expand Down Expand Up @@ -869,6 +955,10 @@ namespace librealsense
return std::make_shared<rs410_device>(ctx, group, register_device_notifications);
case RS400_IMU_PID:
return std::make_shared<rs400_imu_device>(ctx, group, register_device_notifications);
case ds::RS405_PID:
return std::make_shared<rs405_device>(ctx, group, register_device_notifications);
case ds::RS455_PID:
return std::make_shared<rs455_device>(ctx, group, register_device_notifications);
default:
throw std::runtime_error(to_string() << "Unsupported RS400 model! 0x"
<< std::hex << std::setw(4) << std::setfill('0') <<(int)pid);
Expand Down Expand Up @@ -966,7 +1056,7 @@ namespace librealsense
return matcher_factory::create(RS2_MATCHER_DEFAULT, streams);
}

std::shared_ptr<matcher> rs405_device::create_matcher(const frame_holder& frame) const
std::shared_ptr<matcher> rs405u_device::create_matcher(const frame_holder& frame) const
{
std::vector<stream_interface*> streams = { _depth_stream.get() , _left_ir_stream.get() , _right_ir_stream.get()};
return matcher_factory::create(RS2_MATCHER_DEFAULT, streams);
Expand Down Expand Up @@ -1086,4 +1176,20 @@ namespace librealsense
std::vector<stream_interface*> mm_streams = { _accel_stream.get(), _gyro_stream.get()};
return matcher_factory::create(RS2_MATCHER_DEFAULT, mm_streams);
}

std::shared_ptr<matcher> rs405_device::create_matcher(const frame_holder& frame) const
{
std::vector<stream_interface*> streams = { _depth_stream.get() , _left_ir_stream.get() , _right_ir_stream.get(), _color_stream.get() };
std::vector<stream_interface*> mm_streams = { _accel_stream.get(), _gyro_stream.get()};
streams.insert(streams.end(), mm_streams.begin(), mm_streams.end());
return matcher_factory::create(RS2_MATCHER_DEFAULT, streams);
}

std::shared_ptr<matcher> rs455_device::create_matcher(const frame_holder& frame) const
{
std::vector<stream_interface*> streams = { _depth_stream.get() , _left_ir_stream.get() , _right_ir_stream.get(), _color_stream.get() };
std::vector<stream_interface*> mm_streams = { _accel_stream.get(), _gyro_stream.get()};
streams.insert(streams.end(), mm_streams.begin(), mm_streams.end());
return matcher_factory::create(RS2_MATCHER_DEFAULT, streams);
}
}
3 changes: 2 additions & 1 deletion src/ds5/ds5-motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ namespace librealsense

uint16_t pid = static_cast<uint16_t>(strtoul(all_hid_infos.front().pid.data(), nullptr, 16));

if ((camera_fw_version >= firmware_version(custom_sensor_fw_ver)) && (!val_in_range(pid, { ds::RS400_IMU_PID, ds::RS435I_PID, ds::RS430I_PID, ds::RS465_PID })))
if ((camera_fw_version >= firmware_version(custom_sensor_fw_ver)) &&
(!val_in_range(pid, { ds::RS400_IMU_PID, ds::RS435I_PID, ds::RS430I_PID, ds::RS465_PID, ds::RS405_PID, ds::RS455_PID })))
{
hid_ep->register_option(RS2_OPTION_MOTION_MODULE_TEMPERATURE,
std::make_shared<motion_module_temperature_option>(*raw_hid_ep));
Expand Down
4 changes: 3 additions & 1 deletion src/ds5/ds5-private.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ namespace librealsense
{
case RS_USB2_PID:
case RS400_PID:
case RS405_PID:
case RS405U_PID:
case RS410_PID:
case RS416_PID:
case RS460_PID:
Expand All @@ -285,6 +285,8 @@ namespace librealsense
case RS430_MM_PID:
case RS420_MM_PID:
case RS435I_PID:
case RS405_PID:
case RS455_PID:
found = (result.mi == 6);
break;
case RS415_PID:
Expand Down
52 changes: 32 additions & 20 deletions src/ds5/ds5-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ namespace librealsense
const uint16_t RS430_MM_RGB_PID = 0x0b01; // AWGCT
const uint16_t RS460_PID = 0x0b03; // DS5U
const uint16_t RS435_RGB_PID = 0x0b07; // AWGC
const uint16_t RS405_PID = 0x0b0c; // DS5U
const uint16_t RS405U_PID = 0x0b0c; // DS5U
const uint16_t RS435I_PID = 0x0b3a; // D435i
const uint16_t RS416_PID = 0x0b49; // F416
const uint16_t RS430I_PID = 0x0b4b; // D430i
const uint16_t RS465_PID = 0x0b4d; // D465
const uint16_t RS416_RGB_PID = 0x0B52; // F416 RGB
const uint16_t RS405_PID = 0x0B5B; // D405
const uint16_t RS455_PID = 0x0B5C; // D455

// DS5 depth XU identifiers
const uint8_t DS5_HWMONITOR = 1;
Expand All @@ -56,10 +58,7 @@ namespace librealsense
ds::RS400_PID,
ds::RS410_PID,
ds::RS415_PID,
ds::RS416_PID,
ds::RS416_RGB_PID,
ds::RS430_PID,
ds::RS430I_PID,
ds::RS430_MM_PID,
ds::RS_USB2_PID,
ds::RS400_IMU_PID,
Expand All @@ -70,9 +69,14 @@ namespace librealsense
ds::RS430_MM_RGB_PID,
ds::RS460_PID,
ds::RS435_RGB_PID,
ds::RS405_PID,
ds::RS405U_PID,
ds::RS435I_PID,
ds::RS416_RGB_PID,
ds::RS430I_PID,
ds::RS465_PID,
ds::RS416_PID,
ds::RS405_PID,
ds::RS455_PID,
};

static const std::set<std::uint16_t> multi_sensors_pid = {
Expand All @@ -85,17 +89,23 @@ namespace librealsense
ds::RS435_RGB_PID,
ds::RS435I_PID,
ds::RS465_PID,
ds::RS405_PID,
ds::RS455_PID,
};

static const std::set<std::uint16_t> hid_sensors_pid = {
ds::RS435I_PID,
ds::RS430I_PID,
ds::RS465_PID
ds::RS465_PID,
ds::RS405_PID,
ds::RS455_PID,
};

static const std::set<std::uint16_t> hid_bmi_055_pid = {
ds::RS435I_PID,
ds::RS430I_PID
ds::RS430I_PID,
ds::RS405_PID,
ds::RS455_PID
};

static const std::set<std::uint16_t> hid_bmi_085_pid = {
Expand All @@ -111,28 +121,30 @@ namespace librealsense
};

static const std::map<std::uint16_t, std::string> rs400_sku_names = {
{ RS_RECOVERY_PID, "Intel RealSense D4xx Recovery"},
{ RS_USB2_RECOVERY_PID, "Intel RealSense USB2 D4xx Recovery"},
{ RS400_PID, "Intel RealSense D400"},
{ RS400_MM_PID, "Intel RealSense D400 with Tracking Module"},
{ RS410_PID, "Intel RealSense D410"},
{ RS410_MM_PID, "Intel RealSense D410 with Tracking Module"},
{ RS415_PID, "Intel RealSense D415"},
{ RS416_PID, "Intel RealSense F416"},
{ RS416_RGB_PID, "Intel RealSense F416 with RGB Module"},
{ RS420_PID, "Intel RealSense D420"},
{ RS420_MM_PID, "Intel RealSense D420 with Tracking Module"},
{ RS430_PID, "Intel RealSense D430"},
{ RS430I_PID, "Intel RealSense D430I"},
{ RS430_MM_PID, "Intel RealSense D430 with Tracking Module"},
{ RS_USB2_PID, "Intel RealSense USB2" },
{ RS_RECOVERY_PID, "Intel RealSense D4xx Recovery"},
{ RS_USB2_RECOVERY_PID, "Intel RealSense USB2 D4xx Recovery"},
{ RS400_IMU_PID, "Intel RealSense IMU" },
{ RS420_PID, "Intel RealSense D420"},
{ RS420_MM_PID, "Intel RealSense D420 with Tracking Module"},
{ RS410_MM_PID, "Intel RealSense D410 with Tracking Module"},
{ RS400_MM_PID, "Intel RealSense D400 with Tracking Module"},
{ RS430_MM_RGB_PID, "Intel RealSense D430 with Tracking and RGB Modules"},
{ RS435_RGB_PID, "Intel RealSense D435"},
{ RS460_PID, "Intel RealSense D460" },
{ RS405_PID, "Intel RealSense D405" },
{ RS435_RGB_PID, "Intel RealSense D435"},
{ RS405U_PID, "Intel RealSense DS5U" },
{ RS435I_PID, "Intel RealSense D435I" },
{ RS416_PID, "Intel RealSense F416"},
{ RS430I_PID, "Intel RealSense D430I"},
{ RS465_PID, "Intel RealSense D465" },
{ RS_USB2_PID, "Intel RealSense USB2" },
{ RS400_IMU_PID, "Intel RealSense IMU" }
{ RS416_RGB_PID, "Intel RealSense F416 with RGB Module"},
{ RS405_PID, "Intel RealSense D405" },
{ RS455_PID, "Intel RealSense D455" },
};

// DS5 fisheye XU identifiers
Expand Down

0 comments on commit 97229b7

Please sign in to comment.