Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

WIP: Fix loading home gait error #108

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,12 @@ def import_gait(self):
return
if gait.gait_type is None or gait.gait_type == '':
gait.gait_type = 'walk_like'

if any([len(joint._setpoints) == 1 for joint in gait.joints]):
rospy.logwarn('Cannot load a gait with only one setpoint')
self.view.message(title='Error', msg='Cannot load a gait with only one setpoint')
return

self.subgait = gait

was_playing = self.time_slider_thread is not None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,17 @@ def test_import_gait_cancel(self):
except FileNotFoundError:
self.fail('Import gait raised FileNotFoundError')

def test_import_gait_one_setpoint(self):
subgait_path = '{rsc}/{gait}/{subgait}/{version}.subgait'.format(rsc=self.resources_folder,
gait='home',
subgait='home_sit',
version='MIV_ankle_0')
self.gait_generator_view.open_file_dialogue = Mock(return_value=(subgait_path, None))
try:
self.gait_generator_controller.import_gait()
except TypeError:
self.fail('Import gait raised TypeError')

def test_import_gait(self):
self.gait_generator_view.open_file_dialogue = Mock(return_value=(self.subgait_path, None))

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
description: Home sit gait for the sitting block. This version has 5 degrees more
hip extension in comparison to the MIII home gait
duration: {nsecs: 0, secs: 3}
gait_type: ''
joints:
left_ankle:
- position: 0.0
time_from_start: {nsecs: 0, secs: 3}
velocity: 0.0
left_hip_aa:
- position: 0.0
time_from_start: {nsecs: 0, secs: 3}
velocity: 0.0
left_hip_fe:
- position: 1.2217
time_from_start: {nsecs: 0, secs: 3}
velocity: 0.0
left_knee:
- position: 1.5708
time_from_start: {nsecs: 0, secs: 3}
velocity: 0.0
right_ankle:
- position: 0.0
time_from_start: {nsecs: 0, secs: 3}
velocity: 0.0
right_hip_aa:
- position: 0.0
time_from_start: {nsecs: 0, secs: 3}
velocity: 0.0
right_hip_fe:
- position: 1.2217
time_from_start: {nsecs: 0, secs: 3}
velocity: 0.0
right_knee:
- position: 1.5708
time_from_start: {nsecs: 0, secs: 3}
velocity: 0.0
name: home_sit
version: MIV_ankle_0