Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added readme and tested on mambaforge #13

Open
wants to merge 1 commit into
base: rhc
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ venv
*.so*
*.mat

.vscode/launch.json
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,22 @@
A framework for trajectory optimization and optimal control for robotics based on CasADi

## Install
pip package: ```pip install casadi-horizon```
conda package: ```conda install horizon -c francesco_ruscelli```
here we assume that a mambaforge python package manager is already installed in your system. if it is not the case follow the instruction [here](https://github.com/conda-forge/miniforge#mambaforge).
aftert installing mambaforge **assuming that you are in the project folder** you can create the environment for horizon by doing

```
mamba env create -f environment.yml
conda activate hori
```
one important dependencies of horizon is **casadi-kin-dyn**. you need to install it in the environment that you have just created (all the casadi-kin-dyn dependencies are already satisfied in the newly created environment)
to install casadi-kin-dyn follow the instruction provided [here](https://github.com/ADVRHumanoids/casadi_kin_dyn/tree/collision)
after installing casadi-kin-dyn you can install horizon by doing

```
pip install -e .
```
### installing libhsl.so
to do

## Documentations
Don't forget to check the [**documentation**](https://advrhumanoids.github.io/horizon/)!
Expand Down
18 changes: 12 additions & 6 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: hori
channels:
- conda-forge
- robostack
- francesco_ruscelli
- robostack-staging
#- francesco_ruscelli
dependencies:
- python=3.8
- nodejs=14
- python=3.9
- nodejs
- jupyterlab=3.2
- yaml-cpp
- pip
Expand All @@ -20,8 +20,14 @@ dependencies:
- conda-verify
- anaconda-client
- ros-noetic-ros-base
- ros-noetic-pinocchio
- francesco_ruscelli::casadi_kin_dyn
- pinocchio
- ros-noetic-tf2-msgs
- ros-noetic-rviz
- ros-noetic-ros-numpy # maybe not necessary (bugged)
- ros-noetic-robot-state-publisher
- catkin_tools
#- ros-noetic-pinocchio
#- francesco_ruscelli::casadi_kin_dyn
#- ros-noetic-catkin
#- ros-noetic-robot-state-publisher
#- ros-noetic-joint-state-publisher
Expand Down
8 changes: 4 additions & 4 deletions horizon/examples/spot_walk.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ def z_trj(tau):

# contact velocity is zero, and normal force is positive
for i, frame in enumerate(contacts_name):
FK = cs.Function.deserialize(kindyn.fk(frame))
DFK = cs.Function.deserialize(kindyn.frameVelocity(frame, cas_kin_dyn.CasadiKinDyn.LOCAL_WORLD_ALIGNED))
DDFK = cs.Function.deserialize(kindyn.frameAcceleration(frame, cas_kin_dyn.CasadiKinDyn.LOCAL_WORLD_ALIGNED))
FK = kindyn.fk(frame)
DFK = kindyn.frameVelocity(frame, cas_kin_dyn.CasadiKinDyn.LOCAL_WORLD_ALIGNED)
DDFK = kindyn.frameAcceleration(frame, cas_kin_dyn.CasadiKinDyn.LOCAL_WORLD_ALIGNED)

p = FK(q=q)['ee_pos']
v = DFK(q=q, qdot=q_dot)['ee_vel_linear']
Expand Down Expand Up @@ -411,7 +411,7 @@ def set_initial_guess():
ax = fig.add_subplot(gs[i])
ax.set_title('{}'.format(contact))
i += 1
FK = cs.Function.deserialize(kindyn.fk(contact))
FK = kindyn.fk(contact)
pos = FK(q=solution['q'])['ee_pos']
for dim in range(n_f):
ax.plot(np.atleast_2d(cumulative_dt), np.array(pos[dim, :]), marker="x", markersize=3,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def run(self):
long_description_content_type="text/markdown",
url="https://github.com/ADVRHumanoids/horizon",
packages=['horizon', 'horizon.utils', 'horizon.solvers', 'horizon.transcriptions', 'horizon.examples', 'horizon.ros', 'horizon.rhc', 'horizon.rhc.tasks'],
install_requires=['casadi', 'numpy', 'matplotlib', 'scipy', 'casadi-kin-dyn', 'rospkg'],
install_requires=['casadi', 'numpy', 'matplotlib', 'scipy', 'rospkg'], #for now removed casadi-kin-dyn due to the installation issue related to the library
python_requires=">=3.6",
cmdclass={'build_py': CustomBuild,
'develop': CustomDevelop},
Expand Down