Skip to content

Commit

Permalink
Expose headless_rendering sdf tag
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya <[email protected]>
  • Loading branch information
adityapande-1995 committed Feb 16, 2022
1 parent 26ef785 commit 1fba16a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions plugins/gazebo_server/GazeboServer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,15 @@ bool GazeboServer::Load(const tinyxml2::XMLElement *_elem)
serverConfig.AddPlugin({entityName, entityType, file, name, sdf});
}

// Set headless rendering
elem = _elem->FirstChildElement("headless_rendering");
if (elem)
{
std::string str = elem->GetText();
serverConfig.SetHeadlessRendering(str == "1" ||
common::lowercase(str) == "true");
}

// Create and run the simulation server
this->server.reset(new gazebo::Server(serverConfig));
this->server->Run(false, 0, !run);
Expand Down

0 comments on commit 1fba16a

Please sign in to comment.