-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
if default profile is not defined, take the first available profile as default #2601
Conversation
@@ -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."); |
There was a problem hiding this comment.
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..
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Tracked by LRS-638