Add format script which invokes clang-format on the C++ source code (#41)

On Windows machines, clang-format.exe must be in the PATH environment variable.
This commit is contained in:
Tyler Veness
2016-05-20 17:30:37 -07:00
committed by Peter Johnson
parent 68690643d2
commit e14e45da76
383 changed files with 13787 additions and 13198 deletions

View File

@@ -20,13 +20,14 @@ void Clock::Load(physics::ModelPtr model, sdf::ElementPtr sdf) {
if (sdf->HasElement("topic")) {
topic = sdf->Get<std::string>("topic");
} else {
topic = "~/"+sdf->GetAttribute("name")->GetAsString();
topic = "~/" + sdf->GetAttribute("name")->GetAsString();
}
gzmsg << "Initializing clock: " << topic << std::endl;
// Connect to Gazebo transport for messaging
std::string scoped_name = model->GetWorld()->GetName()+"::"+model->GetScopedName();
std::string scoped_name =
model->GetWorld()->GetName() + "::" + model->GetScopedName();
boost::replace_all(scoped_name, "::", "/");
node = transport::NodePtr(new transport::Node());
node->Init(scoped_name);
@@ -34,10 +35,11 @@ void Clock::Load(physics::ModelPtr model, sdf::ElementPtr sdf) {
// Connect to the world update event.
// This will trigger the Update function every Gazebo iteration
updateConn = event::Events::ConnectWorldUpdateBegin(boost::bind(&Clock::Update, this, _1));
updateConn = event::Events::ConnectWorldUpdateBegin(
boost::bind(&Clock::Update, this, _1));
}
void Clock::Update(const common::UpdateInfo &info) {
void Clock::Update(const common::UpdateInfo& info) {
msgs::Float64 msg;
msg.set_data(info.simTime.Double());
pub->Publish(msg);