Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into new_docs
Browse files Browse the repository at this point in the history
  • Loading branch information
costashatz committed Jan 31, 2024
2 parents 868c6c1 + 6af12d8 commit e231905
Show file tree
Hide file tree
Showing 32 changed files with 1,074 additions and 301 deletions.
6 changes: 3 additions & 3 deletions ci/install_magnum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ git clone https://github.com/mosra/magnum.git
cd magnum
mkdir build && cd build
# Ubuntu
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DWITH_AUDIO=ON -DWITH_DEBUGTOOLS=ON -DWITH_GL=ON -DWITH_MESHTOOLS=ON -DWITH_PRIMITIVES=ON -DWITH_SCENEGRAPH=ON -DWITH_SHADERS=ON -DWITH_TEXT=ON -DWITH_TEXTURETOOLS=ON -DWITH_TRADE=ON -DWITH_GLFWAPPLICATION=ON -DWITH_WINDOWLESSGLXAPPLICATION=ON -DWITH_OPENGLTESTER=ON -DWITH_ANYAUDIOIMPORTER=ON -DWITH_ANYIMAGECONVERTER=ON -DWITH_ANYIMAGEIMPORTER=ON -DWITH_ANYSCENEIMPORTER=ON -DWITH_MAGNUMFONT=ON -DWITH_OBJIMPORTER=ON -DWITH_TGAIMPORTER=ON -DWITH_WAVAUDIOIMPORTER=ON -DCMAKE_INSTALL_PREFIX=/usr ..
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DMAGNUM_WITH_AUDIO=ON -DMAGNUM_WITH_DEBUGTOOLS=ON -DMAGNUM_WITH_GL=ON -DMAGNUM_WITH_MESHTOOLS=ON -DMAGNUM_WITH_PRIMITIVES=ON -DMAGNUM_WITH_SCENEGRAPH=ON -DMAGNUM_WITH_SHADERS=ON -DMAGNUM_WITH_TEXT=ON -DMAGNUM_WITH_TEXTURETOOLS=ON -DMAGNUM_WITH_TRADE=ON -DMAGNUM_WITH_GLFWAPPLICATION=ON -DMAGNUM_WITH_WINDOWLESSEGLAPPLICATION=ON -DMAGNUM_WITH_OPENGLTESTER=ON -DMAGNUM_WITH_ANYAUDIOIMPORTER=ON -DMAGNUM_WITH_ANYIMAGECONVERTER=ON -DMAGNUM_WITH_ANYIMAGEIMPORTER=ON -DMAGNUM_WITH_ANYSCENEIMPORTER=ON -DMAGNUM_WITH_MAGNUMFONT=ON -DMAGNUM_WITH_OBJIMPORTER=ON -DMAGNUM_WITH_TGAIMPORTER=ON -DMAGNUM_WITH_WAVAUDIOIMPORTER=ON -DMAGNUM_TARGET_EGL=ON -DCMAKE_INSTALL_PREFIX=/usr ..
make -j
sudo make install
cd ../..
Expand All @@ -31,7 +31,7 @@ cd ../..
git clone https://github.com/mosra/magnum-plugins.git
cd magnum-plugins
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DWITH_ASSIMPIMPORTER=ON -DWITH_DDSIMPORTER=ON -DWITH_JPEGIMPORTER=ON -DWITH_OPENGEXIMPORTER=ON -DWITH_PNGIMPORTER=ON -DWITH_TINYGLTFIMPORTER=ON -DWITH_STBTRUETYPEFONT=ON -DCMAKE_INSTALL_PREFIX=/usr ..
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DMAGNUM_WITH_ASSIMPIMPORTER=ON -DMAGNUM_WITH_DDSIMPORTER=ON -DMAGNUM_WITH_JPEGIMPORTER=ON -DMAGNUM_WITH_OPENGEXIMPORTER=ON -DMAGNUM_WITH_PNGIMPORTER=ON -DMAGNUM_WITH_TINYGLTFIMPORTER=ON -DMAGNUM_WITH_STBTRUETYPEFONT=ON -DCMAKE_INSTALL_PREFIX=/usr ..
make -j
sudo make install
cd ../..
Expand All @@ -40,7 +40,7 @@ cd ../..
git clone https://github.com/mosra/magnum-integration.git
cd magnum-integration
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DWITH_DART=ON -DWITH_EIGEN=ON -DCMAKE_INSTALL_PREFIX=/usr -DDART_DIR=$DART_DIR ..
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DMAGNUM_WITH_DART=ON -DMAGNUM_WITH_EIGEN=ON -DCMAKE_INSTALL_PREFIX=/usr -DDART_DIR=$DART_DIR ..
make -j
sudo make install
cd ../..
Expand Down
86 changes: 86 additions & 0 deletions cmake/FindEGL.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#.rst:
# Find EGL
# --------
#
# Finds the EGL library. This module defines:
#
# EGL_FOUND - True if EGL library is found
# EGL::EGL - EGL imported target
#
# Additionally these variables are defined for internal usage:
#
# EGL_LIBRARY - EGL library
# EGL_INCLUDE_DIR - Include dir
#

