Skip to content

Commit

Permalink
Default Accel format changed to XYZ32F
Browse files Browse the repository at this point in the history
Change-Id: I66023b995221ae6f430e9e551b915a544ab2992a
  • Loading branch information
icarpis committed Feb 12, 2018
1 parent 9437bc2 commit 80c9e7e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/ds5/ds5-motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ namespace librealsense
assign_stream(_owner->_gyro_stream, p);
if (p->get_stream_type() == RS2_STREAM_GPIO)
assign_stream(_owner->_gpio_streams[p->get_stream_index()-1], p);
if (p->get_framerate() == 1000)
if (p->get_framerate() == 1000 &&
p->get_format() == RS2_FORMAT_MOTION_XYZ32F)
p->make_default();

//set motion intrinsics
Expand Down
30 changes: 22 additions & 8 deletions tools/terminal/rs-terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ rs2::device wait_for_device(const rs2::device_hub& hub, bool print_info = true)
return dev;
}

void print_dev_info(const rs2::device& dev)
{
std:: cout << "Device Name: " << dev.get_info(RS2_CAMERA_INFO_NAME)
<< "\nDevice Path: " << dev.get_info(RS2_CAMERA_INFO_PHYSICAL_PORT)
<< "\nDevice S/N: " << dev.get_info(RS2_CAMERA_INFO_SERIAL_NUMBER) << std::endl;
}

int main(int argc, char** argv)
{
CmdLine cmd("librealsense rs-terminal example tool", ' ', RS2_API_VERSION_STR);
Expand Down Expand Up @@ -206,7 +213,7 @@ int main(int argc, char** argv)
{
if (device_id_arg.isSet())
{
auto dev_id = device_id_arg.getValue();
uint32_t dev_id = device_id_arg.getValue();
auto num_of_devices = ctx.query_devices().size();
if (num_of_devices < (dev_id + 1))
{
Expand All @@ -215,16 +222,22 @@ int main(int argc, char** argv)
return EXIT_FAILURE;
}

for (int i = 0; i < (num_of_devices - 1); ++i)
if (dev_id != 0)
{
wait_for_device(hub, false);
for (int i = 0; i < (num_of_devices - 1); ++i)
{
wait_for_device(hub, false);
}
}

dev = wait_for_device(hub, false);
std::cout << "\nDevice ID " << dev_id << " has loaded.\n";
print_dev_info(dev);
}
else
{
dev = wait_for_device(hub);
print_dev_info(dev);
}

fflush(nullptr);
Expand Down Expand Up @@ -303,19 +316,20 @@ int main(int argc, char** argv)


line = auto_comp.get_line([&]() {return !hub.is_connected(dev); });

if (line == "exit")
{
return EXIT_SUCCESS;
}

if (!hub.is_connected(dev))
continue;


if (line == "next")
{
dev = wait_for_device(hub);
continue;
}
if (line == "exit")
{
return EXIT_SUCCESS;
}
if (is_application_in_hex_mode)
{
hex_mode(line, dev);
Expand Down

0 comments on commit 80c9e7e

Please sign in to comment.