Skip to content

Commit

Permalink
Use the actor tension parameter (#1091)
Browse files Browse the repository at this point in the history
* Use the actor tension parameter

Signed-off-by: Nate Koenig <[email protected]>

* bump to ign-common 4.4

Signed-off-by: Nate Koenig <[email protected]>

Co-authored-by: Nate Koenig <[email protected]>
  • Loading branch information
nkoenig and Nate Koenig authored Oct 20, 2021
1 parent 614340c commit 3a1adb3
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ set(IGN_MSGS_VER ${ignition-msgs8_VERSION_MAJOR})
#--------------------------------------
# Find ignition-common
# Always use the profiler component to get the headers, regardless of status.
ign_find_package(ignition-common4 VERSION 4.2
ign_find_package(ignition-common4 VERSION 4.4
COMPONENTS
profiler
events
Expand Down
54 changes: 54 additions & 0 deletions examples/worlds/actor.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,59 @@
</link>
</model>

<actor name="actor_walking">
<skin>
<filename>https://fuel.ignitionrobotics.org/1.0/Mingfei/models/actor/tip/files/meshes/walk.dae</filename>
<scale>1.0</scale>
</skin>
<animation name="walk">
<filename>https://fuel.ignitionrobotics.org/1.0/Mingfei/models/actor/tip/files/meshes/walk.dae</filename>
<interpolate_x>true</interpolate_x>
</animation>
<script>
<loop>true</loop>
<delay_start>0.000000</delay_start>
<auto_start>true</auto_start>
<trajectory id="0" type="walk" tension="0.6">
<waypoint>
<time>0</time>
<pose>3 4 1.0 0 0 0</pose>
</waypoint>
<waypoint>
<time>2</time>
<pose>5 4 1.0 0 0 0</pose>
</waypoint>
<waypoint>
<time>2.5</time>
<pose>5 4 1.0 0 0 1.57</pose>
</waypoint>
<waypoint>
<time>4</time>
<pose>5 6 1.0 0 0 1.57</pose>
</waypoint>
<waypoint>
<time>4.5</time>
<pose>5 6 1.0 0 0 3.142</pose>
</waypoint>
<waypoint>
<time>6</time>
<pose>3 6 1 0 0 3.142</pose>
</waypoint>
<waypoint>
<time>6.5</time>
<pose>3 6 1 0 0 -1.57</pose>
</waypoint>
<waypoint>
<time>8</time>
<pose>3 4 1.0 0 0 -1.57</pose>
</waypoint>
<waypoint>
<time>8.5</time>
<pose>3 4 1.0 0 0 0</pose>
</waypoint>
</trajectory>
</script>
</actor>

</world>
</sdf>
2 changes: 1 addition & 1 deletion src/rendering/SceneManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ rendering::VisualPtr SceneManager::CreateActor(Entity _id,
static_cast<int>(point->Time()*1000)));
waypoints[pointTp] = point->Pose();
}
trajInfo.SetWaypoints(waypoints);
trajInfo.SetWaypoints(waypoints, trajSdf->Tension());
// Animations are offset by 1 because index 0 is taken by the mesh name
auto animation = _actor.AnimationByIndex(trajInfo.AnimIndex()-1);

Expand Down

0 comments on commit 3a1adb3

Please sign in to comment.