#
# This file is part of Magnum.
#
# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
# 2020, 2021, 2022 Vladimír Vondruš <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#

# Under Emscripten, GL is linked implicitly. With MINIMAL_RUNTIME you need to
# specify -lGL. Simply set the library name to that.
if(CORRADE_TARGET_EMSCRIPTEN)
set(EGL_LIBRARY GL CACHE STRING "Path to a library." FORCE)
else()
find_library(EGL_LIBRARY NAMES
EGL

# ANGLE (CMake doesn't search for lib prefix on Windows)
libEGL

# On iOS a part of OpenGLES
OpenGLES)
endif()

# Include dir
find_path(EGL_INCLUDE_DIR NAMES
EGL/egl.h

# iOS
EAGL.h)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(EGL DEFAULT_MSG
EGL_LIBRARY
EGL_INCLUDE_DIR)

if(NOT TARGET EGL::EGL)
# Work around BUGGY framework support on macOS. Do this also in case of
# Emscripten, since there we don't have a location either.
# http://public.kitware.com/pipermail/cmake/2016-April/063179.html
if((APPLE AND ${EGL_LIBRARY} MATCHES "\\.framework$") OR CORRADE_TARGET_EMSCRIPTEN)
add_library(EGL::EGL INTERFACE IMPORTED)
set_property(TARGET EGL::EGL APPEND PROPERTY
INTERFACE_LINK_LIBRARIES ${EGL_LIBRARY})
else()
add_library(EGL::EGL UNKNOWN IMPORTED)
set_property(TARGET EGL::EGL PROPERTY
IMPORTED_LOCATION ${EGL_LIBRARY})
endif()

set_target_properties(EGL::EGL PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${EGL_INCLUDE_DIR})
endif()

mark_as_advanced(EGL_LIBRARY EGL_INCLUDE_DIR)
20 changes: 14 additions & 6 deletions cmake/FindGLFW.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#
# This file is part of Magnum.
#
# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
# Vladimír Vondruš <[email protected]>
# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
# 2020, 2021, 2022 Vladimír Vondruš <[email protected]>
# Copyright © 2016 Jonathan Hale <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a
Expand All @@ -43,11 +43,17 @@
# DEALINGS IN THE SOFTWARE.
#

# GLFW installs cmake package config files to shared/ folder which handles
# dependencies in case GLFW is built statically. Try to find first, quietly, so
# it doesn't print loud messages when it's not found, since that's okay.
find_package(glfw3 CONFIG QUIET)
# GLFW installs cmake package config files which handles dependencies in case
# GLFW is built statically. Try to find first, quietly, so it doesn't print
# loud messages when it's not found, since that's okay. If the glfw target
# already exists, it means we're using it through a CMake subproject -- don't
# attempt to find the package in that case.
if(NOT TARGET glfw)
find_package(glfw3 CONFIG QUIET)
endif()

