-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for running the simulation with pixi, optionally with the…
… ma97 linear solver (#1)
- Loading branch information
1 parent
c937d1a
commit 4d2d60a
Showing
11 changed files
with
9,813 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# SCM syntax highlighting | ||
pixi.lock linguist-language=YAML linguist-generated=true |
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
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,3 @@ | ||
# We do not want to accidentally push the non-distributable source files | ||
# to the repo, so we add it in the .gitignore | ||
coinhsl-2023.11.17.zip |
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,40 @@ | ||
import os | ||
import zipfile | ||
import sys | ||
|
||
# Define file and directories | ||
file_path = './coinhsl_src/coinhsl-2023.11.17.zip' | ||
output_dir = './.build-coinhsl' | ||
|
||
def main(): | ||
if os.path.exists(file_path): | ||
print(f"File '{file_path}' found. Proceeding to unzip...") | ||
|
||
# Ensure the output directory exists | ||
os.makedirs(output_dir, exist_ok=True) | ||
|
||
# Unzipping the file | ||
try: | ||
with zipfile.ZipFile(file_path, 'r') as zip_ref: | ||
zip_ref.extractall(output_dir) | ||
print(f"File unzipped successfully to '{output_dir}'.") | ||
except zipfile.BadZipFile: | ||
print("Error: The file is not a valid ZIP archive.") | ||
sys.exit(1) | ||
else: | ||
print(f"Error: File '{file_path}' does not exist.") | ||
print(""" | ||
Please follow these steps to resolve the issue: | ||
1. Go to https://licences.stfc.ac.uk/product/coin-hsl, and: | ||
- If you already have a license for Coin-HSL: | ||
- Go to https://licences.stfc.ac.uk/account/orders and find the coin-hsl order. | ||
- Download the coinhsl-2023.11.17.zip file and place it in the './coinhsl_src' folder of this repository. | ||
- If you do not have a license for Coin-HSL: | ||
- If you are an academic, request a license at https://licences.stfc.ac.uk/product/coin-hsl. | ||
- If you are not an academic, purchase a license at https://licences.stfc.ac.uk/product/coin-hsl. | ||
- Once your order is approved, download the coinhsl-2023.11.17.zip file and place it in the './coinhsl_src' folder. | ||
""") | ||
sys.exit(1) | ||
|
||
if __name__ == "__main__": | ||
main() |
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,31 @@ | ||
import os | ||
|
||
def replace_mumps_with_ma97(file_path): | ||
# Read the file | ||
with open(file_path, 'r') as file: | ||
content = file.read() | ||
|
||
# Replace occurrences of 'mumps' with 'ma97' | ||
updated_content = content.replace("mumps", "ma97") | ||
|
||
# Write the updated content back to the file | ||
with open(file_path, 'w') as file: | ||
file.write(updated_content) | ||
|
||
print(f"Replaced all occurrences of 'mumps' with 'ma97' in {file_path}") | ||
|
||
# Get the CONDA_PREFIX environment variable | ||
conda_prefix = os.getenv("CONDA_PREFIX") | ||
|
||
if conda_prefix: | ||
# Construct the file path | ||
file_path = os.path.join(conda_prefix, "share/dnn_mpc/robots/ergoCubGazeboV1_1/dnn-mpc/centroidal_mpc.ini") | ||
|
||
if os.path.exists(file_path): | ||
replace_mumps_with_ma97(file_path) | ||
else: | ||
print(f"File does not exist: {file_path}") | ||
os.exit(1) | ||
else: | ||
print("CONDA_PREFIX environment variable is not set.") | ||
os.exit(1) |
File renamed without changes.
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,64 @@ | ||
<?xml version="1.0"?> | ||
<sdf version="1.6"> | ||
<world name="default"> | ||
|
||
<physics type="ode"> | ||
<max_step_size>0.001</max_step_size> | ||
<real_time_factor>0.5</real_time_factor> | ||
<real_time_update_rate>500</real_time_update_rate> | ||
</physics> | ||
|
||
<scene> | ||
<shadows>false</shadows> | ||
</scene> | ||
|
||
<!-- Light --> | ||
<include> | ||
<uri>model://sun</uri> | ||
</include> | ||
|
||
<!-- Ground Plane --> | ||
<include> | ||
<uri>model://ground_plane</uri> | ||
</include> | ||
|
||
<model name="ergoCub"> | ||
|
||
<plugin name='torso_configuration_override' filename='libgazebo_yarp_configurationoverride.so'> | ||
<yarpPluginConfigurationOverride plugin_name='controlboard_torso'> </yarpPluginConfigurationOverride> | ||
<initialConfiguration>-0.00120142 0.110569 -0.0368365</initialConfiguration> | ||
</plugin> | ||
|
||
<plugin name='larm_configuration_override' filename='libgazebo_yarp_configurationoverride.so'> | ||
<yarpPluginConfigurationOverride plugin_name='controlboard_left_arm_no_hand'> </yarpPluginConfigurationOverride> | ||
<initialConfiguration>-0.0475749 0.10829 -0.192063 0.0540067 0 0 0</initialConfiguration> | ||
</plugin> | ||
|
||
<plugin name='rarm_configuration_override' filename='libgazebo_yarp_configurationoverride.so'> | ||
<yarpPluginConfigurationOverride plugin_name='controlboard_right_arm_no_hand'> </yarpPluginConfigurationOverride> | ||
<initialConfiguration>-0.0482403 0.103451 -0.203865 -0.00818984 0 0 0</initialConfiguration> | ||
</plugin> | ||
|
||
<plugin name='lleg_configuration_override' filename='libgazebo_yarp_configurationoverride.so'> | ||
<yarpPluginConfigurationOverride plugin_name='controlboard_left_leg'> </yarpPluginConfigurationOverride> | ||
<initialConfiguration> 0.111411 0.0242565 0.050721 -0.543941 -0.322059 -0.00373243</initialConfiguration> | ||
</plugin> | ||
|
||
<plugin name='rleg_configuration_override' filename='libgazebo_yarp_configurationoverride.so'> | ||
<yarpPluginConfigurationOverride plugin_name='controlboard_right_leg'> </yarpPluginConfigurationOverride> | ||
<initialConfiguration>0.0926136 0.0570012 0.0752004 -0.52194 -0.314711 -0.0492877</initialConfiguration> | ||
</plugin> | ||
|
||
<plugin name='externalwrench' filename='libgazebo_yarp_externalwrench.so'> | ||
<yarpConfigurationFile>model://ergoCub/conf/gazebo_ergocub_robotname.ini</yarpConfigurationFile> | ||
</plugin> | ||
|
||
<include> | ||
<uri>model://ergoCubGazeboV1_1</uri> | ||
<pose>0.0 0.0 0.78 0.0 -0.1 0.0</pose> | ||
</include> | ||
|
||
</model> | ||
|
||
</world> | ||
</sdf> |