Skip to content

Commit

Permalink
Optional physics features (#62)
Browse files Browse the repository at this point in the history
* Add and use entityCast helper function

* return early for missing features

* move minimum map out of entityCast

Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Nate Koenig <nate@openrobotics.org>
  • Loading branch information
chapulina authored and Nate Koenig committed May 6, 2020
1 parent 72d7f2b commit d623292
Show file tree
Hide file tree
Showing 5 changed files with 274 additions and 63 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ ign_find_package(ignition-physics1
mesh
sdf
REQUIRED
VERSION 1.6)
VERSION 1.7)
set(IGN_PHYSICS_VER ${ignition-physics1_VERSION_MAJOR})

#--------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion src/systems/diff_drive/DiffDrive.cc
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,11 @@ void DiffDrivePrivate::UpdateOdometry(const ignition::gazebo::UpdateInfo &_info,
this->rightJoints[0]);

// Abort if the joints were not found or just created.
if (!leftPos || !rightPos)
if (!leftPos || !rightPos || leftPos->Data().empty() ||
rightPos->Data().empty())
{
return;
}

this->odom.Update(leftPos->Data()[0], rightPos->Data()[0],
std::chrono::steady_clock::time_point(_info.simTime));
Expand Down
Loading

0 comments on commit d623292

Please sign in to comment.