Skip to content
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

if default profile is not defined, take the first available profile as default #2601

Merged

Conversation

SamerKhshiboun
Copy link
Collaborator

@SamerKhshiboun SamerKhshiboun commented Jan 18, 2023

Tracked by LRS-638

@SamerKhshiboun SamerKhshiboun marked this pull request as ready for review January 22, 2023 22:02
@@ -113,7 +113,10 @@ rs2::stream_profile ProfilesManager::getDefaultProfile()
}
}
if (!(default_profile.get()))
throw std::runtime_error("No default profile found");
{
ROS_INFO_STREAM("No default profile found. Setting the first available profile as the default one.");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest adding the stream information to the log info.
Maybe something like `"No default profile found for sensor <sensor_name>, setting first profile: <stream_type, stream_index, fps, res?>
might be helpful..

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could do that, but chose this way, because we already print these messages today:

[realsense2_camera_node-1] [INFO] [1674639570.888621178] [camera.camera]: Starting Sensor: RGB Camera
[realsense2_camera_node-1] [INFO] [1674639570.918054720] [camera.camera]: Open profile: stream_type: Color(0), Format: RGB8, Width: 1280, Height: 720, FPS: 30

so the line I've added ("no default profile found..") will set in the middle between these two lines.

If you still prefer duplicating this info in the "no default..." line, I will add it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could do that, but chose this way, because we already print these messages today:

[realsense2_camera_node-1] [INFO] [1674639570.888621178] [camera.camera]: Starting Sensor: RGB Camera
[realsense2_camera_node-1] [INFO] [1674639570.918054720] [camera.camera]: Open profile: stream_type: Color(0), Format: RGB8, Width: 1280, Height: 720, FPS: 30

so the line I've added ("no default profile found..") will set in the middle between these two lines.

If you still prefer duplicating this info in the "no default..." line, I will add it.

Great, I was not aware of it, good enough

Copy link
Collaborator

@Nir-Az Nir-Az left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Nir-Az Nir-Az merged commit 14ef318 into IntelRealSense:ros2-development Jan 25, 2023
@hsuys hsuys mentioned this pull request Jan 26, 2023
@SamerKhshiboun SamerKhshiboun deleted the fix_default_format branch January 30, 2023 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants