Skip to content

Commit

Permalink
Fixed an issue where a value error occurred when optional files were …
Browse files Browse the repository at this point in the history
…not provided.
  • Loading branch information
flxalr committed Dec 19, 2021
1 parent 53abbf2 commit 6783078
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/locomotionbench/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,13 +418,16 @@ def are_columns_matching(self, body_map):
def reindex_columns(self, body_map):
# TODO check order for all files in a smart way
self.files['pos'] = self.get_file('pos').reindex(columns=['time'] + body_map)
self.files['vel'] = self.get_file('vel').reindex(columns=['time'] + body_map)
if 'vel' not in self.files_not_provided:
self.files['vel'] = self.get_file('vel').reindex(columns=['time'] + body_map)
if 'acc' not in self.files_not_provided:
self.files['acc'] = self.get_file('acc').reindex(columns=['time'] + body_map)
if 'trq' not in self.files_not_provided:
self.files['trq'] = self.get_file('trq').reindex(columns=['time'] + body_map)

def open_file(self, file_type, file, separator):
if file is None:
return file_type
try:
self.files[file_type] = pd.read_csv(file, sep=separator)
except FileNotFoundError as err:
Expand Down
2 changes: 1 addition & 1 deletion src/script/run_i3sa.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def main(args):


ENTRY_USAGE = """
usage: run_i3s1 tests/reemc_conf/robot.yaml tests/reemc_conf/reemc.lua tests/input/2021_02_19/14/1/pos.csv tests/input/2021_02_19/14/1/vel.csv tests/input/2021_02_19/14/1/acc.csv tests/input/2021_02_19/14/1/trq.csv tests/input/2021_02_19/14/1/ftl.csv tests/input/2021_02_19/14/1/ftr.csv tests/input/2021_02_19/14/1/gaitEvents.yaml output/
usage: run_i3sa tests/reemc_conf/robot.yaml tests/reemc_conf/reemc.lua tests/input/2021_02_19/14/1/pos.csv tests/input/2021_02_19/14/1/vel.csv tests/input/2021_02_19/14/1/acc.csv tests/input/2021_02_19/14/1/trq.csv tests/input/2021_02_19/14/1/ftl.csv tests/input/2021_02_19/14/1/ftr.csv tests/input/2021_02_19/14/1/gaitEvents.yaml output/
robot.yaml: robot specific data
robot.lua: robot description
joint_states.csv: joint angle file
Expand Down

0 comments on commit 6783078

Please sign in to comment.