Comments (8)
Thank you I just tested both options and I was able to work with Mx variables
from adam.
CC @Giulero
from adam.
Hi @AFusco99! Can you provide a snippet of code on how you're using the library? Thanks!
from adam.
Yes, thanks
import casadi as cs
import numpy as np
model_path = "panda.urdf"
import adam
from adam.casadi import KinDynComputations
joints_name_list = [
'panda_joint1', 'panda_joint2', 'panda_joint3', 'panda_joint4',
'panda_joint5', 'panda_joint6', 'panda_joint7'
]
joint_angles=cs.MX.sym('q', 7)
root_link = 'panda_link0'
w_H_b = np.eye(4)
kinDyn = KinDynComputations(model_path, joints_name_list, root_link)
frame="panda_hand"
Tmat=(kinDyn.forward_kinematics(frame,w_H_b,joint_angles))
This code is functional as long as joint_angles is defined as an SX symbolic variable however in my case I need to define it as an MX symbolic variable as I am using external functions and CasADI only supports MX variables in these cases.
from adam.
Got it! It shouldn't be possible to convert SX to MX and vice-versa (it seems open casadi/casadi#1870).
I created a branch with some modifications in order to let adam accept also MX types.
I opened this PR: #84. You might test changing the branch!
from adam.
Fyi: PR #84 merged
from adam.
Hi @AFusco99 ! I just noticed that you are using the forward_kinematics
function.
I guess also that you could use the function forward_kinematics_fun
function. This function returns the casadi function directly, and it should be possible to use it with SX
, MX
and DM
(and numpy
).
Your snippet would become
import casadi as cs
import numpy as np
model_path = "panda.urdf"
import adam
from adam.casadi import KinDynComputations
joints_name_list = [
'panda_joint1', 'panda_joint2', 'panda_joint3', 'panda_joint4',
'panda_joint5', 'panda_joint6', 'panda_joint7'
]
joint_angles=cs.MX.sym('q', 7)
root_link = 'panda_link0'
w_H_b = np.eye(4)
kinDyn = KinDynComputations(model_path, joints_name_list, root_link)
frame="panda_hand"
T_mat_fun = kinDyn.forward_kinematics_fun(frame)
Tmat=T_mat_fun(w_H_b,joint_angles)
from adam.
@AFusco99, please have a look at #89. Anyway, using the *fun
version of the function, you should be able to use MX
!
from adam.
Related Issues (20)
- Required python version HOT 5
- Jax installation for GPU HOT 7
- Fix failing Conda github actions HOT 1
- Rename this repo to adam-robotics? HOT 11
- Question: Differentiability w.r.t what exactly? HOT 2
- Noisy warning when loading icub model
- Black action is failing HOT 1
- Handle the case in which a parametric link is not a box, cylinder or sphere HOT 1
- Wrong return type hint in parametric get_total_mass HOT 3
- Allow getting the default densities in the parametric model HOT 1
- Failed to load stickBot model in the parametric KinDynComputations. HOT 9
- . HOT 2
- Use of the Adam HOT 1
- The dimension of the Mass Matrix and the bias force HOT 27
- NAN value HOT 3
- Test ADAM with conda-forge dependencies failing on macos-latest HOT 6
- Error detecting two root links HOT 1
- Failing tests - Failed to build idyntree HOT 1
- Forward kinematics is so slow HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adam.