Skip to content

Commit

Permalink
Merge pull request #2078 from azeey/3_to_6
Browse files Browse the repository at this point in the history
Merge ign-gazebo3 ➡️  ign-gazebo6
  • Loading branch information
azeey authored Aug 16, 2023
2 parents 7713f2b + b79c9bc commit f686dc0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
8 changes: 5 additions & 3 deletions include/gz/sim/Server.hh
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,15 @@ namespace ignition
///
/// List syntax: *service_name(request_msg_type) : response_msg_type*
///
/// 1. `/world/<world_name>/scene/info(none)` : gz::msgs::Scene
/// 1. `/world/<world_name>/scene/info`(none) : gz::msgs::Scene
/// + Returns the current scene information.
///
/// 2. `/gazebo/resource_paths/get` : gz::msgs::StringMsg_V
/// 2. `/gazebo/resource_paths/get`(gz::msgs::Empty) :
/// gz::msgs::StringMsg_V
/// + Get list of resource paths.
///
/// 3. `/gazebo/resource_paths/add` : gz::msgs::Empty
/// 3. `/gazebo/resource_paths/add`(gz::msgs::StringMsg_V) :
/// gz::msgs::Empty
/// + Add new resource paths.
///
/// 4. `/server_control`(gz::msgs::ServerControl) :
Expand Down
7 changes: 7 additions & 0 deletions src/TestFixture.cc
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,13 @@ TestFixture &TestFixture::OnPostUpdate(std::function<void(
//////////////////////////////////////////////////
std::shared_ptr<Server> TestFixture::Server() const
{
if (!this->dataPtr->finalized)
{
ignwarn << "Fixture has not been finalized, any functions you attempted"
<< "to hook into will not be run. It is recommended to call Finalize()"
<< "before accessing the server."
<< std::endl;
}
return this->dataPtr->server;
}

9 changes: 4 additions & 5 deletions src/systems/apply_link_wrench/ApplyLinkWrench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ void ApplyLinkWrench::Configure(const Entity &_entity,
this->dataPtr->verbose = _sdf->Get<bool>("verbose", true).first;

// Initial wrenches
auto ptr = const_cast<sdf::Element *>(_sdf.get());
for (auto elem = ptr->GetElement("persistent");
for (auto elem = _sdf->FindElement("persistent");
elem != nullptr;
elem = elem->GetNextElement("persistent"))
{
Expand All @@ -163,7 +162,7 @@ void ApplyLinkWrench::Configure(const Entity &_entity,

msg.mutable_entity()->set_name(elem->Get<std::string>("entity_name"));

auto typeStr = elem->GetElement("entity_type")->Get<std::string>();
auto typeStr = elem->FindElement("entity_type")->Get<std::string>();
if (typeStr == "link")
{
msg.mutable_entity()->set_type(msgs::Entity::LINK);
Expand All @@ -182,12 +181,12 @@ void ApplyLinkWrench::Configure(const Entity &_entity,
if (elem->HasElement("force"))
{
msgs::Set(msg.mutable_wrench()->mutable_force(),
elem->GetElement("force")->Get<math::Vector3d>());
elem->FindElement("force")->Get<math::Vector3d>());
}
if (elem->HasElement("torque"))
{
msgs::Set(msg.mutable_wrench()->mutable_torque(),
elem->GetElement("torque")->Get<math::Vector3d>());
elem->FindElement("torque")->Get<math::Vector3d>());
}
this->dataPtr->OnWrenchPersistent(msg);
}
Expand Down

0 comments on commit f686dc0

Please sign in to comment.