update realsensecamera
This commit is contained in:
parent
1cd57c36ea
commit
d8084dbc7d
@ -14,10 +14,10 @@ realsense_cameras {
|
|||||||
}
|
}
|
||||||
|
|
||||||
realsense_cameras {
|
realsense_cameras {
|
||||||
id: "left_hand_cam"
|
id: "right_hand_cam"
|
||||||
serialNumber: "243122072252"
|
serialNumber: "243122072252"
|
||||||
width: 640
|
width: 1280
|
||||||
height: 480
|
height: 720
|
||||||
fps: 30
|
fps: 30
|
||||||
codec: "H265"
|
codec: "H265"
|
||||||
camera_mode: CAMERA_MODE_VIDEO
|
camera_mode: CAMERA_MODE_VIDEO
|
||||||
|
|||||||
@ -151,11 +151,11 @@ RealsenseCamera::RealsenseCamera(const config::RealSenseCameraConfig& camera):ca
|
|||||||
auto stream_mode = camera_.stream_mode();
|
auto stream_mode = camera_.stream_mode();
|
||||||
if (stream_mode == config::STREAM_MODE_RGB)
|
if (stream_mode == config::STREAM_MODE_RGB)
|
||||||
{
|
{
|
||||||
stream_mode_ = RGBD_MODE;
|
stream_mode_ = COLOR_MODE;
|
||||||
}
|
}
|
||||||
else if (stream_mode == config::STREAM_MODE_RGBD)
|
else if (stream_mode == config::STREAM_MODE_RGBD)
|
||||||
{
|
{
|
||||||
stream_mode_ = COLOR_MODE;
|
stream_mode_ = RGBD_MODE;
|
||||||
}
|
}
|
||||||
else if (stream_mode == config::STREAM_MODE_DEPTH)
|
else if (stream_mode == config::STREAM_MODE_DEPTH)
|
||||||
{
|
{
|
||||||
@ -254,19 +254,15 @@ void RealsenseCamera::start() {
|
|||||||
intrinsics_ = Kd_;
|
intrinsics_ = Kd_;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (align_mode_ == "color") {
|
if (camera_.align_mode() == config::ALIGN_MODE_COLOR)
|
||||||
|
{
|
||||||
align_ = std::make_shared<rs2::align>(RS2_STREAM_COLOR);
|
align_ = std::make_shared<rs2::align>(RS2_STREAM_COLOR);
|
||||||
}
|
}
|
||||||
else if (align_mode_ == "depth") {
|
else if (camera_.align_mode() == config::ALIGN_MODE_DEPTH)
|
||||||
|
{
|
||||||
align_ = std::make_shared<rs2::align>(RS2_STREAM_DEPTH);
|
align_ = std::make_shared<rs2::align>(RS2_STREAM_DEPTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
// auto frames = get_frameset(true);
|
|
||||||
// rs2::frame color_frame = frames.get_color_frame();
|
|
||||||
// auto profile = color_frame.get_profile();
|
|
||||||
// auto color_profile = frames.get_color_frame().get_profile();
|
|
||||||
// intrinsics_ = color_profile.as<rs2::video_stream_profile>().get_intrinsics();
|
|
||||||
|
|
||||||
state_.is_opened = true;
|
state_.is_opened = true;
|
||||||
LOG(INFO) << "realsense start streaming successfully";
|
LOG(INFO) << "realsense start streaming successfully";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -372,7 +372,7 @@ grpc::Status gRPCCameraServiceImpl::GetRGBDImagesStream(grpc::ServerContext* con
|
|||||||
{
|
{
|
||||||
if (context->IsCancelled())
|
if (context->IsCancelled())
|
||||||
{
|
{
|
||||||
LOG(INFO) << "[gRPCCameraServiceImpl](GetRGBImageStream) context is cancelled,id=" << dev_id;
|
LOG(INFO) << "[gRPCCameraServiceImpl](GetRGBDImagesStream) context is cancelled,id=" << dev_id;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -411,7 +411,7 @@ grpc::Status gRPCCameraServiceImpl::GetRGBDImagesStream(grpc::ServerContext* con
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOG(INFO) << "[gRPCCameraServiceImpl] (GetRGBImageStream): end,id=" << dev_id;
|
LOG(INFO) << "[gRPCCameraServiceImpl] (GetRGBDImagesStream): end,id=" << dev_id;
|
||||||
dev->stopStreaming();
|
dev->stopStreaming();
|
||||||
return grpc::Status::OK;
|
return grpc::Status::OK;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user