https://github.com/advrhumanoids/xbot2_interface
Next-gen robot and model interfaces for XBot2
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.0%) to scientific vocabulary
Repository
Next-gen robot and model interfaces for XBot2
Basic Info
- Host: GitHub
- Owner: ADVRHumanoids
- License: apache-2.0
- Language: C++
- Default Branch: master
- Size: 504 KB
Statistics
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 3
- Releases: 0
Metadata Files
README.md
xbot2_interface
This package replaces the good ole' XBotInterface
package by HHCM.
We try to keep the API as close as possible to the old one.
This is not always possible since this package supports non-Euclidean joints,
and therefore the number of joints is
in general different than the number of element in the q vector,
which is also different than the number of elements in the v vector.
Quick guide
Build the library
After installing the required dependencies (TBD)
c++
mkdir build && cd build
cmake ..
make
make install
Use the library in your project
cmake
find_package(xbot2_interface REQUIRED)
target_link_libraries(mytarget xbot2_interface::xbot2_interface)
Model object construction
c++
std::string urdf; // read urdf file into this string somehow
auto model = ModelInterface::getModel(urdf, "pin");
More constructors are available which take the SRDF file, too.
Vector dimensions
As we support non-Euclidean joints, care must be taken when manipulating configurations and motion vectors. ```c++
// the neutral (i.e., zero) configuration // note: this is in general different than Eigen::VectorXd::Zero(model->getNq()) !! Eigen::VectorXd qn = model->getNeutralQ();
// its size is model->getNq() assert(qn.size() == model->getNq());
// a random configuration complying with joint limits Eigen::VectorXd qrand = model->generateRandomQ();
// the velocity vector that brings qn to qrand in unit time // note: you cannot compute the vector difference of qn and qrand, // since these are NOT vectors in the linear-algebraic sense! Eigen::VectorXd vrand = model->difference(qrand, qn);
// its size is model->getNv() assert(vrand.size() == model->getNv());
// the configuration obtained by applying a velocity vector to // a given initial configuration // note: this will be the same configuration as qrand // note: you can sum two motions, but you cannot sum a motion with // a configuration Eigen::VectorXd q1 = model->sum(qn, vrand);
// the list of joint names auto jnames = model->getJointNames();
// its length is model->getJointNum() assert(jnames.size() == model->getJointNum());
// the i-th joint can have nq and/or nv greater than one; // its index inside a configuration or motion is therefore != id int id = jnames.size()/2;
// this data structure contains indexing information auto jinfo = model->getJointInfo(i);
std::cout << "id = " << jinfo.id << " iq = " << jinfo.iq << " iv = " << jinfo.iv << " nq = " << jinfo.nq << " nv = " << jinfo.nv << std::endl;
// this is how you index a configuration or motion auto qj = qrand.segment(jinfo.iq, jinfo.nq); auto vj = vrand.segment(jinfo.iv, jinfo.nv);
// you can use the joint interface (same result); Joint::Ptr joint = model->getJoint(i); auto qj1 = joint->getJointPosition(); // same as qj auto vj1 = joint->getJointVelocity(); // same as vj
// similar for effort, acceleration, ...
```
Using the model to perform computations
```c++ // every time you change the model state, // call update() to apply the new configuration model->setJointPosition(qrand); model->setJointVelocity(vrand); model->update();
// forward kinematics Eigen::Affine3d T1 = model->getPose("mylink"); Eigen::Affine3d T12 = model->getPose("mylink", "mybaselink"); Eigen::Vector6d v1 = model->getVelocityTwist("mylink"); Eigen::Vector6d v12 = model->getRelativeVelocityTwist("mylink", "mybaselink");
// similar for acceleration...
// jacobians Eigen::MatrixXd J;
if(!model->getJacobian("my_link", J)) { std::cerr << "error: bad link name \n"; } ```
Examples
Check this small collection of commented examples
Porting from XBotInterface v1
Check the cheatsheet
Owner
- Name: ADVR Humanoids
- Login: ADVRHumanoids
- Kind: organization
- Email: luca.muratore@iit.it
- Location: Istituto Italiano di Tecnologia
- Website: https://www.iit.it/lines/humanoids-human-centered-mechatronics
- Repositories: 206
- Profile: https://github.com/ADVRHumanoids
Humanoids & Human Centered Mechatronics, HHCM, IIT
GitHub Events
Total
- Create event: 3
- Commit comment event: 1
- Issues event: 1
- Watch event: 1
- Member event: 1
- Issue comment event: 1
- Push event: 19
- Pull request event: 2
Last Year
- Create event: 3
- Commit comment event: 1
- Issues event: 1
- Watch event: 1
- Member event: 1
- Issue comment event: 1
- Push event: 19
- Pull request event: 2
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 0
- Total pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 2
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 2
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- torydebra (1)
Pull Request Authors
- Volksfest (1)
- EnricoMingo (1)