Skip to content

Commit e231905

Browse files
committed
Merge remote-tracking branch 'origin' into new_docs
2 parents 868c6c1 + 6af12d8 commit e231905

32 files changed

+1074
-301
lines changed

ci/install_magnum.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ git clone https://github.com/mosra/magnum.git
2222
cd magnum
2323
mkdir build && cd build
2424
# Ubuntu
25-
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 ..
25+
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 ..
2626
make -j
2727
sudo make install
2828
cd ../..
@@ -31,7 +31,7 @@ cd ../..
3131
git clone https://github.com/mosra/magnum-plugins.git
3232
cd magnum-plugins
3333
mkdir build && cd build
34-
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 ..
34+
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 ..
3535
make -j
3636
sudo make install
3737
cd ../..
@@ -40,7 +40,7 @@ cd ../..
4040
git clone https://github.com/mosra/magnum-integration.git
4141
cd magnum-integration
4242
mkdir build && cd build
43-
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DWITH_DART=ON -DWITH_EIGEN=ON -DCMAKE_INSTALL_PREFIX=/usr -DDART_DIR=$DART_DIR ..
43+
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DMAGNUM_WITH_DART=ON -DMAGNUM_WITH_EIGEN=ON -DCMAKE_INSTALL_PREFIX=/usr -DDART_DIR=$DART_DIR ..
4444
make -j
4545
sudo make install
4646
cd ../..

cmake/FindEGL.cmake

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#.rst:
2+
# Find EGL
3+
# --------
4+
#
5+
# Finds the EGL library. This module defines:
6+
#
7+
# EGL_FOUND - True if EGL library is found
8+
# EGL::EGL - EGL imported target
9+
#
10+
# Additionally these variables are defined for internal usage:
11+
#
12+
# EGL_LIBRARY - EGL library
13+
# EGL_INCLUDE_DIR - Include dir
14+
#
15+
16+
#
17+
# This file is part of Magnum.
18+
#
19+
# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
20+
# 2020, 2021, 2022 Vladimír Vondruš <[email protected]>
21+
#
22+
# Permission is hereby granted, free of charge, to any person obtaining a
23+
# copy of this software and associated documentation files (the "Software"),
24+
# to deal in the Software without restriction, including without limitation
25+
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
26+
# and/or sell copies of the Software, and to permit persons to whom the
27+
# Software is furnished to do so, subject to the following conditions:
28+
#
29+
# The above copyright notice and this permission notice shall be included
30+
# in all copies or substantial portions of the Software.
31+
#
32+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
33+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
34+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
35+
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
36+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
37+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
38+
# DEALINGS IN THE SOFTWARE.
39+
#
40+
41+
# Under Emscripten, GL is linked implicitly. With MINIMAL_RUNTIME you need to
42+
# specify -lGL. Simply set the library name to that.
43+
if(CORRADE_TARGET_EMSCRIPTEN)
44+
set(EGL_LIBRARY GL CACHE STRING "Path to a library." FORCE)
45+
else()
46+
find_library(EGL_LIBRARY NAMES
47+
EGL
48+
49+
# ANGLE (CMake doesn't search for lib prefix on Windows)
50+
libEGL
51+
52+
# On iOS a part of OpenGLES
53+
OpenGLES)
54+
endif()
55+
56+
# Include dir
57+
find_path(EGL_INCLUDE_DIR NAMES
58+
EGL/egl.h
59+
60+
# iOS
61+
EAGL.h)
62+
63+
include(FindPackageHandleStandardArgs)
64+
find_package_handle_standard_args(EGL DEFAULT_MSG
65+
EGL_LIBRARY
66+
EGL_INCLUDE_DIR)
67+
68+
if(NOT TARGET EGL::EGL)
69+
# Work around BUGGY framework support on macOS. Do this also in case of
70+
# Emscripten, since there we don't have a location either.
71+
# http://public.kitware.com/pipermail/cmake/2016-April/063179.html
72+
if((APPLE AND ${EGL_LIBRARY} MATCHES "\\.framework$") OR CORRADE_TARGET_EMSCRIPTEN)
73+
add_library(EGL::EGL INTERFACE IMPORTED)
74+
set_property(TARGET EGL::EGL APPEND PROPERTY
75+
INTERFACE_LINK_LIBRARIES ${EGL_LIBRARY})
76+
else()
77+
add_library(EGL::EGL UNKNOWN IMPORTED)
78+
set_property(TARGET EGL::EGL PROPERTY
79+
IMPORTED_LOCATION ${EGL_LIBRARY})
80+
endif()
81+
82+
set_target_properties(EGL::EGL PROPERTIES
83+
INTERFACE_INCLUDE_DIRECTORIES ${EGL_INCLUDE_DIR})
84+
endif()
85+
86+
mark_as_advanced(EGL_LIBRARY EGL_INCLUDE_DIR)

cmake/FindGLFW.cmake

+14-6
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#
2121
# This file is part of Magnum.
2222
#
23-
# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
24-
# Vladimír Vondruš <[email protected]>
23+
# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
24+
# 2020, 2021, 2022 Vladimír Vondruš <[email protected]>
2525
# Copyright © 2016 Jonathan Hale <[email protected]>
2626
#
2727
# Permission is hereby granted, free of charge, to any person obtaining a
@@ -43,11 +43,17 @@
4343
# DEALINGS IN THE SOFTWARE.
4444
#
4545

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