# If either a glfw config file was found or we have a subproject, point
# GLFW::GLFW to that and exit -- nothing else to do here.
if(TARGET glfw)
if(NOT TARGET GLFW::GLFW)
# Aliases of (global) targets are only supported in CMake 3.11, so we
Expand Down Expand Up @@ -81,6 +87,8 @@ if(CORRADE_TARGET_WINDOWS)
set(_GLFW_LIBRARY_PATH_SUFFIX lib-vc2017)
elseif(MSVC_VERSION VERSION_LESS 1930)
set(_GLFW_LIBRARY_PATH_SUFFIX lib-vc2019)
elseif(MSVC_VERSION VERSION_LESS 1940)
set(_GLFW_LIBRARY_PATH_SUFFIX lib-vc2022)
else()
message(FATAL_ERROR "Unsupported MSVC version")
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/RobotDARTConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ add_library(RobotDART::Simu INTERFACE IMPORTED)
set_target_properties(RobotDART::Simu PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${RobotDART_INCLUDE_DIRS}"
INTERFACE_LINK_DIRECTORIES "${RobotDART_LIBRARY_DIRS}"
INTERFACE_LINK_LIBRARIES "${RobotDART_LIBRARY};${RobotDART_LIBRARIES}"
INTERFACE_LINK_LIBRARIES "${RobotDART_LIBRARY};${RobotDART_LIBRARIES}@RobotDART_EXTRA_LIBS@"
INTERFACE_COMPILE_OPTIONS "@RobotDART_CXX_FLAGS@")

if(RobotDART_USE_MAGNUM)
Expand Down
8 changes: 2 additions & 6 deletions cmake/UthequeConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,13 @@ include(FindPackageHandleStandardArgs)
# CMAKE_MODULE_PATH
set(CMAKE_MODULE_PATH "@Utheque_CMAKE_MODULE_PATH@")

find_package(Boost REQUIRED filesystem)

set(Utheque_INCLUDE_DIRS "@Utheque_INCLUDE_DIRS@")

set(Utheque_LIBRARIES "Boost::filesystem")

add_library(Utheque INTERFACE IMPORTED)
set_target_properties(Utheque PROPERTIES
INTERFACE_LINK_LIBRARIES "${Utheque_LIBRARIES}"
INTERFACE_COMPILE_DEFINITIONS @Utheque_PREFIX@
INTERFACE_INCLUDE_DIRECTORIES "${Utheque_INCLUDE_DIRS}")
INTERFACE_INCLUDE_DIRECTORIES "${Utheque_INCLUDE_DIRS}"@Utheque_DEPS@
INTERFACE_COMPILE_OPTIONS "@Utheque_CXX_FLAGS@")

