-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ForceTorque system: write WrenchMeasured to ECM (#2494)
* ForceTorque system: use Update, not PostUpdate and set gz:system_priority to positive value for force_torque system in example and test worlds to ensure it runs after Physics::Update. * Add WrenchMeasured component * Write WrenchMeasured to ECM in ForceTorque::Update if component exists. This allows users to enable writing the sensor data to the ECM by creating the component. * Model.hh: add nested model accessor APIs ModelByName and ModelCount. These are needed for the updated ForceTorque test. * sensor_TEST.py: move PreUpdate callback to Update The test's PreUpdate callback assumes that it executes after the ForceTorque::PreUpdate, so just move it to Update to guarantee it. Signed-off-by: Steve Peters <[email protected]>
- Loading branch information
Showing
13 changed files
with
251 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright (C) 2024 Open Source Robotics Foundation | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
#ifndef GZ_SIM_COMPONENTS_WRENCHMEASURED_HH_ | ||
#define GZ_SIM_COMPONENTS_WRENCHMEASURED_HH_ | ||
|
||
#include <gz/msgs/wrench.pb.h> | ||
|
||
#include <gz/sim/components/Factory.hh> | ||
#include <gz/sim/components/Component.hh> | ||
#include <gz/sim/components/Serialization.hh> | ||
#include <gz/sim/config.hh> | ||
|
||
namespace gz | ||
{ | ||
namespace sim | ||
{ | ||
// Inline bracket to help doxygen filtering. | ||
inline namespace GZ_SIM_VERSION_NAMESPACE { | ||
|
||
namespace components | ||
{ | ||
/// \brief Wrench measured by a ForceTorqueSensor in SI units (Nm for torque, | ||
/// N for force). | ||
/// The wrench is expressed in the Sensor frame and the force component is | ||
/// applied at the sensor origin. | ||
/// \note The term Wrench is used here to mean a pair of 3D vectors representing | ||
/// torque and force quantities expressed in a given frame and where the force | ||
/// is applied at the origin of the frame. This is different from the Wrench | ||
/// used in screw theory. | ||
/// \note The value of force_offset in msgs::Wrench is ignored for this | ||
/// component. The force is assumed to be applied at the origin of the sensor | ||
/// frame. | ||
using WrenchMeasured = | ||
Component<msgs::Wrench, class WrenchMeasuredTag, | ||
serializers::MsgSerializer>; | ||
GZ_SIM_REGISTER_COMPONENT("gz_sim_components.WrenchMeasured", | ||
WrenchMeasured) | ||
} // namespace components | ||
} | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.