55+
# If either a glfw config file was found or we have a subproject, point
56+
# GLFW::GLFW to that and exit -- nothing else to do here.
5157
if(TARGET glfw)
5258
if(NOT TARGET GLFW::GLFW)
5359
# Aliases of (global) targets are only supported in CMake 3.11, so we
@@ -81,6 +87,8 @@ if(CORRADE_TARGET_WINDOWS)
8187
set(_GLFW_LIBRARY_PATH_SUFFIX lib-vc2017)
8288
elseif(MSVC_VERSION VERSION_LESS 1930)
8389
set(_GLFW_LIBRARY_PATH_SUFFIX lib-vc2019)
90+
elseif(MSVC_VERSION VERSION_LESS 1940)
91+
set(_GLFW_LIBRARY_PATH_SUFFIX lib-vc2022)
8492
else()
8593
message(FATAL_ERROR "Unsupported MSVC version")
8694
endif()

cmake/RobotDARTConfig.cmake.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ add_library(RobotDART::Simu INTERFACE IMPORTED)
5353
set_target_properties(RobotDART::Simu PROPERTIES
5454
INTERFACE_INCLUDE_DIRECTORIES "${RobotDART_INCLUDE_DIRS}"
5555
INTERFACE_LINK_DIRECTORIES "${RobotDART_LIBRARY_DIRS}"
56-
INTERFACE_LINK_LIBRARIES "${RobotDART_LIBRARY};${RobotDART_LIBRARIES}"
56+
INTERFACE_LINK_LIBRARIES "${RobotDART_LIBRARY};${RobotDART_LIBRARIES}@RobotDART_EXTRA_LIBS@"
5757
INTERFACE_COMPILE_OPTIONS "@RobotDART_CXX_FLAGS@")
5858

5959
if(RobotDART_USE_MAGNUM)

cmake/UthequeConfig.cmake.in

+2-6
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,13 @@ include(FindPackageHandleStandardArgs)
1212
# CMAKE_MODULE_PATH
1313
set(CMAKE_MODULE_PATH "@Utheque_CMAKE_MODULE_PATH@")
1414

15-
find_package(Boost REQUIRED filesystem)
16-
1715
set(Utheque_INCLUDE_DIRS "@Utheque_INCLUDE_DIRS@")
1816

19-
set(Utheque_LIBRARIES "Boost::filesystem")
20-
2117
add_library(Utheque INTERFACE IMPORTED)
2218
set_target_properties(Utheque PROPERTIES
23-
INTERFACE_LINK_LIBRARIES "${Utheque_LIBRARIES}"
2419
INTERFACE_COMPILE_DEFINITIONS @Utheque_PREFIX@
25-
INTERFACE_INCLUDE_DIRECTORIES "${Utheque_INCLUDE_DIRS}")
20+
INTERFACE_INCLUDE_DIRECTORIES "${Utheque_INCLUDE_DIRS}"@Utheque_DEPS@
21+
INTERFACE_COMPILE_OPTIONS "@Utheque_CXX_FLAGS@")
2622

2723
# Handle the QUIET and REQUIRED arguments
2824
find_package_handle_standard_args(

cmake/example_utheque/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ project(utheque_example)
44
find_package(Utheque REQUIRED)
55

66
add_executable(utheque_example example_utheque.cpp)
7-
set_target_properties(utheque_example PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED YES)
7+
set_target_properties(utheque_example PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED YES) # This is not really needed!
88
target_link_libraries(utheque_example PUBLIC Utheque)

src/docs/docs/install.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ git clone https://github.com/mosra/magnum.git
129129
cd magnum
130130
mkdir build && cd build
131131
# Ubuntu
132-
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)
132+
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)
133133
# Mac OSX
134134
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)
135135
make -j

src/examples/vx300.cpp

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#include <robot_dart/control/pd_control.hpp>
2+
#include <robot_dart/robot_dart_simu.hpp>
3+
#include <robot_dart/robots/vx300.hpp>
4+
5+
#ifdef GRAPHIC
6+
#include <robot_dart/gui/magnum/graphics.hpp>
7+
#endif
8+
9+
int main()
10+
{
11+
auto robot = std::make_shared<robot_dart::robots::Vx300>();
12+
robot->set_actuator_types("servo");
13+
14+
Eigen::VectorXd ctrl = robot_dart::make_vector({0.0, 1.0, -1.5, 1.0, 0.5, 0.});
15+
16+
auto controller = std::make_shared<robot_dart::control::PDControl>(ctrl);
17+
robot->add_controller(controller);
18+
19+
robot_dart::RobotDARTSimu simu;
20+
simu.set_collision_detector("fcl");
21+
#ifdef GRAPHIC
22+
simu.set_graphics(std::make_shared<robot_dart::gui::magnum::Graphics>());
23+
#endif
24+
simu.add_robot(robot);
25+
simu.add_checkerboard_floor();
26+
27+
for (auto& n : robot->dof_names()) {
28+
std::cout << n << std::endl;
29+
}
30+
31+
simu.run(2.5);
32+
33+
ctrl << 0.0, -0.5, 0.5, -0.5, 0., 1.;
34+
controller->set_parameters(ctrl);
35+
controller->set_pd(20., 0.);
36+
simu.run(2.5);
37+
38+
return 0;
39+
}

0 commit comments

Comments
 (0)