-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Physics: remove *VelocityCmd at each time step #2228
Changes from 9 commits
4070cac
740071a
ac58022
c963956
f6ecc61
b145c05
7dc33fe
120e5fe
be5214f
f4ffd4a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,13 @@ Deprecated code produces compile-time warnings. These warning serve as | |
notification to users that their code should be upgraded. The next major | ||
release will remove the deprecated code. | ||
|
||
## Gazebo Sim 8.x to 9.0 | ||
|
||
* **Modified**: | ||
+ In the Physics system, all `*VelocityCmd` components are deleted after | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. mention that previously it was setting them to zero? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
each time step. Persistent velocity commands should be reapplied at | ||
each time step. | ||
|
||
## Gazebo Sim 7.x to 8.0 | ||
* **Deprecated** | ||
+ `gz::sim::components::Factory::Register(const std::string &_type, ComponentDescriptorBase *_compDesc)` and | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -447,14 +447,6 @@ void MulticopterMotorModel::PreUpdate(const UpdateInfo &_info, | |
doUpdateForcesAndMoments = false; | ||
} | ||
|
||
if (!_ecm.Component<components::JointVelocityCmd>( | ||
this->dataPtr->jointEntity)) | ||
{ | ||
_ecm.CreateComponent(this->dataPtr->jointEntity, | ||
components::JointVelocityCmd({0})); | ||
doUpdateForcesAndMoments = false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to preserve the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no, the other places that variable is set to false is when a physics state / sensor reading component is unavailable that is needed for the control calculation, but |
||
} | ||
|
||
if (!_ecm.Component<components::WorldPose>(this->dataPtr->linkEntity)) | ||
{ | ||
_ecm.CreateComponent(this->dataPtr->linkEntity, components::WorldPose()); | ||
|
@@ -682,11 +674,10 @@ void MulticopterMotorModelPrivate::UpdateForcesAndMoments( | |
refMotorRotVel = this->rotorVelocityFilter->UpdateFilter( | ||
this->refMotorInput, this->samplingTime); | ||
|
||
const auto jointVelCmd = _ecm.Component<components::JointVelocityCmd>( | ||
this->jointEntity); | ||
*jointVelCmd = components::JointVelocityCmd( | ||
{this->turningDirection * refMotorRotVel | ||
/ this->rotorVelocitySlowdownSim}); | ||
_ecm.SetComponentData<components::JointVelocityCmd>( | ||
this->jointEntity, | ||
{this->turningDirection * refMotorRotVel | ||
/ this->rotorVelocitySlowdownSim}); | ||
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,7 +91,7 @@ | |
</geometry> | ||
</collision> | ||
<visual name="rotor_0_visual"> | ||
<pose>0 0 0 1.57 0 0 0</pose> | ||
<pose>0 0 0 1.57 0 0</pose> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I realized last week while trying to fix another test that the quadcopter test is passing even though this SDF was invalid. I'll be making the same changes in other branches. |
||
<geometry> | ||
<cylinder> | ||
<length>0.2</length> | ||
|
@@ -136,7 +136,7 @@ | |
</geometry> | ||
</collision> | ||
<visual name="rotor_1_visual"> | ||
<pose>0 0 0 1.57 0 0 0</pose> | ||
<pose>0 0 0 1.57 0 0</pose> | ||
<geometry> | ||
<cylinder> | ||
<length>0.2</length> | ||
|
@@ -181,7 +181,7 @@ | |
</geometry> | ||
</collision> | ||
<visual name="rotor_2_visual"> | ||
<pose>0 0 0 1.57 0 0 0</pose> | ||
<pose>0 0 0 1.57 0 0</pose> | ||
<geometry> | ||
<cylinder> | ||
<length>0.2</length> | ||
|
@@ -226,7 +226,7 @@ | |
</geometry> | ||
</collision> | ||
<visual name="rotor_3_visual"> | ||
<pose>0 0 0 1.57 0 0 0</pose> | ||
<pose>0 0 0 1.57 0 0</pose> | ||
<geometry> | ||
<cylinder> | ||
<length>0.2</length> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this!