Skip to content

Commit

Permalink
Fix running simulation with no world specified on the command line (#…
Browse files Browse the repository at this point in the history
…1463)

Signed-off-by: Nate Koenig <[email protected]>

Co-authored-by: Nate Koenig <[email protected]>
  • Loading branch information
nkoenig and Nate Koenig authored May 2, 2022
1 parent 0a5828e commit b6186a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/ignition/gazebo/ServerConfig.hh
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ namespace ignition
/// Setting the SDF file will override any value set by `SetSdfString`.
///
/// \param[in] _file Full path to an SDF file.
/// \return (reserved for future use)
/// \return True if the file was set, false if the file was not set.
/// The file will not be set if the provide _file string is empty.
public: bool SetSdfFile(const std::string &_file);

/// \brief Get the SDF file that has been set. An empty string will be
Expand Down
3 changes: 3 additions & 0 deletions src/ServerConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,9 @@ ServerConfig::~ServerConfig() = default;
//////////////////////////////////////////////////
bool ServerConfig::SetSdfFile(const std::string &_file)
{
if (_file.empty())
return false;

this->dataPtr->source = ServerConfig::SourceType::kSdfFile;
this->dataPtr->sdfFile = _file;
this->dataPtr->sdfString = "";
Expand Down

0 comments on commit b6186a8

Please sign in to comment.