Comments (3)
Hello @nopaddleboat,
I can reproduce your issue with Pinocchio 2.
This is fixed in Pinocchio 3 which will be released soon.
from pinocchio.
Could you provide a full reproducible example?
from pinocchio.
Thanks very much for your reply @jcarpent . Here is a minimal working example. If I commented out the last line " pinocchio::difference(ad_model, q_ad, q_ad1, v_diff_ad);" no complilation errors occur. Otherwise it complains
error: could not convert ‘casadi::operator>(const casadi::Matrix<casadi::SXElem>&, const casadi::Matrix<casadi::SXElem>&)(pinocchio::TaylorSeriesExpansion<casadi::Matrix<T> >::precision() [with int degree = 3; Scalar = casadi::SXElem]())’ from ‘casadi::Matrix<casadi::SXElem>’ to ‘bool’
[build] 61 | const Scalar t = ((theta > TaylorSeriesExpansion<Scalar>::template precision<3>())
Here are the main.cpp function and corresponding cmakelist.txt. I complied it on Ubuntu 20 with vscode. Let me know if you need any further information.
#include "pinocchio/autodiff/casadi.hpp"
#include "pinocchio/algorithm/rnea.hpp"
#include "pinocchio/algorithm/rnea-derivatives.hpp"
#include "pinocchio/algorithm/aba.hpp"
#include "pinocchio/algorithm/aba-derivatives.hpp"
#include "pinocchio/algorithm/joint-configuration.hpp"
#include "pinocchio/parsers/sample-models.hpp"
#include <casadi/casadi.hpp>
using namespace casadi;
namespace pin = pinocchio;
int main() {
typedef double Scalar;
typedef casadi::SX ADScalar;
typedef pinocchio::ModelTpl<Scalar> Model;
typedef Model::Data Data;
typedef pinocchio::ModelTpl<ADScalar> ADModel;
typedef ADModel::Data ADData;
Model model;
pinocchio::buildModels::humanoidRandom(model);
typedef ADModel::ConfigVectorType ConfigVectorAD;
ADModel ad_model = model.cast<ADScalar>();
ADData ad_data(ad_model);
casadi::SX cs_q = casadi::SX::sym("q", model.nq);
casadi::SX cs_q1 = casadi::SX::sym("q1", model.nq);
casadi::SX cs_v_int = casadi::SX::sym("v_inc", model.nv);
typedef Model::ConfigVectorType ConfigVector;
typedef Model::TangentVectorType TangentVector;
ConfigVectorAD q_ad(model.nq),q_ad1(model.nq), v_int_ad(model.nv), q_int_ad(model.nq), v_diff_ad(model.nv);
q_ad = Eigen::Map<ConfigVectorAD>(static_cast< std::vector<ADScalar> >(cs_q).data(),model.nq,1);
v_int_ad = Eigen::Map<ConfigVectorAD>(static_cast< std::vector<ADScalar> >(cs_v_int).data(),model.nv,1);
q_ad1 = Eigen::Map<ConfigVectorAD>(static_cast< std::vector<ADScalar> >(cs_q1).data(),model.nq,1);
pinocchio::integrate(ad_model,q_ad,v_int_ad,q_int_ad);
pinocchio::difference(ad_model, q_ad, q_ad1, v_diff_ad);
return 0;
}
Here is the CmakeLists.txt.
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(optimal_control)
LIST(APPEND PATH "/opt/openrobots/bin")
LIST(APPEND PKG_CONFIG_PATH "/opt/openrobots/lib/pkgconfig")
LIST(APPEND LD_LIBRARY_PATH "/opt/openrobots/lib")
LIST(APPEND PYTHONPATH "/opt/openrobots/lib/python3.8/site-packages")
LIST(APPEND CMAKE_PREFIX_PATH "/opt/openrobots")
find_package(pinocchio REQUIRED)
find_package(casadi)
add_executable(
main
src/main.cpp
)
target_link_libraries(
main
pinocchio::pinocchio
casadi
)
from pinocchio.
Related Issues (20)
- Create model with uncertainty (unkown paramters that can be updated online)
- Incomplete Function Auto-Completion and highlight in VSCode after Installing Pinocchio via Conda HOT 10
- Add arm64 macOS wheels to releases HOT 4
- Possible unnecessary computation in computeMinverse HOT 5
- Linux ROS CI issue HOT 3
- Seek for COM Matrix HOT 1
- Generalized velocity of the floating base HOT 7
- Activate ROS CI
- AttributeError: module 'pinocchio' has no attribute 'buildModelFromUrdf' HOT 1
- pin.getJointJacobian HOT 10
- How to model robot with float-base HOT 1
- Fix cmake export files to allow cross-compilation with sysroot HOT 3
- Wrong inertia properties extracted from data class using python interface. HOT 1
- How to get the axis of a revolute joint? HOT 1
- How to change the order of joints in pinocchio
- Is the branch pinocchio3-preview compilent with hpp-fcl 2.4.4? HOT 1
- Release of Pinocchio 2.7.0 into ROS 2 Rolling (and possibly Jazzy) HOT 3
- Make pinocchio python binding documentation online HOT 4
- Ros related compatibility issues HOT 1
- Build error when installing with pip HOT 16
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 pinocchio.