@@ -111,10 +111,14 @@ int show(int argc, char * argv[])
111111{
112112 po::variables_map vm;
113113 po::options_description tool (" mc_bin_utils show options" );
114+ bool print_calib = false ;
114115 bool print_events = false ;
116+ bool print_init = false ;
115117 // clang-format off
116118 tool.add_options ()
117119 (" help" , " Produce this message" )
120+ (" print-init" , po::bool_switch (&print_init), " Show initial positions/configurations of the robots" )
121+ (" print-calib" , po::bool_switch (&print_calib), " Show the stored force sensor calibration" )
118122 (" print-events" , po::bool_switch (&print_events), " Show GUI events in the log" )
119123 (" in" , po::value<std::string>(), " Input file" );
120124 // clang-format on
@@ -165,6 +169,40 @@ int show(int argc, char * argv[])
165169 std::cout << " Timestep: " << meta->timestep << " \n " ;
166170 std::cout << " MainRobot: " << meta->main_robot << " \n " ;
167171 std::cout << " MainRobotParams: " << mc_rtc::io::to_string (meta->main_robot_module ) << " \n " ;
172+ if (print_init)
173+ {
174+ for (const auto & [r, init_pos] : meta->init )
175+ {
176+ std::cout << r << " initial pose:\n " ;
177+ std::cout << " translation: " << init_pos.translation ().transpose () << " \n " ;
178+ const auto & q = Eigen::Quaterniond (init_pos.rotation ());
179+ std::cout << " rotation: [" << mc_rtc::io::to_string (std::array{q.w (), q.x (), q.y (), q.z ()}) << " ]\n " ;
180+ }
181+ for (const auto & [r, init_q] : meta->init_q )
182+ {
183+ std::cout << r << " initial configuration:\n " ;
184+ std::cout << " ["
185+ << mc_rtc::io::to_string (init_q,
186+ [](const auto & qi) { return " [" + mc_rtc::io::to_string (qi) + " ]" ; })
187+ << " ]\n " ;
188+ }
189+ }
190+ if (print_calib)
191+ {
192+ for (const auto & [r, calibs] : meta->calibs )
193+ {
194+ if (calibs.empty ())
195+ {
196+ std::cout << r << " : No calibration data\n " ;
197+ continue ;
198+ }
199+ for (const auto & [sensor, calib] : calibs)
200+ {
201+ std::cout << r << " ::" << sensor << " :\n " ;
202+ std::cout << calib.dump (true , true ) << " \n " ;
203+ }
204+ }
205+ }
168206 }
169207 std::cout << " Entries: " << keys.size () << " \n " ;
170208 std::cout << " GUI events: " << n_events << " \n " ;
0 commit comments