0
$\begingroup$

Gazebo Answers logo

I'm trying to use gzerr to output error messages to the console in which gazebo is running from. If I put the following code in my model plugin's load method, the gzerr text never shows in the console.

gzerr << "this message never gets displayed\n";
std::cout << "this message gets displayed just fine" << std::endl;

I'm starting gazebo using the "gazebo" command, and I have verified with an std::cout that the plugin's load method is getting called. I've also made sure that gazebo/common/Console.h is included. I've also tried using sdferr the same way as gzerr, and sdferr works exactly as expected.

What am I doing wrong?


Originally posted by pcdangio on Gazebo Answers with karma: 207 on 2016-04-13

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

Run Gazebo in verbose mode:

gazebo --verbose 

Originally posted by chapulina with karma: 7504 on 2016-04-13

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by pcdangio on 2016-04-14:
Thanks! Interesting that by default error messages won't show up. What's the proper way then, to notify the user of an error if not running in verbose mode?

Comment by chapulina on 2016-04-14:
It depends on the "user". If it's someone who will be using the command line, you'd use the verbose mode. If it's a graphical interface user, you could make a GUI plugin which prints messages to the screen.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.