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

Yaml extension for Eigen::Matrix and std::unordered_map #175

Merged
merged 50 commits into from
Apr 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
8feb924
Renaming, adding an abstract BarretHandPositionCommandExecutor class
gilwoolee Apr 12, 2017
811a63b
Adding -override
gilwoolee Apr 12, 2017
dd96c10
Merge branch 'master' into SimBarrettHandCommandExecutor
gilwoolee Apr 12, 2017
83f69dd
Exposing step
gilwoolee Apr 13, 2017
cf8f104
Merge branch 'SimBarrettHandCommandExecutor' of https://github.com/pe…
gilwoolee Apr 13, 2017
9d9fb3d
Renaiming PositionCommandExecutor
gilwoolee Apr 13, 2017
648c2bf
Changing header files
gilwoolee Apr 13, 2017
a38c65a
Changing names and step function.
gilwoolee Apr 14, 2017
06dad13
Merge branch 'master' into SimBarrettHandCommandExecutor
gilwoolee Apr 14, 2017
c6462db
Update simulation speed constants and matrix->vector methods.
brianhou Apr 14, 2017
e16880e
Add collisionDetector argument. Make collideWith an optional argument.
brianhou Apr 15, 2017
ce86f93
Don't reset mCollideWith every time.
brianhou Apr 15, 2017
c90cd8d
Simplify logic of optional collision detector and collision groups.
brianhou Apr 15, 2017
2d3a5bc
Add ShapeFrames of original collision group to new collision group.
brianhou Apr 15, 2017
d9d36fc
Make collisionDetector, collideWith optional.
brianhou Apr 15, 2017
3af8671
Instantiate FingerPositionCommandExecutors and FingerSpreadCommandExe…
brianhou Apr 15, 2017
2174930
Clean up some documentation.
brianhou Apr 15, 2017
6ecb30e
Remove parameter from step.
brianhou Apr 15, 2017
c3eb6f3
Set mCollisionDetector when setting mCollideWith.
brianhou Apr 15, 2017
47a9852
Make FingerCommandExecutors implement PositionCommandExecutor.
brianhou Apr 15, 2017
bebb761
Swap argument order in HandPositionExecutor.
brianhou Apr 16, 2017
f1d805f
Partial test fixes.
brianhou Apr 16, 2017
0be9ae8
Yaml parser
gilwoolee Apr 16, 2017
fc7cd1c
Adding time-reset when a new execute command is given.
gilwoolee Apr 16, 2017
57e404f
Merge branch 'SimBarrettHandCommandExecutor' of https://github.com/pe…
gilwoolee Apr 16, 2017
7ec2fbd
Move eigen_yaml to util renaming to yaml_eigen_extension
jslee02 Apr 18, 2017
c6c12d9
Address Mike's comments -- still need docstrings
jslee02 Apr 18, 2017
4804ff2
Merge remote-tracking branch 'origin/master' into util/yaml_helper
jslee02 Apr 18, 2017
0a05e5a
Merge remote-tracking branch 'origin/master' into util/yaml_helper
jslee02 Apr 19, 2017
5a5cec9
Use find module for yaml-cpp instead of pkgconfig
jslee02 Apr 19, 2017
9053361
Remove meaningless test line
jslee02 Apr 19, 2017
1bd0c27
Fix style
jslee02 Apr 19, 2017
9ea12ef
Suppress warnings per GCC 6.3.0
jslee02 Apr 19, 2017
2fe83d4
Add yaml converter for std::unordered_map
jslee02 Apr 19, 2017
4f0a428
Add comment
jslee02 Apr 19, 2017
80d0be3
Rename deserialize to decode
jslee02 Apr 19, 2017
9d02314
Add comments
jslee02 Apr 19, 2017
1fe6f27
Add more comments
jslee02 Apr 19, 2017
a7d0f77
Rename yaml_eigen_extension to yaml_extension
jslee02 Apr 19, 2017
e4a5f43
Fix header including
jslee02 Apr 19, 2017
3eb4b88
Rename test_yaml_eigen_extension to test_yaml_extension
jslee02 Apr 19, 2017
7a8f2c6
Fix typos in version.hpp.in
jslee02 Apr 21, 2017
e359fef
Use YAML::RepresentationException instead of std::exception
jslee02 Apr 21, 2017
c5ce755
Fix style
jslee02 Apr 21, 2017
e39ef72
Merge branch 'master' into util/yaml_helper
gilwoolee Apr 22, 2017
5e4b783
Use detail namespace instead of anonymous namespace
jslee02 Apr 22, 2017
5b39cb7
Make function inline-ed that is defined in header
jslee02 Apr 22, 2017
9b437a9
Merge branch 'master' into util/yaml_helper
gilwoolee Apr 22, 2017
151b7e6
Add comment
jslee02 Apr 23, 2017
fe89b10
Merge branch 'master' into util/yaml_helper
mkoval Apr 23, 2017
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
49 changes: 49 additions & 0 deletions cmake/FindYamlCpp.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Locate yaml-cpp
#
# This module defines
# YAMLCPP_FOUND - System has yaml-cpp
# YAMLCPP_INCLUDE_DIRS - The yaml-cpp include directories
# YAMLCPP_LIBRARIES - The libraries needed to use yaml-cpp
# YAMLCPP_DEFINITIONS - Compiler switches required for using yaml-cpp
# YAMLCPP_VERSION - The version of yaml-cpp
#
# By default, the dynamic libraries of yaml-cpp will be found. To find the
# static ones instead, set the YAMLCPP_STATIC_LIBRARY variable to TRUE before
# calling find_package(YamlCpp ...).
#
# If yaml-cpp is not installed in a standard path, you can use the YAMLCPP_DIR
# CMake variable to tell CMake where yaml-cpp is.

