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

Load neutralconfiguration from srdf for joint.nq()>1 #652

Merged
merged 6 commits into from Jan 28, 2019

Conversation

proyan
Copy link
Member

@proyan proyan commented Jan 28, 2019

Currently when loading neutralConfiguration from srdf, root_joint values are not loaded.
This PR should change that.

…play joint and value. If not found, display error message. Don't display both.
const std::string joint_val = joint_tag.second.get<std::string>("<xmlattr>.value");
std::istringstream config_string(joint_val);
const std::vector<double> config_vec((std::istream_iterator<double>(config_string)), std::istream_iterator<double>());
joint_config = ModelTpl<Scalar,Options,JointCollectionTpl>::ConfigVectorType::Map(config_vec.data(), config_vec.size());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Model here instead of ModelTpl<Scalar,Options,JointCollectionTpl>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried using typename Model::ConfigVectorType.
gcc cannot does not understand the Map attribute when I do that, but it finds the attribute when I use the full name.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because you miss the template keyword when doing so. You can see with @jmirabel for that point if he is at LAAS today to explain you this additional info.

src/parsers/srdf.hxx Outdated Show resolved Hide resolved
src/parsers/srdf.hxx Outdated Show resolved Hide resolved
@jcarpent
Copy link
Contributor

@proyan Thanks for this contribution. I just have some minor remarks that you can handle rapidly.

@jcarpent
Copy link
Contributor

By the way, you can also simplify your code by just handling the generic case. We do not care about the single DOF context in fact.

@jcarpent
Copy link
Contributor

@proyan Also, if you have an example where a SRDF file contains joints with more than one dof. It could be nice to add it inside unit tests.

@proyan
Copy link
Member Author

proyan commented Jan 28, 2019

I've taken care of all comments by the recent commit.

@jcarpent jcarpent merged commit 4c6cbaf into stack-of-tasks:devel Jan 28, 2019
jcarpent pushed a commit that referenced this pull request Feb 26, 2019
* [parsers][srdf][neutralConfiguration] Update verbosity. If found, display joint and value. If not found, display error message. Don't display both.

* [parsers][srdf][neutralConfiguration] remove ambiguity in name of xml tag and pinocchio::Joint joint instance

* [parsers][srdf][neutralConfiguration] Load q0 value for joints with nq>1

* [srdf][unittest][neutralConfig] Add joint state to simple humanoid

* [srdf][unittest] Use simple_humanoid for loading q0.

* [srdf][neutralConfiguration] remove scalar parsing for nq()==1. Simplify Eigen::Map template
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants