Skip to content

Commit

Permalink
Jiminy release 1.8.2 (#729)
Browse files Browse the repository at this point in the history
* [core] More conservative step adjustment for adaptive steppers. (#724)
* [core] Add relaxation to PGS solver to mitigate convergence instabilities. (#726)
* [core] Remove unnecessarily confusing 'System' hierarchy. (#728)
* [core] Remove single-robot 'Engine' class. (#728)
* [python/plot] Synchronise x-axes on all tabs by default. (#724)
* [gym/common] Ease debugging of Gym environments. (#724)
* [gym/common] Do not enforce 'dtMax'. (#727)
  • Loading branch information
duburcqa committed Feb 21, 2024
1 parent 7dbcdfc commit df9b31e
Show file tree
Hide file tree
Showing 67 changed files with 5,988 additions and 6,502 deletions.
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.1)
set(BUILD_VERSION 1.8.2)

# Set compatibility
set(COMPATIBILITY_VERSION SameMinorVersion)
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ make install -j2

```bash
sudo apt install -y gnupg curl wget build-essential cmake doxygen graphviz
python -m pip install "numpy>=1.21,<2.0"
python -m pip install "wheel", "numpy>=1.21,<2.0"
```

### Jiminy dependencies build and install
Expand Down
16 changes: 10 additions & 6 deletions build_tools/build_install_deps_unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,19 @@ fi

### Set the compiler(s) if undefined
if [ -z ${CMAKE_C_COMPILER} ]; then
CMAKE_C_COMPILER="gcc"
CMAKE_C_COMPILER="$(which gcc)"
echo "CMAKE_C_COMPILER is unset. Defaulting to '${CMAKE_C_COMPILER}'."
fi
if [ -z ${CMAKE_CXX_COMPILER} ]; then
CMAKE_CXX_COMPILER="g++"
CMAKE_CXX_COMPILER="$(which g++)"
echo "CMAKE_CXX_COMPILER is unset. Defaulting to '${CMAKE_CXX_COMPILER}'."
fi

### Set common CMAKE_C/CXX_FLAGS
# '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION' flag is required to compile `boost::container_hash::hash`
# with C++17 enabled from "old" releases of Boost.
CMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION -Wno-deprecated-declarations"
CMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION $(
) -Wno-deprecated-declarations -Wno-enum-constexpr-conversion"
if [ "${BUILD_TYPE}" == "Release" ]; then
CMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -DNDEBUG -O3"
elif [ "${BUILD_TYPE}" == "Debug" ]; then
Expand Down Expand Up @@ -271,6 +272,7 @@ mkdir -p "${RootDir}/boost/build"
mkdir -p "${RootDir}/eigen3/build"
cd "${RootDir}/eigen3/build"
cmake "${RootDir}/eigen3" -Wno-dev -DCMAKE_CXX_STANDARD=17 \
-DCMAKE_C_COMPILER="${CMAKE_C_COMPILER}" -DCMAKE_CXX_COMPILER="${CMAKE_CXX_COMPILER}" \
-DCMAKE_INSTALL_PREFIX="${InstallDir}" \
-DBUILD_TESTING=OFF -DEIGEN_BUILD_PKGCONFIG=ON
make install -j2
Expand Down Expand Up @@ -324,7 +326,9 @@ make install -j2

mkdir -p "${RootDir}/urdfdom_headers/build"
cd "${RootDir}/urdfdom_headers/build"
cmake "${RootDir}/urdfdom_headers" -Wno-dev -DCMAKE_INSTALL_PREFIX="${InstallDir}" -DCMAKE_BUILD_TYPE="$BUILD_TYPE"
cmake "${RootDir}/urdfdom_headers" -Wno-dev -DCMAKE_CXX_STANDARD=17 \
-DCMAKE_C_COMPILER="${CMAKE_C_COMPILER}" -DCMAKE_CXX_COMPILER="${CMAKE_CXX_COMPILER}" \
-DCMAKE_INSTALL_PREFIX="${InstallDir}" -DCMAKE_BUILD_TYPE="$BUILD_TYPE"
make install -j2

################################## Build and install urdfdom ###########################################
Expand Down Expand Up @@ -437,8 +441,8 @@ cmake "${RootDir}/pinocchio" -Wno-dev -DCMAKE_CXX_STANDARD=17 \
-DBUILD_WITH_AUTODIFF_SUPPORT=ON -DBUILD_WITH_CODEGEN_SUPPORT=ON -DBUILD_WITH_CASADI_SUPPORT=OFF \
-DBUILD_WITH_OPENMP_SUPPORT=OFF -DGENERATE_PYTHON_STUBS=OFF -DBUILD_TESTING=OFF -DINSTALL_DOCUMENTATION=OFF \
-DCMAKE_CXX_FLAGS_RELEASE_INIT="" -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -DBOOST_BIND_GLOBAL_PLACEHOLDERS $(
) -Wno-uninitialized -Wno-type-limits -Wno-deprecated-declarations -Wno-unused-local-typedefs $(
) -Wno-extra -Wno-unknown-warning-option -Wno-unknown-warning" -DCMAKE_BUILD_TYPE="$BUILD_TYPE"
) -Wno-uninitialized -Wno-type-limits -Wno-unused-local-typedefs -Wno-extra $(
) -Wno-unknown-warning-option -Wno-unknown-warning" -DCMAKE_BUILD_TYPE="$BUILD_TYPE"
make install -j2

# Copy cmake configuration files for cppad and cppadcodegen
Expand Down
2 changes: 0 additions & 2 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ set(SRC
"${CMAKE_CURRENT_SOURCE_DIR}/src/stepper/abstract_runge_kutta_stepper.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/src/stepper/runge_kutta4_stepper.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/src/stepper/runge_kutta_dopri_stepper.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/src/engine/system.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/src/engine/engine_multi_robot.cc"
"${CMAKE_CURRENT_SOURCE_DIR}/src/engine/engine.cc"
)

Expand Down
10 changes: 5 additions & 5 deletions core/examples/double_pendulum/double_pendulum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void internalDynamics(double /* t */,
{
}

bool callback(double /* t */, const Eigen::VectorXd & /* q */, const Eigen::VectorXd & /* v */)
bool callback()
{
return true;
}
Expand Down Expand Up @@ -81,8 +81,8 @@ int main(int /* argc */, char * /* argv */[])
}

// Instantiate and configuration the controller
auto controller = std::make_shared<FunctionalController<>>(computeCommand, internalDynamics);
controller->initialize(robot);
robot->setController(
std::make_shared<FunctionalController<>>(computeCommand, internalDynamics));

// Instantiate and configuration the engine
Engine engine{};
Expand Down Expand Up @@ -119,7 +119,7 @@ int main(int /* argc */, char * /* argv */[])
boost::get<double>(contactsOptions.at("transitionEps")) = 0.001;
boost::get<double>(contactsOptions.at("transitionVelocity")) = 0.01;
engine.setOptions(simuOptions);
engine.initialize(robot, controller, callback);
engine.addRobot(robot);
std::cout << "Initialization: " << timer.toc<std::milli>() << "ms" << std::endl;

// =====================================================================
Expand All @@ -134,7 +134,7 @@ int main(int /* argc */, char * /* argv */[])

// Run simulation
timer.tic();
engine.simulate(tf, q0, v0);
engine.simulate(tf, q0, v0, std::nullopt, false, callback);
std::cout << "Simulation: " << timer.toc<std::milli>() << "ms" << std::endl;

// Write the log file
Expand Down
8 changes: 4 additions & 4 deletions core/examples/external_project/double_pendulum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ int main(int argc, char * argv[])
}

// Instantiate the controller
auto controller = std::make_shared<FunctionalController<>>(computeCommand, internalDynamics);
controller->initialize(robot);
robot->setController(
std::make_shared<FunctionalController<>>(computeCommand, internalDynamics));

// Instantiate the engine
Engine engine{};
engine.initialize(robot, controller, callback);
engine.addRobot(robot);
std::cout << "Initialization: " << timer.toc<std::milli>() << "ms" << std::endl;

// =====================================================================
Expand All @@ -97,7 +97,7 @@ int main(int argc, char * argv[])

// Run simulation
timer.tic();
engine.simulate(tf, q0, v0);
engine.simulate(tf, q0, v0, std::nullopt, callback);
std::cout << "Simulation: " << timer.toc<std::milli>() << "ms" << std::endl;

// Write the log file
Expand Down
6 changes: 4 additions & 2 deletions core/include/jiminy/core/control/abstract_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ namespace jiminy
class TelemetrySender;
class TelemetryData;
class Robot;
class Engine;

/// \brief Generic interface for any controller.
///
Expand Down Expand Up @@ -53,7 +52,10 @@ namespace jiminy
explicit AbstractController() noexcept;
virtual ~AbstractController();

/// \brief Set the parameters of the controller.
/// \brief Initialize the internal state of the controller for a given robot.
///
/// \details This method can be called multiple times with different robots. The internal
/// state of the controller will be systematically overwritten.
///
/// \param[in] robot Robot
virtual void initialize(std::weak_ptr<const Robot> robot);
Expand Down

0 comments on commit df9b31e

Please sign in to comment.