-
Notifications
You must be signed in to change notification settings - Fork 281
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
Print an error message when trying to load SDF files that don't contain a <world>
#1998
Conversation
Signed-off-by: Henrique-BO <[email protected]>
Signed-off-by: Henrique-BO <[email protected]>
5fbdc81
to
611932c
Compare
src/Server_TEST.cc
Outdated
serverConfig.SetSdfFile(std::string(PROJECT_SOURCE_PATH) + | ||
"/test/worlds/models/sphere/model.sdf"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use common::joinPaths
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 9059a2b.
src/Server_TEST.cc
Outdated
} | ||
|
||
|
||
// Run multiple times. We want to make sure that static globals don't cause |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
// Run multiple times. We want to make sure that static globals don't cause | |
} | |
// Run multiple times. We want to make sure that static globals don't cause |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 9059a2b.
Signed-off-by: Henrique-BO <[email protected]>
Codecov Report
@@ Coverage Diff @@
## ign-gazebo3 #1998 +/- ##
===============================================
+ Coverage 70.71% 70.75% +0.04%
===============================================
Files 262 262
Lines 16759 16763 +4
===============================================
+ Hits 11851 11861 +10
+ Misses 4908 4902 -6
|
<world>
src/Server.cc
Outdated
@@ -182,6 +182,12 @@ Server::Server(const ServerConfig &_config) | |||
return; | |||
} | |||
|
|||
if (this->dataPtr->sdfRoot.WorldCount() == 0) | |||
{ | |||
ignerr << "SDF file doesn't contain a world.\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be helpful to add that if the user wants to spawn a model, they could use the ResourceSpawner GUI plugin or the world/<world name/create
service.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in bee3130.
Signed-off-by: Henrique-BO <[email protected]>
@osrf-jenkins run tests please |
CI is broken on macOS, so I'll go ahead and merge this. |
Note, this should not be forward ported to gz-sim7 because loading model files directly is supported in that branch. |
🦟 Bug fix
Fixes #1941
Summary
Added an error message when attempting to load an SDF file that doesn't contain a world.
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.