mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
"using" directives are no longer used in global namespaces (#219)
This commit is contained in:
committed by
Peter Johnson
parent
78f0b1562c
commit
ba8761e39e
@@ -19,7 +19,8 @@
|
||||
|
||||
GZ_REGISTER_MODEL_PLUGIN(PneumaticPiston)
|
||||
|
||||
void PneumaticPiston::Load(physics::ModelPtr model, sdf::ElementPtr sdf) {
|
||||
void PneumaticPiston::Load(gazebo::physics::ModelPtr model,
|
||||
sdf::ElementPtr sdf) {
|
||||
this->model = model;
|
||||
signal = 0;
|
||||
|
||||
@@ -48,21 +49,21 @@ void PneumaticPiston::Load(physics::ModelPtr model, sdf::ElementPtr sdf) {
|
||||
std::string scoped_name =
|
||||
model->GetWorld()->GetName() + "::" + model->GetScopedName();
|
||||
boost::replace_all(scoped_name, "::", "/");
|
||||
node = transport::NodePtr(new transport::Node());
|
||||
node = gazebo::transport::NodePtr(new gazebo::transport::Node());
|
||||
node->Init(scoped_name);
|
||||
sub = node->Subscribe(topic, &PneumaticPiston::Callback, this);
|
||||
|
||||
// Connect to the world update event.
|
||||
// This will trigger the Update function every Gazebo iteration
|
||||
updateConn = event::Events::ConnectWorldUpdateBegin(
|
||||
updateConn = gazebo::event::Events::ConnectWorldUpdateBegin(
|
||||
boost::bind(&PneumaticPiston::Update, this, _1));
|
||||
}
|
||||
|
||||
void PneumaticPiston::Update(const common::UpdateInfo& info) {
|
||||
void PneumaticPiston::Update(const gazebo::common::UpdateInfo& info) {
|
||||
joint->SetForce(0, signal);
|
||||
}
|
||||
|
||||
void PneumaticPiston::Callback(const msgs::ConstFloat64Ptr& msg) {
|
||||
void PneumaticPiston::Callback(const gazebo::msgs::ConstFloat64Ptr& msg) {
|
||||
if (msg->data() < -0.001) {
|
||||
signal = -reverse_force;
|
||||
} else if (msg->data() > 0.001) {
|
||||
|
||||
Reference in New Issue
Block a user