# Attempt to find static library first if this is set
if(YAMLCPP_STATIC_LIBRARY)
set(YAMLCPP_STATIC libyaml-cpp.a)
endif()

# Set up pkg-config to find yaml-cpp.
find_package(PkgConfig)
pkg_check_modules(PC_YAMLCPP QUIET yaml-cpp)
set(YAMLCPP_DEFINITIONS ${PC_YAMLCPP_CFLAGS_OTHER})

# Find the yaml-cpp include directory.
find_path(YAMLCPP_INCLUDE_DIR yaml-cpp/yaml.h
HINTS ${PC_YAMLCPP_INCLUDEDIR} ${PC_YAMLCPP_INCLUDE_DIRS}
PATHS ${YAMLCPP_DIR}/include/
PATH_SUFFIXES include)

# Find the yaml-cpp library.
find_library(YAMLCPP_LIBRARY NAMES ${YAMLCPP_STATIC} yaml-cpp
HINTS ${PC_YAMLCPP_LIBDIR} ${PC_YAMLCPP_LIBRARY_DIRS}
PATHS ${YAMLCPP_DIR}/lib/
PATH_SUFFIXES lib64 lib)

set(YAMLCPP_LIBRARIES ${YAMLCPP_LIBRARY})
set(YAMLCPP_INCLUDE_DIRS ${YAMLCPP_INCLUDE_DIR})

set(YAMLCPP_VERSION ${PC_YAMLCPP_VERSION})

# Handle the QUIETLY and REQUIRED arguments and set YAMLCPP_FOUND to TRUE
# if all listed variables are TRUE.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(YAMLCPP DEFAULT_MSG
YAMLCPP_INCLUDE_DIR YAMLCPP_LIBRARY)
mark_as_advanced(YAMLCPP_INCLUDE_DIR YAMLCPP_LIBRARY)
8 changes: 4 additions & 4 deletions cmake/version.hpp.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* config.hpp. Generated by CMake for @PROJECT_NAME@. */
#ifndef AIKIDO_CONFIG_HPP_
#define AIKIDO_CONFIG_HPP_
/* version.hpp. Generated by CMake for @PROJECT_NAME@. */
#ifndef AIKIDO_VERSION_HPP_
#define AIKIDO_VERSION_HPP_

/* Version number */
#define AIKIDO_MAJOR_VERSION @AIKIDO_MAJOR_VERSION@
Expand All @@ -27,4 +27,4 @@
(AIKIDO_MAJOR_VERSION < x || (AIKIDO_MAJOR_VERSION <= x && \
(AIKIDO_MINOR_VERSION < y || (AIKIDO_MINOR_VERSION <= y))))

