-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved PlanarTerrain to a dedicated file
- Loading branch information
Showing
5 changed files
with
46 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,6 @@ | |
foot_contact_state_plotter, | ||
humanoid_state_visualizer, | ||
interpolators, | ||
planar_terrain, | ||
terrain_descriptor, | ||
) |
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,41 @@ | ||
import casadi as cs | ||
|
||
from hippopt.robot_planning.utilities.terrain_descriptor import TerrainDescriptor | ||
|
||
|
||
class PlanarTerrain(TerrainDescriptor): | ||
def create_height_function(self) -> cs.Function: | ||
point_position = cs.MX.sym(self.get_point_position_name(), 3) | ||
|
||
return cs.Function( | ||
"planar_terrain_height", | ||
[point_position], | ||
[point_position[2]], | ||
[self.get_point_position_name()], | ||
["point_height"], | ||
self._options, | ||
) | ||
|
||
def create_normal_direction_function(self) -> cs.Function: | ||
point_position = cs.MX.sym(self.get_point_position_name(), 3) | ||
|
||
return cs.Function( | ||
"planar_terrain_normal", | ||
[point_position], | ||
[cs.MX.eye(3)[:, 2]], | ||
[self.get_point_position_name()], | ||
["normal_direction"], | ||
self._options, | ||
) | ||
|
||
def create_orientation_function(self) -> cs.Function: | ||
point_position = cs.MX.sym(self.get_point_position_name(), 3) | ||
|
||
return cs.Function( | ||
"planar_terrain_orientation", | ||
[point_position], | ||
[cs.MX.eye(3)], | ||
[self.get_point_position_name()], | ||
["plane_rotation"], | ||
self._options, | ||
) |
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