11 #include "../example.hpp" 20 int main(
int argc,
char * argv[])
try 29 bool choose_a_device =
true;
30 while (choose_a_device)
39 bool choose_a_sensor =
true;
40 while (choose_a_sensor)
46 bool control_sensor =
true;
47 while (control_sensor)
50 std::cout <<
"What would you like to do with the sensor?\n" << std::endl;
52 for (
auto&&
action : sensor_actions)
57 if (selected_action_index >= sensor_actions.size())
59 throw std::out_of_range(
"Selected action index is out of range");
62 auto selected_action = sensor_actions[selected_action_index].first;
68 selected_action(dev, sensor);
69 repeat =
prompt_yes_no(sensor_actions[selected_action_index].second +
" again?");
71 control_sensor =
prompt_yes_no(
"Choose another action for this sensor?");
87 catch (
const std::exception & e)
117 std::cout <<
"Please choose a sensor and then a stream that will be used as the origin of extrinsic transformation:\n" << std::endl;
121 std::cout <<
"Please choose a sensor and then a stream that will be used as the target of extrinsic transformation::\n" << std::endl;
131 return std::vector<sensor_action> {
bool prompt_yes_no(const std::string &prompt_msg)
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
static const textual_icon repeat
void control_sensor_options(rs2::device device, rs2::sensor sensor)
GLsizei const GLchar *const * string
void show_stream_intrinsics(rs2::device device, rs2::sensor sensor)
static void start_streaming_a_profile(const rs2::sensor &sensor, const rs2::stream_profile &stream_profile)
int main(int argc, char *argv[])
const std::string & get_failed_args() const
static rs2::sensor get_a_sensor_from_a_device(const rs2::device &dev)
static void print_device_information(const rs2::device &dev)
static rs2::stream_profile choose_a_streaming_profile(const rs2::sensor &sensor)
std::pair< std::function< void(rs2::device, rs2::sensor)>, std::string > sensor_action
void display_live_stream(rs2::device device, rs2::sensor sensor)
static void change_sensor_option(const rs2::sensor &sensor, rs2_option option_type)
uint32_t get_user_selection(const std::string &prompt_message)
static void get_extrinsics(const rs2::stream_profile &from_stream, const rs2::stream_profile &to_stream)
static void get_field_of_view(const rs2::stream_profile &stream)
void show_extrinsics_between_streams(rs2::device device, rs2::sensor sensor)
static rs2_option get_sensor_option(const rs2::sensor &sensor)
std::vector< sensor_action > create_sensor_actions()
static rs2::device get_a_realsense_device()
const std::string & get_failed_function() const