-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Populate JointConstraintWrench from physics
Signed-off-by: Addisu Z. Taddese <[email protected]>
- Loading branch information
Showing
5 changed files
with
329 additions
and
1 deletion.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
include/ignition/gazebo/components/JointConstraintWrench.hh
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,52 @@ | ||
/* | ||
* Copyright (C) 2021 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 IGNITION_GAZEBO_COMPONENTS_JOINTCONSTRAINTWRENCH_HH_ | ||
#define IGNITION_GAZEBO_COMPONENTS_JOINTCONSTRAINTWRENCH_HH_ | ||
|
||
#include <array> | ||
|
||
#include <ignition/gazebo/components/Factory.hh> | ||
#include <ignition/gazebo/components/Component.hh> | ||
#include <ignition/gazebo/components/Serialization.hh> | ||
#include <ignition/gazebo/config.hh> | ||
|
||
namespace ignition | ||
{ | ||
namespace gazebo | ||
{ | ||
// Inline bracket to help doxygen filtering. | ||
inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE { | ||
namespace components | ||
{ | ||
/// \brief Joint Constraint wrench in SI units (Nm for revolute, N for | ||
/// prismatic). The first set of 3 values coorespond to the torque while the | ||
/// second set of 3 correspond to the force. The wrench is expressed in the | ||
/// Joint frame and the force component is applied at the joint origin. | ||
/// \note The term Wrench is used here to mean a 6D vector formed by stacking | ||
/// torque and force vectors. This is different from the Wrench used in screw | ||
/// theory. | ||
using JointConstraintWrench = | ||
Component<std::array<double, 6>, class JointConstraintWrenchTag, | ||
serializers::ArrayDoubleSerializer<6>>; | ||
IGN_GAZEBO_REGISTER_COMPONENT("ign_gazebo_components.JointConstraintWrench", | ||
JointConstraintWrench) | ||
} | ||
} | ||
} | ||
} | ||
|
||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
<?xml version="1.0" ?> | ||
<sdf version="1.7"> | ||
<world name="joint_constraints"> | ||
<model name="ground_plane"> | ||
<static>true</static> | ||
<link name="link"> | ||
<collision name="collision"> | ||
<geometry> | ||
<plane> | ||
<normal>0 0 1</normal> | ||
<size>100 100</size> | ||
</plane> | ||
</geometry> | ||
</collision> | ||
<visual name="visual"> | ||
<geometry> | ||
<plane> | ||
<normal>0 0 1</normal> | ||
<size>100 100</size> | ||
</plane> | ||
</geometry> | ||
<material> | ||
<ambient>0.8 0.8 0.8 1</ambient> | ||
<diffuse>0.8 0.8 0.8 1</diffuse> | ||
<specular>0.8 0.8 0.8 1</specular> | ||
<emissive>0.8 0.8 0.8 1</emissive> | ||
</material> | ||
</visual> | ||
</link> | ||
</model> | ||
<light type="directional" name="sun"> | ||
<cast_shadows>true</cast_shadows> | ||
<pose>0 0 10 0 0 0</pose> | ||
<diffuse>1 1 1 1</diffuse> | ||
<specular>0.5 0.5 0.5 1</specular> | ||
<attenuation> | ||
<range>1000</range> | ||
<constant>0.9</constant> | ||
<linear>0.01</linear> | ||
<quadratic>0.001</quadratic> | ||
</attenuation> | ||
<direction>-0.5 0.1 -0.9</direction> | ||
</light> | ||
|
||
<model name="scale"> | ||
<pose>0 0 0.02 0 0 0</pose> | ||
<link name="base"> | ||
<inertial> | ||
<mass>2.0</mass> | ||
<inertia> | ||
<ixx>0.166933</ixx> | ||
<iyy>0.166933</iyy> | ||
<izz>0.333333</izz> | ||
</inertia> | ||
</inertial> | ||
<visual name="v1"> | ||
<geometry> | ||
<box> | ||
<size>1 1 0.04</size> | ||
</box> | ||
</geometry> | ||
</visual> | ||
<collision name="c1"> | ||
<geometry> | ||
<box> | ||
<size>1 1 0.04</size> | ||
</box> | ||
</geometry> | ||
</collision> | ||
</link> | ||
<link name="sensor_plate"> | ||
<pose relative_to="base">0 0 0.03 0 0 0</pose> | ||
<inertial> | ||
<mass>0.2</mass> | ||
<inertia> | ||
<ixx>0.0166933</ixx> | ||
<iyy>0.0166933</iyy> | ||
<izz>0.0333333</izz> | ||
</inertia> | ||
</inertial> | ||
<visual name="v1"> | ||
<geometry> | ||
<box> | ||
<size>0.9 0.9 0.01</size> | ||
</box> | ||
</geometry> | ||
<material> | ||
<ambient>0.8 0.2 0.2 1</ambient> | ||
<diffuse>0.8 0.2 0.2 1</diffuse> | ||
<specular>0.8 0.2 0.2 1</specular> | ||
</material> | ||
</visual> | ||
<collision name="c1"> | ||
<geometry> | ||
<box> | ||
<size>0.9 0.9 0.01</size> | ||
</box> | ||
</geometry> | ||
</collision> | ||
</link> | ||
|
||
<joint name="sensor_joint" type="fixed"> | ||
<parent>base</parent> | ||
<child>sensor_plate</child> | ||
</joint> | ||
</model> | ||
|
||
<model name="weight"> | ||
<pose>0 0 0.5 0 0 0</pose> | ||
<link name="base"> | ||
<inertial> | ||
<mass>10</mass> | ||
</inertial> | ||
<visual name="v1"> | ||
<geometry> | ||
<box> | ||
<size>0.5 0.5 0.5</size> | ||
</box> | ||
</geometry> | ||
<material> | ||
<ambient>0.0 0.8 0.8 1</ambient> | ||
<diffuse>0.0 0.8 0.8 1</diffuse> | ||
<specular>0.0 0.8 0.8 1</specular> | ||
</material> | ||
</visual> | ||
<collision name="c1"> | ||
<geometry> | ||
<box> | ||
<size>0.5 0.5 0.5</size> | ||
</box> | ||
</geometry> | ||
</collision> | ||
</link> | ||
</model> | ||
|
||
</world> | ||
</sdf> |