# Handle the QUIET and REQUIRED arguments
find_package_handle_standard_args(
Expand Down
2 changes: 1 addition & 1 deletion cmake/example_utheque/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ project(utheque_example)
find_package(Utheque REQUIRED)

add_executable(utheque_example example_utheque.cpp)
set_target_properties(utheque_example PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED YES)
set_target_properties(utheque_example PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED YES) # This is not really needed!
target_link_libraries(utheque_example PUBLIC Utheque)
2 changes: 1 addition & 1 deletion src/docs/docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ git clone https://github.com/mosra/magnum.git
cd magnum
mkdir build && cd build
# Ubuntu
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_AUDIO=ON -DWITH_DEBUGTOOLS=ON -DWITH_GL=ON -DWITH_MESHTOOLS=ON -DWITH_PRIMITIVES=ON -DWITH_SCENEGRAPH=ON -DWITH_SHADERS=ON -DWITH_TEXT=ON -DWITH_TEXTURETOOLS=ON -DWITH_TRADE=ON -DWITH_GLFWAPPLICATION=ON -DWITH_WINDOWLESSGLXAPPLICATION=ON -DWITH_OPENGLTESTER=ON -DWITH_ANYAUDIOIMPORTER=ON -DWITH_ANYIMAGECONVERTER=ON -DWITH_ANYIMAGEIMPORTER=ON -DWITH_ANYSCENEIMPORTER=ON -DWITH_MAGNUMFONT=ON -DWITH_OBJIMPORTER=ON -DWITH_TGAIMPORTER=ON -DWITH_WAVAUDIOIMPORTER=ON .. # this will enable almost all features of Magnum that are not necessarily needed for robot_dart (please refer to the documentation of Magnum for more details on selecting only the ones that you need)
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_AUDIO=ON -DWITH_DEBUGTOOLS=ON -DWITH_GL=ON -DWITH_MESHTOOLS=ON -DWITH_PRIMITIVES=ON -DWITH_SCENEGRAPH=ON -DWITH_SHADERS=ON -DWITH_TEXT=ON -DWITH_TEXTURETOOLS=ON -DWITH_TRADE=ON -DWITH_GLFWAPPLICATION=ON -DWITH_WINDOWLESSEGLAPPLICATION=ON -DWITH_OPENGLTESTER=ON -DWITH_ANYAUDIOIMPORTER=ON -DWITH_ANYIMAGECONVERTER=ON -DWITH_ANYIMAGEIMPORTER=ON -DWITH_ANYSCENEIMPORTER=ON -DWITH_MAGNUMFONT=ON -DWITH_OBJIMPORTER=ON -DWITH_TGAIMPORTER=ON -DWITH_WAVAUDIOIMPORTER=ON -DTARGET_HEADLESS=ON .. # this will enable almost all features of Magnum that are not necessarily needed for robot_dart (please refer to the documentation of Magnum for more details on selecting only the ones that you need)
# Mac OSX
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_AUDIO=ON -DWITH_DEBUGTOOLS=ON -DWITH_GL=ON -DWITH_MESHTOOLS=ON -DWITH_PRIMITIVES=ON -DWITH_SCENEGRAPH=ON -DWITH_SHADERS=ON -DWITH_TEXT=ON -DWITH_TEXTURETOOLS=ON -DWITH_TRADE=ON -DWITH_GLFWAPPLICATION=ON -DWITH_WINDOWLESSCGLAPPLICATION=ON -DWITH_OPENGLTESTER=ON -DWITH_ANYAUDIOIMPORTER=ON -DWITH_ANYIMAGECONVERTER=ON -DWITH_ANYIMAGEIMPORTER=ON -DWITH_ANYSCENEIMPORTER=ON -DWITH_MAGNUMFONT=ON -DWITH_OBJIMPORTER=ON -DWITH_TGAIMPORTER=ON -DWITH_WAVAUDIOIMPORTER=ON .. # this will enable almost all features of Magnum that are not necessarily needed for robot_dart (please refer to the documentation of Magnum for more details on selecting only the ones that you need)
make -j
Expand Down
39 changes: 39 additions & 0 deletions src/examples/vx300.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#include <robot_dart/control/pd_control.hpp>
#include <robot_dart/robot_dart_simu.hpp>
#include <robot_dart/robots/vx300.hpp>

#ifdef GRAPHIC
#include <robot_dart/gui/magnum/graphics.hpp>
#endif

int main()
{
auto robot = std::make_shared<robot_dart::robots::Vx300>();
robot->set_actuator_types("servo");

Eigen::VectorXd ctrl = robot_dart::make_vector({0.0, 1.0, -1.5, 1.0, 0.5, 0.});

auto controller = std::make_shared<robot_dart::control::PDControl>(ctrl);
robot->add_controller(controller);

robot_dart::RobotDARTSimu simu;
simu.set_collision_detector("fcl");
#ifdef GRAPHIC
simu.set_graphics(std::make_shared<robot_dart::gui::magnum::Graphics>());
#endif
simu.add_robot(robot);
simu.add_checkerboard_floor();

for (auto& n : robot->dof_names()) {
std::cout << n << std::endl;
}

simu.run(2.5);

ctrl << 0.0, -0.5, 0.5, -0.5, 0., 1.;
controller->set_parameters(ctrl);
controller->set_pd(20., 0.);
simu.run(2.5);

return 0;
}
Loading

0 comments on commit e231905

Please sign in to comment.