#endif // #ifndef AIKIDO_CONFIG_HPP_
#endif // #ifndef AIKIDO_VERSION_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ bool RnBoxConstraintSampleGenerator<N>::sample(
{
Vectord value(mDistributions.size());

for (size_t i = 0; i < value.size(); ++i)
for (size_t i = 0; i < static_cast<std::size_t>(value.size()); ++i)
value[i] = mDistributions[i](*mRng);

mSpace->setValue(static_cast<typename statespace::R<N>::State*>(_state), value);
Expand Down Expand Up @@ -124,15 +124,15 @@ RBoxConstraint<N>::RBoxConstraint(std::shared_ptr<statespace::R<N>> _space,

const auto dimension = mSpace->getDimension();

if (mLowerLimits.size() != dimension)
if (static_cast<std::size_t>(mLowerLimits.size()) != dimension)
{
std::stringstream msg;
msg << "Lower limits have incorrect dimension: expected "
<< mSpace->getDimension() << ", got " << mLowerLimits.size() << ".";
throw std::invalid_argument(msg.str());
}

if (mUpperLimits.size() != dimension)
if (static_cast<std::size_t>(mUpperLimits.size()) != dimension)
{
std::stringstream msg;
msg << "Upper limits have incorrect dimension: expected "
Expand Down Expand Up @@ -184,7 +184,7 @@ bool RBoxConstraint<N>::isSatisfied(
const auto value = mSpace->getValue(
static_cast<const typename statespace::R<N>::State*>(state));

for (size_t i = 0; i < value.size(); ++i)
for (size_t i = 0; i < static_cast<std::size_t>(value.size()); ++i)
{
if (value[i] < mLowerLimits[i] || value[i] > mUpperLimits[i])
return false;
Expand All @@ -201,7 +201,7 @@ bool RBoxConstraint<N>::project(
Vectord value = mSpace->getValue(
static_cast<const typename statespace::R<N>::State*>(_s));

for (size_t i = 0; i < value.size(); ++i)
for (size_t i = 0; i < static_cast<std::size_t>(value.size()); ++i)
{
if (value[i] < mLowerLimits[i])
value[i] = mLowerLimits[i];
Expand Down Expand Up @@ -250,7 +250,7 @@ void RBoxConstraint<N>::getJacobian(
const size_t dimension = mSpace->getDimension();
_out = Eigen::MatrixXd::Zero(dimension, dimension);

for (size_t i = 0; i < _out.rows(); ++i)
for (size_t i = 0; i < static_cast<std::size_t>(_out.rows()); ++i)
{
if (stateValue[i] < mLowerLimits[i])
_out(i, i) = -1.;
Expand Down
2 changes: 1 addition & 1 deletion include/aikido/perception/AprilTagsModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#include <tf/transform_listener.h>
#include <dart/dart.hpp>
#include <aikido/util/CatkinResourceRetriever.hpp>
#include <aikido/util/yaml.hpp>
#include <aikido/perception/AprilTagsDatabase.hpp>
#include <aikido/perception/PerceptionModule.hpp>
#include <yaml-cpp/yaml.h>
#include <memory>


Expand Down
2 changes: 1 addition & 1 deletion include/aikido/perception/YamlAprilTagsDatabase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#define AIKIDO_PERCEPTION_YAML_APRILTAGS_DATABASE_H

#include "yaml-cpp/yaml.h"
#include <aikido/perception/eigen_yaml.hpp>
#include <aikido/util/CatkinResourceRetriever.hpp>
#include <aikido/util/yaml.hpp>
#include <dart/common/LocalResourceRetriever.hpp>
#include <dart/dart.hpp>
#include <Eigen/Geometry>
Expand Down
183 changes: 0 additions & 183 deletions include/aikido/perception/eigen_yaml.hpp

This file was deleted.

6 changes: 3 additions & 3 deletions include/aikido/statespace/detail/Rn-impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ template <int N>
void R<N>::setValue(State *_state, const typename R<N>::Vectord &_value) const
{
// TODO: Skip this check in release mode.
if (_value.size() != getDimension()) {
if (static_cast<std::size_t>(_value.size()) != getDimension()) {
std::stringstream msg;
msg << "Value has incorrect size: expected " << getDimension() << ", got "
<< _value.size() << ".";
Expand Down Expand Up @@ -245,7 +245,7 @@ template <int N>
void R<N>::expMap(const Eigen::VectorXd&_tangent, StateSpace::State *_out) const
{
// TODO: Skip this check in release mode.
if (_tangent.size() != getDimension()) {
if (static_cast<std::size_t>(_tangent.size()) != getDimension()) {
std::stringstream msg;
msg << "Tangent vector has incorrect size: expected " << getDimension()
<< ", got " << _tangent.size() << ".";
Expand All @@ -260,7 +260,7 @@ void R<N>::expMap(const Eigen::VectorXd&_tangent, StateSpace::State *_out) const
template <int N>
void R<N>::logMap(const StateSpace::State *_in, Eigen::VectorXd& _tangent) const
{
if (_tangent.size() != getDimension())
if (static_cast<std::size_t>(_tangent.size()) != getDimension())
_tangent.resize(getDimension());

auto in = static_cast<const State *>(_in);
Expand Down
Loading