Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle TethysCommPlugin debug printout #79

Merged
merged 2 commits into from
Nov 15, 2021

Conversation

mabelzhang
Copy link
Collaborator

Because I can't see other printouts amidst this spam (and it was my spam too).

Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea, but I'd personally prefer something that isn't hardcoded and can be more easily toggled from the command line, such as an environment variable. Something like this:

      std::string debugEnv;
      ignition::common::env("TETHYS_COMM_DEBUG", debugEnv);
      this->debugPrintout = (debugEnv == "true");

Then run:

TETHYS_COMM_DEBUG=false ign gazebo buoyant_tethys.sdf

@mabelzhang
Copy link
Collaborator Author

I see the reasoning behind not hardcoding. The SDF parameter is nice practically because it's 1 bit to change, 0 or 1.

Environment variables are more words to remember. I'd likely default it to false, and go look for the variable name in the README to set it to true.

The other nice thing about doing it via SDF is that it checks true/false and 0/1, so the code doesn't need to check for cases and numeric vs. string.

How often are you guys using the printout? I don't look at them anymore. They're useful for debugging low-level controls, communications, and time syncing. I haven't been doing those things.

@chapulina
Copy link
Contributor

I can see the advantages of SDF. It's just a bit more cumbersome to always keep in mind that the SDF file has a change I don't want to commit... While an env var is contained in my own workspace and doesn't get leaked through the source code.

How often are you guys using the printout?

I mostly run with -v 3 so I don't see those anyway 😅 I guess they can be useful when debugging test failures on CI, though I never used them.

@mabelzhang
Copy link
Collaborator Author

Yeah, I know what you mean about not committing things - that was the point I was thinking of too.

But okay, then I think no one is really using those printouts at the moment. I might use them soon when I start to debug the missions again, to check the science sensor data, but for now, it sounds like no one will need to change that SDF parameter. So I'll leave it. We can revisit the env var later if it gets annoying for people (likely me again).

Thanks!

@mabelzhang mabelzhang merged commit 74e76ed into main Nov 15, 2021
@mabelzhang mabelzhang deleted the mabelzhang/tethyscomm_toggle_debug branch November 15, 2021 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants