Skip to content
Open
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
22 changes: 22 additions & 0 deletions src/steelhead_gazebo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,31 @@ At this point your model should be ready to be added to a Gazebo world, you can

[How to import Solidworks model into Gazebo](https://docs.google.com/document/d/1LrzAUCPOdZPh-uzIDg-aMNJGaX13d3AJjA7XWy2pFQQ/edit)


## Debugging / Verbose Logging
By default, `gazebo_launch.py` runs gzserver with `verbose:=false` to keep the terminal
clean. If you need to see Gazebo's internal debug output (e.g. plugin parameter loading,
SDF parsing details), run with:

ros2 launch steelhead_gazebo gazebo_launch.py verbose:=true

Even with `verbose:=true`, most of the detailed parameter dumps (added_mass matrices,
damping vectors, etc.) are written to Gazebo's log file rather than the terminal, to
avoid flooding the console. If you need to inspect these, check the gzserver log,
which is written to a PID-specific folder under `~/.gazebo/`, e.g.:

~/.gazebo/server-11345/default.log

The PID changes every run, so use `ls ~/.gazebo/` to find the most recent `server-*`
folder if you're not sure which one to check.

This is the first place to look if you suspect a hydrodynamics plugin isn't picking up
an SDF parameter correctly, but don't see anything obviously wrong in the terminal output.

## Contributors

- Logan Fillo (logan.fillo@gmail.com)
- Jake Cronin (jcronin97@live.ca)
- Kevin Huang (kevinh42@student.ubc.ca)
- Jared Chan (jaredchan42@gmail.com)
- Krishna Garcha (garchakri@gmail.com)
2 changes: 1 addition & 1 deletion src/steelhead_gazebo/gazebo_utils/include/gazebo_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace steelhead_gazebo
value = _sdf->Get<parameter>(param);
*status = true;
}
gzdbg << param << ": " << value << std::endl;
gzlog << param << ": " << value << std::endl;
return value;
}

Expand Down
3 changes: 1 addition & 2 deletions src/steelhead_gazebo/gazebo_utils/src/gazebo_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace steelhead_gazebo
gzdbg << "Vector parameter '" << param << "' contained " << idx << " values; using defaults for remaining " << (MAX_DIMENSION - idx) << ".\n";
}
*status = true;
gzdbg << param << ": \n" << _vector << std::endl;
gzlog << param << ": \n" << _vector << std::endl;

return _vector;
}
Expand Down Expand Up @@ -69,7 +69,6 @@ namespace steelhead_gazebo
}
*status = true;
gzdbg << param << ": \n" << _matrix << std::endl;

return _matrix;
}

Expand Down
10 changes: 9 additions & 1 deletion src/steelhead_gazebo/launch/gazebo_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ def generate_launch_description():
default_value='false',
description="Set to 'true' to run gazebo headless"
)

verbose_arg = DeclareLaunchArgument(
'verbose',
default_value='false',
description="Set to 'true' for verbose gzserver debug output"
)

# We need to add the models and worlds directories to env so gazebo can find them
steelhead_gazebo_dir = get_package_share_directory('steelhead_gazebo')
Expand Down Expand Up @@ -53,7 +59,8 @@ def generate_launch_description():
),
launch_arguments={
'world': ['worlds/', LaunchConfiguration('world')],
'verbose': 'true'
'verbose': LaunchConfiguration('verbose')
# 'verbose': 'true'
}.items()
)

Expand All @@ -67,6 +74,7 @@ def generate_launch_description():

ld.add_action(world_arg)
ld.add_action(headless_arg)
ld.add_action(verbose_arg)
ld.add_action(add_model_path)
ld.add_action(add_resource_path)
ld.add_action(gazebo_server)
Expand Down
1 change: 1 addition & 0 deletions src/steelhead_gazebo/src/smooth_camera_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ namespace steelhead_gazebo
phi = -1;
incr_phi = 0;
std::cout << "END ME PLEASE" << std::endl;
// gzmsg << "SmoothCamera: completed orbit sweep across full radius range [" << radius_range_[0] << ", " << radius_range_[1] << "]. Camera will stop moving.\n";
return;
}
}
Expand Down