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

Jiminy release 1.8.8 #827

Merged
merged 16 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
cmake_minimum_required(VERSION 3.12.4)

# Set the build version (specify a tweak version to indicated post-release if needed)
set(BUILD_VERSION 1.8.7)
set(BUILD_VERSION 1.8.8)

# MSVC runtime library flags are defined by 'CMAKE_MSVC_RUNTIME_LIBRARY'
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.15.7)
Expand Down
7 changes: 5 additions & 2 deletions core/include/jiminy/core/engine/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,13 @@ namespace jiminy
config["groundProfile"] = HeightmapFunction(
[](const Eigen::Vector2d & /* xy */,
double & height,
Eigen::Vector3d & normal) -> void
std::optional<Eigen::Ref<Eigen::Vector3d>> normal) -> void
{
height = 0.0;
normal = Eigen::Vector3d::UnitZ();
if (normal.has_value())
{
normal.value() = Eigen::Vector3d::UnitZ();
}
});

return config;
Expand Down
28 changes: 18 additions & 10 deletions core/include/jiminy/core/fwd.h
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#ifndef JIMINY_FORWARD_H
#define JIMINY_FORWARD_H

#include <string_view> // `std::string_view`
#include <cstdint> // `int32_t`, `int64_t`, `uint32_t`, `uint64_t`, ...
#include <functional> // `std::function`, `std::invoke`
#include <limits> // `std::numeric_limits`
#include <map> // `std::map`
#include <unordered_map> // `std::unordered_map`
#include <deque> // `std::deque`
#include <vector> // `std::vector`
#include <utility> // `std::pair`
#include <optional> // `std::optional`
#include <string> // `std::string`
#include <sstream> // `std::ostringstream`
#include <unordered_map> // `std::unordered_map`
#include <utility> // `std::pair`
#include <vector> // `std::vector`
#include <functional> // `std::function`, `std::invoke`
#include <limits> // `std::numeric_limits`
#include <memory> // `std::addressof`
#include <utility> // `std::forward`
#include <stdexcept> // `std::runtime_error`, `std::logic_error`
#include <stdexcept> // `std::logic_error`
#include <type_traits> // `std::enable_if_t`, `std::decay_t`, `std::add_pointer_t`, `std::is_same_v`, ...

#include "pinocchio/fwd.hpp" // To avoid having to include it everywhere
Expand Down Expand Up @@ -189,9 +189,17 @@ namespace jiminy
using std::logic_error::logic_error::what;
};

// Ground profile functors
using HeightmapFunction = std::function<void(
const Eigen::Vector2d & /* xy */, double & /* height */, Eigen::Vector3d & /* normal */)>;
template<typename ResultType,
ResultType min_ = std::numeric_limits<ResultType>::min(),
ResultType max_ = std::numeric_limits<ResultType>::max()>
class uniform_random_bit_generator_ref;

// Ground profile functors.
// FIXME: use `std::move_only_function` instead of `std::function` when moving to C++23
using HeightmapFunction =
std::function<void(const Eigen::Vector2d & /* xy */,
double & /* height */,
std::optional<Eigen::Ref<Eigen::Vector3d>> /* normal */)>;

// Flexible joints
struct FlexibilityJointConfig
Expand Down
3 changes: 2 additions & 1 deletion core/include/jiminy/core/robot/model.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#ifndef JIMINY_MODEL_H
#define JIMINY_MODEL_H

#include <optional>

#include "pinocchio/spatial/fwd.hpp" // `pinocchio::SE3`
#include "pinocchio/multibody/model.hpp" // `pinocchio::Model`
#include "pinocchio/multibody/data.hpp" // `pinocchio::Data`
#include "pinocchio/multibody/geometry.hpp" // `pinocchio::GeometryModel`, `pinocchio::GeometryData`
#include "pinocchio/multibody/frame.hpp" // `pinocchio::FrameType` (C-style enum cannot be forward declared)

#include "jiminy/core/fwd.h"
#include "jiminy/core/utilities/random.h" // `uniform_random_bit_generator_ref`


namespace jiminy
Expand Down
10 changes: 5 additions & 5 deletions core/include/jiminy/core/stepper/lie_group.h
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ namespace Eigen

#define StateDerivative_SHARED_ADDON \
template<typename Derived, \
typename = typename std::enable_if_t< \
typename = std::enable_if_t< \
is_base_of_template_v<StateDerivativeBase, \
typename internal::traits<Derived>::ValueType>::value, \
void>> \
Expand Down Expand Up @@ -1268,7 +1268,7 @@ namespace Eigen
template< \
typename Derived, \
typename OtherDerived, \
typename = typename std::enable_if_t< \
typename = std::enable_if_t< \
is_base_of_template_v<StateDerivativeBase, \
typename internal::traits<Derived>::ValueType>::value && \
is_base_of_template_v<StateBase, \
Expand All @@ -1290,7 +1290,7 @@ namespace Eigen
} \
\
template<typename Derived, \
typename = typename std::enable_if_t< \
typename = std::enable_if_t< \
is_base_of_template_v<StateDerivativeBase, \
typename internal::traits<Derived>::ValueType>::value, \
void>> \
Expand All @@ -1301,7 +1301,7 @@ namespace Eigen
} \
\
template<typename Derived, \
typename = typename std::enable_if_t< \
typename = std::enable_if_t< \
is_base_of_template_v<StateDerivativeBase, \
typename internal::traits<Derived>::ValueType>::value, \
void>> \
Expand All @@ -1320,7 +1320,7 @@ namespace Eigen
template< \
typename Derived, \
typename OtherDerived, \
typename = typename std::enable_if_t< \
typename = std::enable_if_t< \
is_base_of_template_v<StateBase, \
typename internal::traits<Derived>::ValueType>::value && \
is_base_of_template_v<StateDerivativeBase, \
Expand Down
17 changes: 16 additions & 1 deletion core/include/jiminy/core/utilities/geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,23 @@ namespace jiminy
/// \param[in] stepHeight Heigh of the steps.
/// \param[in] stepNumber Number of steps in the ascending or descending direction.
/// \param[in] orientation Orientation of the staircases in the XY plane.
HeightmapFunction JIMINY_DLLAPI stairs(
HeightmapFunction JIMINY_DLLAPI periodicStairs(
double stepWidth, double stepHeight, uint32_t stepNumber, double orientation);

HeightmapFunction JIMINY_DLLAPI unidirectionalRandomPerlinGround(
double wavelength, std::size_t numOctaves, double orientation, uint32_t seed);

HeightmapFunction JIMINY_DLLAPI unidirectionalPeriodicPerlinGround(double wavelength,
double period,
std::size_t numOctaves,
double orientation,
uint32_t seed);

HeightmapFunction JIMINY_DLLAPI randomPerlinGround(
double wavelength, std::size_t numOctaves, uint32_t seed);

HeightmapFunction JIMINY_DLLAPI periodicPerlinGround(
double wavelength, double period, std::size_t numOctaves, uint32_t seed);
}

#endif // JIMINY_GEOMETRY_H
Loading
Loading