Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def main(args):
separators=(',', ': ')))

if __name__ == '__main__':
parser = argparse.ArgumentParser("LibMultiSense save image utility")
parser = argparse.ArgumentParser("LibMultiSense device info utility")
parser.add_argument("-a", "--ip_address", default="10.66.171.21", help="The IPv4 address of the MultiSense.")
parser.add_argument("-m", "--mtu", type=int, default=1500, help="The MTU to use to communicate with the camera.")
main(parser.parse_args())
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def main(args):
write_cal(intrinsics, extrinsics, 3, calibration.aux)

if __name__ == '__main__':
parser = argparse.ArgumentParser("LibMultiSense save image utility")
parser = argparse.ArgumentParser("LibMultiSense image cal utility")
parser.add_argument("-a", "--ip_address", default="10.66.171.21", help="The IPv4 address of the MultiSense.")
parser.add_argument("-m", "--mtu", type=int, default=1500, help="The MTU to use to communicate with the camera.")
parser.add_argument("-i", "--intrinsics", required=True, help="The path to the intrinsics file to read from/write to.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ int main(int argc, char** argv)
}
}

if (!rectified_focal_length || rectified_focal_length.value() < 0.0)
if ((!rectified_focal_length || rectified_focal_length.value() < 0.0) && set)
{
std::cerr << "Invalid input rectified focal length" << std::endl;;
std::cerr << "Invalid input rectified focal length" << std::endl;
usage(*argv);
}

Expand All @@ -131,10 +131,10 @@ int main(int argc, char** argv)

const auto current_calibration = channel->get_calibration();

const auto new_calibration = update_calibration(current_calibration, rectified_focal_length.value());

if (set)
{
const auto new_calibration = update_calibration(current_calibration, rectified_focal_length.value());

if (channel->set_calibration(new_calibration) != lms::Status::OK)
{
std::cerr << "Failed to set the updated calibration" << std::endl;
Expand All @@ -143,7 +143,7 @@ int main(int argc, char** argv)
}
else
{
std::cout << "Please add the \"-s\" argument to write the new rectified focal length to the camera" << std::endl;
std::cout << "Current focal length: " << current_calibration.left.P[0][0] << "px" << std::endl;
}

return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,23 @@ def main(args):
print("Invalid channel")
exit(1)

current_calibration = channel.get_calibration();

new_calibration = update_calibration(current_calibration, args.rectified_focal_length)
current_calibration = channel.get_calibration()

if args.set:
if args.rectified_focal_length is None:
print("Unable to set new focal length, --rectified-focal-length (-r) is required when trying to --set")
exit(1)
new_calibration = update_calibration(current_calibration, args.rectified_focal_length)
if channel.set_calibration(new_calibration) != lms.Status.OK:
print("Failed to set the updated calibration")
exit(1)
else:
print("Current focal length: " + str(current_calibration.left.P[0][0]) + "px")

if __name__ == '__main__':
parser = argparse.ArgumentParser("LibMultiSense save image utility")
parser = argparse.ArgumentParser("LibMultiSense rectified focal length utility")
parser.add_argument("-a", "--ip_address", default="10.66.171.21", help="The IPv4 address of the MultiSense.")
parser.add_argument("-m", "--mtu", type=int, default=1500, help="The MTU to use to communicate with the camera.")
parser.add_argument("-r", "--rectified-focal-length", type=float, required=True, help="The new rectified focal length")
parser.add_argument("-s", "--set", action="store_true", help="Write the new calibration to camera")
parser.add_argument("-r", "--rectified-focal-length", type=float, help="The new rectified focal length")
parser.add_argument("-s", "--set", action="store_true", help="Write the new calibration to camera (default query)")
main(parser.parse_args())
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ def main(args):
parser.add_argument("-a", "--ip_address", default="10.66.171.21", help="The IPv4 address of the MultiSense.")
parser.add_argument("-m", "--mtu", type=int, default=1500, help="The MTU to use to communicate with the camera.")
parser.add_argument("-n", "--number-of-images", type=int, default=1, help="The number of images to save.")
parser.add_argument("-d", "--save-depth", action='store_true', help="Save a 16 bit depth image.")
parser.add_argument("-l", "--save-left-rect", action='store_true', help="Save a left rectified image.")
parser.add_argument("-c", "--save-color", action='store_true', help="Save a color image.")
streams_group = parser.add_mutually_exclusive_group(required=True)
streams_group.add_argument("-d", "--save-depth", action='store_true', help="Save a 16 bit depth image.")
streams_group.add_argument("-l", "--save-left-rect", action='store_true', help="Save a left rectified image.")
streams_group.add_argument("-c", "--save-color", action='store_true', help="Save a color image.")
main(parser.parse_args())
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def main(args):
print("Hardware version : ", hex(info.version.hardware_version))

if __name__ == '__main__':
parser = argparse.ArgumentParser("LibMultiSense save image utility")
parser = argparse.ArgumentParser("LibMultiSense version info utility")
parser.add_argument("-a", "--ip_address", default="10.66.171.21", help="The IPv4 address of the MultiSense.")
parser.add_argument("-m", "--mtu", type=int, default=1500, help="The MTU to use to communicate with the camera.")
main(parser.parse_args())