├── .gitignore ├── CMakeLists.txt ├── LICENSE.md ├── README.md ├── ThirdPartyLicenses.txt ├── apply_coding_style.sh ├── bin ├── CMakeLists.txt ├── Rcs.cpp ├── TestCore.cpp ├── TestGeometry.cpp ├── TestGraph.cpp ├── TestGraphics.cpp ├── TestGui.cpp ├── TestMath.cpp ├── TestOrientations.cpp ├── TestTasks.cpp └── template.hpp ├── cmake ├── CompileSettings.cmake ├── Export.cmake ├── Externals.cmake ├── FindEigen3.cmake ├── FindLibXml2-win.cmake ├── FindQwt.cmake ├── FindVortex.cmake ├── FindWM5.cmake ├── FindqpOASES.cmake └── RcsConfig.cmake.in ├── config ├── colors │ └── colors.xml ├── fonts │ ├── COPYRIGHT.TXT │ ├── Vera.ttf │ └── VeraMono.ttf ├── physics │ ├── physics.xml │ └── vortex.xml ├── textures │ ├── fMRT_bavaria.jpg │ ├── fMRT_bavaria.png │ ├── fMRT_pattern_brown_squares_2x2.png │ ├── fMRT_pattern_brown_squares_single.png │ └── fMRT_pattern_circular.png └── xml │ ├── AvatarSkeleton │ ├── cAction.xml │ ├── gScenario.xml │ ├── human-body.xml │ ├── human-full.xml │ ├── human-leftArm.xml │ ├── human-leftLeg.xml │ ├── human-rightArm.xml │ └── human-rightLeg.xml │ ├── BavariaTech │ ├── beerbench-articulated.xml │ ├── beerbench.xml │ ├── gPitcher_detailed.xml │ └── gPitcher_simple.xml │ ├── DexBot │ ├── LBR.xml │ ├── TwoArmLBR.xml │ ├── cAction.xml │ ├── cRotateBox.xml │ ├── gPPS.xml │ ├── gRotateBox.xml │ ├── gScenario.xml │ ├── sdh.xml │ └── sdh2.xml │ ├── Examples │ ├── cBoxLifting_simple.xml │ ├── cContactGrasping.xml │ ├── cCoupledKinematics.xml │ ├── cDistanceTask.xml │ ├── cFace.xml │ ├── cNormalAlign.xml │ ├── cPlanarArm7D.xml │ ├── cPlanarArmHighD.xml │ ├── cSoftPhysicsIK.xml │ ├── gBoxFiddle.xml │ ├── gCartesianBot.xml │ ├── gLabyrinth.xml │ ├── gPingPong.xml │ ├── gShapes.xml │ ├── gSoftPhysics.xml │ └── gSoftShirtPerson.xml │ ├── GenericHumanoid │ ├── cAction.xml │ ├── gScenario.xml │ ├── robot-body.xml │ ├── robot-full.xml │ ├── robot-leftArm.xml │ ├── robot-leftFingers.xml │ ├── robot-leftLeg.xml │ ├── robot-rightArm.xml │ ├── robot-rightFingers.xml │ └── robot-rightLeg.xml │ ├── HumanModel │ └── cHumanModel.xml │ ├── Husky │ ├── husky-all.xml │ └── husky.xml │ ├── LightTraverse │ ├── traverse_big.xml │ ├── traverse_big2.xml │ ├── traverse_big3.xml │ ├── traverse_big_parts.xml │ ├── traverse_big_side.xml │ ├── traverse_big_trans.xml │ ├── traverse_long.xml │ ├── traverse_small.xml │ ├── traverse_small_parts.xml │ └── traverse_small_side.xml │ ├── PPStest │ ├── cAction.xml │ └── gScenario.xml │ ├── QuanserQube │ └── gScenario.xml │ ├── Schunk │ ├── LWA-platform.xml │ ├── Schunk-ft-sensor.xml │ ├── cMinigolf.xml │ ├── gBotSchunk.xml │ ├── gScenario.xml │ ├── lwa.xml │ └── sdh.xml │ └── WAM │ ├── WAM-arm-primitives.xml │ ├── WAM-ft-sensor.xml │ ├── WAM-hand-primitives.xml │ ├── WAM-platform.xml │ ├── cAction.xml │ └── gScenario.xml ├── cpp.hint ├── debug └── gdb │ ├── __init__.py │ └── rcs_printers.py ├── doc ├── CMakeLists.txt ├── Doxyfile.in ├── DoxygenLayout.xml ├── Mainpage.dox └── images │ ├── RcsBody.png │ ├── RcsJoint.png │ ├── RcsShape.png │ ├── ShapeTypes.png │ ├── WAM-bulb.png │ ├── asimo-sim-1.5.png │ ├── atlas.jpg │ ├── darwin.jpg │ ├── ergo.jpg │ ├── example_fwdKinematics.png │ ├── example_prioritizedIK.png │ ├── face.jpg │ ├── humanoid.jpg │ ├── husky.jpg │ ├── jaco.jpg │ ├── lwa.jpg │ ├── mobile-manipulator.jpg │ ├── pa10-creature.jpg │ ├── pa10.jpg │ ├── rcs-logo.png │ ├── valkyrie.jpg │ └── wam.jpg ├── examples ├── CMakeLists.txt ├── ExampleBullet.cpp ├── ExampleForwardKinematics.cpp ├── ExampleHighGui.cpp ├── ExampleIK.cpp ├── ExampleKinetics.cpp ├── ExamplePeriodicCallback.cpp └── ExamplePrioritizedIK.cpp ├── external ├── EulerAngles.c ├── EulerAngles.h ├── QuatTypes.h └── Rcs_thirdPartyMath.c ├── pkgInfo.py ├── postInstallHook.sh ├── remove_coding_style_backups.sh ├── src ├── CMakeLists.txt ├── RcsCore │ ├── CMakeLists.txt │ ├── CompositeTask.cpp │ ├── CompositeTask.h │ ├── ControllerBase.cpp │ ├── ControllerBase.h │ ├── HardwareComponent.cpp │ ├── HardwareComponent.h │ ├── IkSolverConstraintRMR.cpp │ ├── IkSolverConstraintRMR.h │ ├── IkSolverPrioRMR.cpp │ ├── IkSolverPrioRMR.h │ ├── IkSolverRMR.cpp │ ├── IkSolverRMR.h │ ├── KeyCatcherBase.cpp │ ├── KeyCatcherBase.h │ ├── MotionControlLayer.cpp │ ├── MotionControlLayer.h │ ├── PeriodicCallback.cpp │ ├── PeriodicCallback.h │ ├── PhysicsBase.cpp │ ├── PhysicsBase.h │ ├── PhysicsConfig.cpp │ ├── PhysicsConfig.h │ ├── PhysicsFactory.cpp │ ├── PhysicsFactory.h │ ├── Rcs_BVHParser.c │ ├── Rcs_BVHParser.h │ ├── Rcs_HTr.c │ ├── Rcs_HTr.h │ ├── Rcs_Mat3d.c │ ├── Rcs_Mat3d.h │ ├── Rcs_MatNd.c │ ├── Rcs_MatNd.h │ ├── Rcs_URDFParser.c │ ├── Rcs_URDFParser.h │ ├── Rcs_Vec3d.c │ ├── Rcs_Vec3d.h │ ├── Rcs_VecNd.c │ ├── Rcs_VecNd.h │ ├── Rcs_basicMath.c │ ├── Rcs_basicMath.h │ ├── Rcs_body.c │ ├── Rcs_body.h │ ├── Rcs_bool.h │ ├── Rcs_cmdLine.cpp │ ├── Rcs_cmdLine.h │ ├── Rcs_collisionModel.c │ ├── Rcs_collisionModel.h │ ├── Rcs_distanceWM5.cpp │ ├── Rcs_distanceWM5.h │ ├── Rcs_dynamics.c │ ├── Rcs_dynamics.h │ ├── Rcs_eigen.cpp │ ├── Rcs_eigen.h │ ├── Rcs_filters.cpp │ ├── Rcs_filters.h │ ├── Rcs_geometry.c │ ├── Rcs_geometry.h │ ├── Rcs_gradientTests.c │ ├── Rcs_gradientTests.h │ ├── Rcs_graph.c │ ├── Rcs_graph.h │ ├── Rcs_graphOpenRAVEParser.c │ ├── Rcs_graphOpenRAVEParser.h │ ├── Rcs_graphParser.c │ ├── Rcs_graphParser.h │ ├── Rcs_intersectionWM5.cpp │ ├── Rcs_intersectionWM5.h │ ├── Rcs_joint.c │ ├── Rcs_joint.h │ ├── Rcs_kinematics.c │ ├── Rcs_kinematics.h │ ├── Rcs_linAlg.c │ ├── Rcs_macros.c │ ├── Rcs_macros.h │ ├── Rcs_math.h │ ├── Rcs_mathTests.cpp │ ├── Rcs_mathTests.h │ ├── Rcs_mesh.c │ ├── Rcs_mesh.h │ ├── Rcs_msvc.cpp │ ├── Rcs_msvc.h │ ├── Rcs_parser.c │ ├── Rcs_parser.h │ ├── Rcs_quaternion.c │ ├── Rcs_quaternion.h │ ├── Rcs_resourcePath.cpp │ ├── Rcs_resourcePath.h │ ├── Rcs_sensor.c │ ├── Rcs_sensor.h │ ├── Rcs_shape.c │ ├── Rcs_shape.h │ ├── Rcs_stackTrace.cpp │ ├── Rcs_stlParser.cpp │ ├── Rcs_stlParser.h │ ├── Rcs_timer.c │ ├── Rcs_timer.h │ ├── Rcs_typedef.h │ ├── Rcs_utils.c │ ├── Rcs_utils.h │ ├── Rcs_utilsCPP.cpp │ ├── Rcs_utilsCPP.h │ ├── SegFaultHandler.h │ ├── SensorComponent.cpp │ ├── SensorComponent.h │ ├── SolverRAC.cpp │ ├── SolverRAC.h │ ├── StackVec.h │ ├── Task.cpp │ ├── Task.h │ ├── TaskAngularMomentum3D.cpp │ ├── TaskAngularMomentum3D.h │ ├── TaskCOM1D.cpp │ ├── TaskCOM1D.h │ ├── TaskCOM3D.cpp │ ├── TaskCOM3D.h │ ├── TaskCollision.cpp │ ├── TaskCollision.h │ ├── TaskCompositeXml.cpp │ ├── TaskCompositeXml.h │ ├── TaskCylindrical1D.cpp │ ├── TaskCylindrical1D.h │ ├── TaskCylindrical3D.cpp │ ├── TaskCylindrical3D.h │ ├── TaskCylindricalForce1D.cpp │ ├── TaskCylindricalForce1D.h │ ├── TaskCylindricalPos3D.cpp │ ├── TaskCylindricalPos3D.h │ ├── TaskDifferentialConstraint1D.cpp │ ├── TaskDifferentialConstraint1D.h │ ├── TaskDistance.cpp │ ├── TaskDistance.h │ ├── TaskDistance1D.cpp │ ├── TaskDistance1D.h │ ├── TaskDistance3D.cpp │ ├── TaskDistance3D.h │ ├── TaskEuler1D.cpp │ ├── TaskEuler1D.h │ ├── TaskEuler3D.cpp │ ├── TaskEuler3D.h │ ├── TaskFactory.cpp │ ├── TaskFactory.h │ ├── TaskGenericEuler3D.cpp │ ├── TaskGenericEuler3D.h │ ├── TaskGenericIK.cpp │ ├── TaskGenericIK.h │ ├── TaskInclination.cpp │ ├── TaskInclination.h │ ├── TaskJoint.cpp │ ├── TaskJoint.h │ ├── TaskJointLimit.cpp │ ├── TaskJointLimit.h │ ├── TaskJointLimitPlateau.cpp │ ├── TaskJointLimitPlateau.h │ ├── TaskJoints.cpp │ ├── TaskJoints.h │ ├── TaskOmega1D.cpp │ ├── TaskOmega1D.h │ ├── TaskOmega3D.cpp │ ├── TaskOmega3D.h │ ├── TaskPolar2D.cpp │ ├── TaskPolar2D.h │ ├── TaskPolarSurfaceNormal.cpp │ ├── TaskPolarSurfaceNormal.h │ ├── TaskPolarTarget2D.cpp │ ├── TaskPolarTarget2D.h │ ├── TaskPose5D.cpp │ ├── TaskPose5D.h │ ├── TaskPose6D.cpp │ ├── TaskPose6D.h │ ├── TaskPosition1D.cpp │ ├── TaskPosition1D.h │ ├── TaskPosition3D.cpp │ ├── TaskPosition3D.h │ ├── TaskPositionForce1D.cpp │ ├── TaskPositionForce1D.h │ ├── TaskPositionForce3D.cpp │ ├── TaskPositionForce3D.h │ ├── TaskPositionTarget3D.cpp │ ├── TaskPositionTarget3D.h │ ├── TaskRegion.cpp │ ├── TaskRegion.h │ ├── TaskRegionBoundingBox.cpp │ ├── TaskRegionBoundingBox.h │ ├── TaskRegionBoxInterval.cpp │ ├── TaskRegionBoxInterval.h │ ├── TaskRegionFactory.cpp │ ├── TaskRegionFactory.h │ ├── TaskSpaceBlender.cpp │ ├── TaskSpaceBlender.h │ ├── TaskSpherical1D.cpp │ ├── TaskSpherical1D.h │ ├── TaskSpherical3D.cpp │ ├── TaskSpherical3D.h │ ├── TaskSphericalForce1D.cpp │ ├── TaskSphericalForce1D.h │ ├── TaskStaticEffort.cpp │ ├── TaskStaticEffort.h │ ├── TaskVelocity1D.cpp │ ├── TaskVelocity1D.h │ ├── TaskVelocity3D.cpp │ ├── TaskVelocity3D.h │ ├── TaskVelocityJoint.cpp │ ├── TaskVelocityJoint.h │ ├── ViaPointSequence.cpp │ └── ViaPointSequence.h ├── RcsGraphics │ ├── ArrowNode.cpp │ ├── ArrowNode.h │ ├── BodyNode.cpp │ ├── BodyNode.h │ ├── BodyPointDragger.cpp │ ├── BodyPointDragger.h │ ├── BoxNode.cpp │ ├── BoxNode.h │ ├── CMakeLists.txt │ ├── COSNode.cpp │ ├── COSNode.h │ ├── CapsuleNode.cpp │ ├── CapsuleNode.h │ ├── CylinderNode.cpp │ ├── CylinderNode.h │ ├── DepthRenderer.cpp │ ├── DepthRenderer.h │ ├── FTSensorNode.cpp │ ├── FTSensorNode.h │ ├── GraphNode.cpp │ ├── GraphNode.h │ ├── HUD.cpp │ ├── HUD.h │ ├── KeyCatcher.cpp │ ├── KeyCatcher.h │ ├── MeshNode.cpp │ ├── MeshNode.h │ ├── MouseDragger.cpp │ ├── MouseDragger.h │ ├── NodeBase.cpp │ ├── NodeBase.h │ ├── PPSSensorNode.cpp │ ├── PPSSensorNode.h │ ├── RcsViewer.cpp │ ├── RcsViewer.h │ ├── Rcs_graphicsUtils.cpp │ ├── Rcs_graphicsUtils.h │ ├── RigidBodyTracker.cpp │ ├── RigidBodyTracker.h │ ├── SSRNode.cpp │ ├── SSRNode.h │ ├── ShapeNode.cpp │ ├── ShapeNode.h │ ├── SphereNode.cpp │ ├── SphereNode.h │ ├── TargetSetter.cpp │ ├── TargetSetter.h │ ├── TextNode3D.cpp │ ├── TextNode3D.h │ ├── TorusNode.cpp │ ├── TorusNode.h │ ├── TransformTrace.cpp │ ├── TransformTrace.h │ ├── VectorFieldNode.cpp │ ├── VectorFieldNode.h │ ├── VertexArrayNode.cpp │ └── VertexArrayNode.h ├── RcsGui │ ├── Atomic.hpp │ ├── CMakeLists.txt │ ├── ControllerWidgetBase.cpp │ ├── ControllerWidgetBase.h │ ├── DblSlider.cpp │ ├── DblSlider.h │ ├── DynamicDataPlot.cpp │ ├── DynamicDataPlot.h │ ├── ForceControlGui.cpp │ ├── ForceControlGui.h │ ├── GuiFactory.cpp │ ├── GuiFactory.h │ ├── HighGui.cpp │ ├── HighGui.h │ ├── HighGuiButton.cpp │ ├── HighGuiButton.h │ ├── HighGuiImage.cpp │ ├── HighGuiImage.h │ ├── HighGuiLabel.cpp │ ├── HighGuiLabel.h │ ├── HighGuiPlot.cpp │ ├── HighGuiPlot.h │ ├── HighGuiSlider.cpp │ ├── HighGuiSlider.h │ ├── HighGuiWidget.cpp │ ├── HighGuiWidget.h │ ├── HighGuiWindow.cpp │ ├── HighGuiWindow.h │ ├── JointSlider.cpp │ ├── JointSlider.h │ ├── JointWidget.cpp │ ├── JointWidget.h │ ├── LcdSlider.cpp │ ├── LcdSlider.h │ ├── MatNdWidget.cpp │ ├── MatNdWidget.h │ ├── PPSGui.cpp │ ├── PPSGui.h │ ├── PPSWidget.cpp │ ├── PPSWidget.h │ ├── Rcs_guiFactory.c │ ├── Rcs_guiFactory.h │ ├── SimpleSlider.cpp │ ├── SimpleSlider.h │ ├── Slider1Dof.cpp │ ├── Slider1Dof.h │ ├── SliderCheck1Dof.cpp │ ├── SliderCheck1Dof.h │ ├── TaskWidget.cpp │ └── TaskWidget.h └── RcsPhysics │ ├── BulletDebugDrawer.cpp │ ├── BulletDebugDrawer.h │ ├── BulletDebugNode.cpp │ ├── BulletDebugNode.h │ ├── BulletDistance.cpp │ ├── BulletDistance.h │ ├── BulletHelpers.cpp │ ├── BulletHelpers.h │ ├── BulletHingeJoint.cpp │ ├── BulletHingeJoint.h │ ├── BulletJointBase.h │ ├── BulletRigidBody.cpp │ ├── BulletRigidBody.h │ ├── BulletSimulation.cpp │ ├── BulletSimulation.h │ ├── BulletSliderJoint.cpp │ ├── BulletSliderJoint.h │ ├── BulletSoftSimulation.cpp │ ├── BulletSoftSimulation.h │ ├── CMakeLists.txt │ ├── ContactsNode.cpp │ ├── ContactsNode.h │ ├── ForceDragger.cpp │ ├── ForceDragger.h │ ├── PhysicsHeadless.cpp │ ├── PhysicsNode.cpp │ ├── PhysicsNode.h │ └── Vortex │ ├── CMakeLists.txt │ ├── VortexHelpers.cpp │ ├── VortexHelpers.h │ ├── VortexSimulation.cpp │ └── VortexSimulation.h ├── unittest.in └── unittest.sh /.gitignore: -------------------------------------------------------------------------------- 1 | # This is a link created through cmake 2 | config/xml/ECS 3 | config/xml/MotorCycle 4 | config/xml/RebaPrediction 5 | install 6 | 7 | # Emacs backup files 8 | *~ 9 | 10 | .idea 11 | .vscode 12 | 13 | # Artistic style indentation backup files 14 | *.before_astyle 15 | 16 | klocwork 17 | 18 | build* 19 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017, Honda Research Institute Europe GmbH 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 19 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 20 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 22 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 23 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 25 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 26 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 27 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /apply_coding_style.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | RCS_DIR=$(cd `dirname $0` && pwd) 3 | 4 | ALLOWED_EXTENTIONS="h c cpp hpp" 5 | IGNORE_LIST="" 6 | #IGNORE_LIST="ShmDataTypeMacros.h" 7 | 8 | # If someone switches to a newer astyle version 9 | # just change this string to match the start of astyle version string. 10 | ASTYLE_VERSION="Artistic Style Version 3.1" 11 | ASTYLE_CMD=astyle 12 | 13 | 14 | # read filename(s) from parameters 15 | if [ -z $1 ]; then 16 | echo "Please pass the file(s) you wish to apply the coding style to." 17 | echo "Only C and C++ files (.h, .c, .cpp) are processed." 18 | fi 19 | 20 | function notInIgnoreList() 21 | { 22 | for i in $IGNORE_LIST; do 23 | # echo "testing $1 for ignores" 24 | if [[ "$1" == *"$i" ]]; then 25 | echo "$1 is in ignore list, skipping..." 26 | return 1 27 | fi 28 | done 29 | return 0 30 | } 31 | 32 | FILES="" 33 | for GIVEN_FILE in $@; do 34 | if [ -f $GIVEN_FILE ]; then 35 | if notInIgnoreList $GIVEN_FILE; then 36 | EXTENTION=${GIVEN_FILE##*.} 37 | for ALLOWED_EXTENTION in $ALLOWED_EXTENTIONS; do 38 | if [ "$ALLOWED_EXTENTION" = "$EXTENTION" ]; then 39 | FILES="$FILES $GIVEN_FILE" 40 | fi 41 | done 42 | fi 43 | else 44 | echo "Could not find file \"$GIVEN_FILE\"" 45 | fi 46 | done 47 | if [ "$FILES" = "" ]; then 48 | echo "You did not pass any source code files." 49 | exit 50 | fi 51 | 52 | if [[ "`$ASTYLE_CMD --version 2>&1`" != ${ASTYLE_VERSION}* ]]; then 53 | echo "You should use: ${ASTYLE_VERSION}"; 54 | exit 1; 55 | fi 56 | 57 | style="--style=allman \ 58 | --indent=spaces=2 \ 59 | --attach-extern-c \ 60 | --indent-switches \ 61 | --indent-preprocessor \ 62 | --indent-col1-comments \ 63 | --max-instatement-indent=70 \ 64 | --min-conditional-indent=0 \ 65 | --break-closing-brackets \ 66 | --add-brackets \ 67 | --convert-tabs \ 68 | --align-pointer=type \ 69 | --align-reference=type \ 70 | --pad-header \ 71 | --unpad-paren" 72 | options="--lineend=linux --formatted --suffix=.before_astyle" 73 | 74 | # finally, check all given files 75 | for FILE in $FILES; do 76 | $ASTYLE_CMD $style $options $FILE 77 | done 78 | -------------------------------------------------------------------------------- /bin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ADD_EXECUTABLE(TestCore TestCore.cpp) 2 | TARGET_LINK_LIBRARIES(TestCore RcsCore) 3 | 4 | ADD_EXECUTABLE(TestMath TestMath.cpp) 5 | TARGET_LINK_LIBRARIES(TestMath RcsCore) 6 | 7 | ADD_EXECUTABLE(TestGraph TestGraph.cpp) 8 | TARGET_LINK_LIBRARIES(TestGraph RcsCore) 9 | IF(ENABLE_C++11) 10 | TARGET_COMPILE_DEFINITIONS(TestGraph PRIVATE -DUSE_CPP_11) 11 | ENDIF(ENABLE_C++11) 12 | 13 | IF(NOT HEADLESS_BUILD) 14 | 15 | ADD_EXECUTABLE(Rcs Rcs.cpp) 16 | TARGET_LINK_LIBRARIES(Rcs RcsCore RcsGui RcsGraphics RcsPhysics) 17 | 18 | ADD_EXECUTABLE(TestGraphics TestGraphics.cpp) 19 | TARGET_LINK_LIBRARIES(TestGraphics RcsGraphics RcsGui) 20 | 21 | ADD_EXECUTABLE(TestGui TestGui.cpp) 22 | TARGET_LINK_LIBRARIES(TestGui RcsGui) 23 | 24 | ADD_EXECUTABLE(TestOrientations TestOrientations.cpp) 25 | TARGET_LINK_LIBRARIES(TestOrientations RcsCore RcsGui RcsGraphics) 26 | 27 | ADD_EXECUTABLE(TestGeometry TestGeometry.cpp) 28 | TARGET_LINK_LIBRARIES(TestGeometry RcsCore RcsGui RcsGraphics RcsPhysics) 29 | 30 | ADD_EXECUTABLE(TestTasks TestTasks.cpp) 31 | TARGET_LINK_LIBRARIES(TestTasks RcsCore RcsGui RcsGraphics RcsPhysics) 32 | 33 | # Install the binaries 34 | INSTALL(TARGETS TestCore TestMath TestGraph Rcs TestGraphics TestGui TestOrientations TestGeometry TestTasks RUNTIME DESTINATION bin LIBRARY DESTINATION lib) 35 | 36 | ENDIF(NOT HEADLESS_BUILD) 37 | -------------------------------------------------------------------------------- /bin/template.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef TEMPLATE_H 35 | #define TEMPLATE_H 36 | 37 | #include 38 | 39 | template bool logSomething() 40 | { 41 | bool success = true; 42 | int lineNumber = __LINE__; 43 | RLOG(3, "Logged line number must be 46"); 44 | 45 | if (lineNumber != 45) 46 | { 47 | RLOG(2, "line number is %d, but __LINE__ is 45", lineNumber); 48 | success = false; 49 | } 50 | 51 | RLOGS(1, "%s testing line extraction", success ? "SUCCESS" : "FAILURE"); 52 | 53 | return success; 54 | } 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /cmake/CompileSettings.cmake: -------------------------------------------------------------------------------- 1 | # Global C++11 settings 2 | IF(ENABLE_C++11) 3 | SET(CMAKE_CXX_STANDARD 11) 4 | SET(CMAKE_CXX_STANDARD_REQUIRED ON) 5 | ELSEIF(UNIX) 6 | SET(CMAKE_CXX_FLAGS "-std=c++0x") 7 | ENDIF() 8 | 9 | # Some special treatment for 32-bit and 64-bit machines 10 | IF(CMAKE_SIZEOF_VOID_P EQUAL 8) 11 | ADD_DEFINITIONS(-D__64BIT__) 12 | ELSE() 13 | ADD_DEFINITIONS(-D__32BIT__) 14 | ENDIF() 15 | 16 | 17 | 18 | IF(WIN32) 19 | 20 | ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) 21 | IF (NOT (MSVC_VERSION LESS 1900)) 22 | ADD_DEFINITIONS(-DHAVE_STRUCT_TIMESPEC) 23 | ENDIF() 24 | 25 | # Create shared libraries for Linux and Windows 26 | # For CMake 3.4 and higher, there is an easy way to create windows dlls. For 27 | # details, see http://www.kitware.com/blog/home/post/939 28 | IF (CMAKE_VERSION VERSION_LESS 3.4) 29 | MESSAGE(FATAL_ERROR "CMake version too old, at least 3.4 is needed") 30 | ELSE() 31 | SET(BUILD_SHARED_LIBS ON) 32 | SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) 33 | SET(CREATE_WIN_DLL TRUE) 34 | ADD_DEFINITIONS(-DWIN_DLL) 35 | ENDIF() 36 | 37 | ELSEIF(UNIX) 38 | 39 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic -fPIC -Wno-long-long -Wno-variadic-macros -std=c99 -ggdb") 40 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -fPIC -Wno-format -Wno-long-long -Wno-variadic-macros -ggdb") 41 | ADD_DEFINITIONS(-D__linux__) 42 | 43 | IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") 44 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -rdynamic") 45 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -rdynamic") 46 | ENDIF() 47 | 48 | IF(${CMAKE_BUILD_TYPE} STREQUAL "Debug") 49 | # setting march to core2 to enable valgrind debugging (also good for Xeon) 50 | # Low level optimization for debug mode, flag for checking stack corruption, flag for debug output 51 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=core2 -O0 -fstack-protector-all") 52 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=core2 -O0 -fstack-protector-all") 53 | ELSE() 54 | # setting march to native for optimal performance on local machine 55 | # Strong optimization for release mode 56 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native -O2") 57 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -O2") 58 | ENDIF() 59 | 60 | ENDIF() 61 | 62 | -------------------------------------------------------------------------------- /cmake/FindLibXml2-win.cmake: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # 1. Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # 11 | # 2. Redistributions in binary form must reproduce the above copyright notice, 12 | # this list of conditions and the following disclaimer in the documentation 13 | # and/or other materials provided with the distribution. 14 | # 15 | # 3. Neither the name of the copyright holder nor the names of its 16 | # contributors may be used to endorse or promote products derived from 17 | # this software without specific prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY EXPRESS OR 20 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | # IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 25 | # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 26 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 27 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 28 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | ################################################################################ 31 | 32 | IF (WIN32) 33 | 34 | INCLUDE(FindPackageHandleStandardArgs) 35 | 36 | IF(DEFINED ENV{LIBXML2_DIR}) 37 | SET(LIBXML2 "$ENV{LIBXML2_DIR}") 38 | ENDIF() 39 | 40 | SET(LIBXML2_DIR_HINT "$ENV{SIT}/External/libxml2-win/2.78") 41 | SET(LIBXML2_INCDIR_HINT "$ENV{SIT}/External/libxml2-win/2.78") 42 | SET(LIBXML2_LIBDIR_HINT "$ENV{SIT}/External/libxml2-win/2.78/lib/$ENV{MAKEFILE_PLATFORM}") 43 | 44 | FIND_PATH(LIBXML2_INCLUDE_DIR 45 | libxml/xmlversion.h 46 | HINTS "${LIBXML2_INCDIR_HINT}" 47 | PATH_SUFFIXES include 48 | ) 49 | 50 | FIND_LIBRARY(LIBXML2_LIBRARIES 51 | NAMES RcsLibXml2.lib 52 | HINTS "${LIBXML2_DIR_HINT}" 53 | PATH_SUFFIXES lib/$ENV{MAKEFILE_PLATFORM} 54 | ) 55 | 56 | SET(LIBXML2_INCLUDE_DIR ${LIBXML2_INCLUDE_DIR}) 57 | SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES}) 58 | 59 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBXML2 DEFAULT_MSG 60 | LIBXML2_INCLUDE_DIR 61 | LIBXML2_LIBRARIES 62 | ) 63 | 64 | SET(LIBXML2_FOUND ${LIBXML2_FOUND}) 65 | 66 | ENDIF(WIN32) 67 | -------------------------------------------------------------------------------- /cmake/FindWM5.cmake: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # 1. Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # 11 | # 2. Redistributions in binary form must reproduce the above copyright notice, 12 | # this list of conditions and the following disclaimer in the documentation 13 | # and/or other materials provided with the distribution. 14 | # 15 | # 3. Neither the name of the copyright holder nor the names of its 16 | # contributors may be used to endorse or promote products derived from 17 | # this software without specific prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY EXPRESS OR 20 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | # IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 25 | # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 26 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 27 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 28 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | ################################################################################ 31 | 32 | INCLUDE(FindPackageHandleStandardArgs) 33 | 34 | IF( DEFINED ENV{WM5_DIR} ) 35 | SET( WM5_DIR "$ENV{WM5_DIR}" ) 36 | ENDIF() 37 | 38 | SET(WM5_DIR_HINT "$ENV{SIT}/External/GeometricTools/5.10/") 39 | SET(WM5_DIR_HINT2 "${PROJECT_SOURCE_DIR}/../thirdParty/WildMagic5/SDK/Library/ReleaseDynamic/") 40 | SET(WM5_DIR_HINT3 "${PROJECT_SOURCE_DIR}/../thirdParty/WildMagic5/SDK/Include") 41 | 42 | FIND_PATH(WM5_INCLUDE_DIR 43 | Wm5Vector3.h 44 | HINTS "${WM5_DIR_HINT}" "${WM5_DIR_HINT2}" "${WM5_DIR_HINT3}" 45 | ENV WM5_DIR 46 | PATH_SUFFIXES include 47 | ) 48 | 49 | FIND_LIBRARY(WM5_CORE_LIBRARY 50 | NAMES Wm5Core 51 | HINTS "${WM5_DIR_HINT}" "${WM5_DIR_HINT2}" "${WM5_DIR_HINT3}" 52 | ENV WM5_DIR 53 | PATH_SUFFIXES lib/$ENV{MAKEFILE_PLATFORM} 54 | ) 55 | 56 | FIND_LIBRARY(WM5_MATHEMATICS_LIBRARY 57 | NAMES Wm5Mathematics 58 | HINTS "${WM5_DIR_HINT}" "${WM5_DIR_HINT2}" "${WM5_DIR_HINT3}" 59 | ENV WM5_DIR 60 | PATH_SUFFIXES lib/$ENV{MAKEFILE_PLATFORM} 61 | ) 62 | 63 | SET(WM5_INCLUDE_DIR ${WM5_INCLUDE_DIR}) 64 | SET(WM5_LIBRARIES ${WM5_MATHEMATICS_LIBRARY} ${WM5_CORE_LIBRARY}) 65 | IF(UNIX) 66 | SET(WM5_FLAGS "-isystem ${WM5_INCLUDE_DIR}") 67 | ENDIF(UNIX) 68 | SET(WM5_DEFINITIONS USE_WM5) 69 | 70 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(WM5 DEFAULT_MSG 71 | WM5_INCLUDE_DIR 72 | WM5_LIBRARIES 73 | ) 74 | 75 | SET(WM5_FOUND ${WM5_FOUND}) 76 | -------------------------------------------------------------------------------- /cmake/FindqpOASES.cmake: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # 1. Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # 11 | # 2. Redistributions in binary form must reproduce the above copyright notice, 12 | # this list of conditions and the following disclaimer in the documentation 13 | # and/or other materials provided with the distribution. 14 | # 15 | # 3. Neither the name of the copyright holder nor the names of its 16 | # contributors may be used to endorse or promote products derived from 17 | # this software without specific prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY EXPRESS OR 20 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | # IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 25 | # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 26 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 27 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 28 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | ################################################################################ 31 | 32 | INCLUDE(FindPackageHandleStandardArgs) 33 | 34 | IF( DEFINED ENV{QPOASES_DIR} ) 35 | SET( QPOASES_DIR "$ENV{QPOASES_DIR}" ) 36 | ENDIF() 37 | 38 | SET(QPOASES_DIR_HINT1 "$ENV{SIT}/External/qpOASES/3.2/$ENV{MAKEFILE_PLATFORM}") 39 | SET(QPOASES_DIR_HINT2 "$ENV{SIT}/External/qpOASES-3.2.1") 40 | 41 | FIND_PATH(QPOASES_INCLUDE_DIR 42 | qpOASES.hpp 43 | HINTS "${QPOASES_DIR_HINT1}" "${QPOASES_DIR_HINT2}" 44 | ENV QPOASES_DIR 45 | PATH_SUFFIXES include 46 | ) 47 | 48 | FIND_LIBRARY(QPOASES_LIBRARIES 49 | NAMES qpOASES-shared qpOASES qpOASES.lib 50 | HINTS "${QPOASES_DIR_HINT1}" "${QPOASES_DIR_HINT2}" 51 | ENV QPOASES_DIR 52 | PATH_SUFFIXES lib 53 | ) 54 | 55 | SET(QPOASES_INCLUDE_DIR ${QPOASES_INCLUDE_DIR}) 56 | SET(QPOASES_LIBRARIES ${QPOASES_LIBRARIES}) 57 | 58 | # The __USE_LONG_INTEGERS__ __USE_LONG_FINTS__ are set within the qpOASES 59 | # build. We need to consider them here to match the function signatures. 60 | # Otherwise, we get weird linker errors about non-matching rvalues. 61 | IF(UNIX) 62 | SET(QPOASES_DEFINITIONS USE_QPOASES LINUX __USE_LONG_INTEGERS__ __USE_LONG_FINTS__) 63 | ELSE() 64 | SET(QPOASES_DEFINITIONS USE_QPOASES) 65 | ENDIF(UNIX) 66 | 67 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(QPOASES DEFAULT_MSG 68 | QPOASES_INCLUDE_DIR 69 | QPOASES_LIBRARIES 70 | ) 71 | 72 | SET(QPOASES_FOUND ${QPOASES_FOUND}) 73 | -------------------------------------------------------------------------------- /cmake/RcsConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # CMake package config 2 | @PACKAGE_INIT@ 3 | 4 | # Write across config vars which are important 5 | # This excludes Eigen and Octomap since they are not part of the interface 6 | SET(USE_BULLET @USE_BULLET@) 7 | SET(USE_EIGEN3 @USE_EIGEN3@) 8 | SET(USE_VORTEX @USE_VORTEX@) 9 | SET(HEADLESS_BUILD @HEADLESS_BUILD@) 10 | SET(VORTEX_ESSENTIALS_DIR @VORTEX_ESSENTIALS_DIR@ CACHE PATH "" FORCE) 11 | SET(BT_LIB_DIR @BT_LIB_DIR@ CACHE PATH "Bullet library directory") 12 | SET(BULLET_INCLUDE_DIRS @BULLET_INCLUDE_DIRS@ CACHE PATH "Bullet include directory") 13 | 14 | # Make FindQwt.cmake available 15 | LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) 16 | # Include dependencies 17 | INCLUDE("${CMAKE_CURRENT_LIST_DIR}/Externals.cmake") 18 | 19 | # Include targets definition 20 | INCLUDE("${CMAKE_CURRENT_LIST_DIR}/RcsTargets.cmake") 21 | 22 | # Check which included targets are available 23 | # For simplicity, the component names are equal to the target names 24 | # Note that the list of supported components always includes the UI parts even in headless mode 25 | # They are still supported, just not available. 26 | SET(_supported_components RcsCore RcsPhysics RcsGraphics RcsGui) 27 | FOREACH(_comp ${Rcs_FIND_COMPONENTS}) 28 | 29 | IF (NOT ";${_supported_components};" MATCHES ";${_comp};") 30 | SET(@PACKAGE_NAME@_FOUND FALSE) 31 | SET(@PACKAGE_NAME@_NOTFOUND_MESSAGE "Unsupported component: ${_comp}") 32 | ELSEIF(NOT TARGET ${_comp}) 33 | SET(@PACKAGE_NAME@_${_comp}_FOUND FALSE) 34 | ELSE() 35 | SET(@PACKAGE_NAME@_${_comp}_FOUND TRUE) 36 | ENDIF() 37 | 38 | ENDFOREACH() 39 | 40 | # Make Rcs config dir available to users 41 | SET(RCS_CONFIG_DIR "@PACKAGE_CONFIG_INSTALL_DIR@") 42 | 43 | # Handle REQUIRED and QUIET arguments, as well as required components 44 | # Note, REQUIRED_VARS only contains the config dir here since we use imported targets for the libraries 45 | FIND_PACKAGE_HANDLE_STANDARD_ARGS("@PACKAGE_NAME@" 46 | REQUIRED_VARS RCS_CONFIG_DIR 47 | HANDLE_COMPONENTS) 48 | -------------------------------------------------------------------------------- /config/fonts/Vera.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/config/fonts/Vera.ttf -------------------------------------------------------------------------------- /config/fonts/VeraMono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/config/fonts/VeraMono.ttf -------------------------------------------------------------------------------- /config/textures/fMRT_bavaria.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/config/textures/fMRT_bavaria.jpg -------------------------------------------------------------------------------- /config/textures/fMRT_bavaria.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/config/textures/fMRT_bavaria.png -------------------------------------------------------------------------------- /config/textures/fMRT_pattern_brown_squares_2x2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/config/textures/fMRT_pattern_brown_squares_2x2.png -------------------------------------------------------------------------------- /config/textures/fMRT_pattern_brown_squares_single.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/config/textures/fMRT_pattern_brown_squares_single.png -------------------------------------------------------------------------------- /config/textures/fMRT_pattern_circular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/config/textures/fMRT_pattern_circular.png -------------------------------------------------------------------------------- /config/xml/AvatarSkeleton/gScenario.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /config/xml/AvatarSkeleton/human-full.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /config/xml/AvatarSkeleton/human-leftArm.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /config/xml/AvatarSkeleton/human-leftLeg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /config/xml/AvatarSkeleton/human-rightArm.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /config/xml/AvatarSkeleton/human-rightLeg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /config/xml/BavariaTech/beerbench.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 28 | 30 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /config/xml/BavariaTech/gPitcher_simple.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /config/xml/DexBot/cAction.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /config/xml/DexBot/gScenario.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /config/xml/Examples/gPingPong.xml: -------------------------------------------------------------------------------- 1 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /config/xml/GenericHumanoid/cAction.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /config/xml/GenericHumanoid/gScenario.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /config/xml/GenericHumanoid/robot-body.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /config/xml/GenericHumanoid/robot-full.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /config/xml/GenericHumanoid/robot-leftArm.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /config/xml/GenericHumanoid/robot-leftLeg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /config/xml/GenericHumanoid/robot-rightArm.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /config/xml/GenericHumanoid/robot-rightLeg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /config/xml/LightTraverse/traverse_big_parts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /config/xml/LightTraverse/traverse_big_side.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /config/xml/LightTraverse/traverse_small_parts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /config/xml/PPStest/cAction.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /config/xml/PPStest/gScenario.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /config/xml/QuanserQube/gScenario.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /config/xml/Schunk/LWA-platform.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /config/xml/Schunk/Schunk-ft-sensor.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /config/xml/Schunk/gScenario.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 8 | 10 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /config/xml/WAM/WAM-ft-sensor.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 8 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /config/xml/WAM/WAM-platform.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /config/xml/WAM/cAction.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /config/xml/WAM/gScenario.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /cpp.hint: -------------------------------------------------------------------------------- 1 | 2 | #define RCSGRAPH_TRAVERSE_BODIES(graph) for (RcsBody* BODY = (graph)->root; BODY; BODY = RcsBody_depthFirstTraversalGetNext(BODY)) 3 | 4 | #define RCSBODY_TRAVERSE_BODIES(body) for (RcsBody* BODY = (body), *LAST = RcsBody_depthFirstTraversalGetNext(RcsBody_getLastChild(BODY)); BODY && BODY != LAST; BODY = RcsBody_depthFirstTraversalGetNext(BODY)) 5 | 6 | #define RCSBODY_TRAVERSE_CHILD_BODIES(body) for (RcsBody* BODY = RcsBody_depthFirstTraversalGetNext(body), *LAST = RcsBody_depthFirstTraversalGetNext(RcsBody_getLastChild(body)); BODY && BODY != LAST; BODY = RcsBody_depthFirstTraversalGetNext(BODY)) 7 | 8 | #define RCSGRAPH_TRAVERSE_JOINTS(graph) RCSGRAPH_TRAVERSE_BODIES(graph) RCSBODY_TRAVERSE_JOINTS(BODY) 9 | 10 | #define RCSGRAPH_TRAVERSE_SENSORS(graph) for (RcsSensor *SENSOR = (graph)->sensor; SENSOR; SENSOR=SENSOR->next) 11 | 12 | #define RCSBODY_TRAVERSE_JOINTS(body) for (RcsJoint *JNT = (body)->jnt ; JNT ; JNT=JNT->next) 13 | 14 | #define RCSBODY_TRAVERSE_SHAPES(body) for (RcsShape **sPtr = (RcsShape**)((body)->shape), *SHAPE = *sPtr; *sPtr; sPtr++, SHAPE=*sPtr) 15 | 16 | #define RCSPAIR_TRAVERSE(pairlist) for (RcsPair **pPtr = (RcsPair**)(pairlist), *PAIR = *pPtr; *pPtr; pPtr++, PAIR=*pPtr) 17 | 18 | #define RCSSENSOR_TRAVERSE_TEXELS(sensor) for (RcsTexel **sPtr = (RcsTexel**)((sensor)->texel), *TEXEL = *sPtr; *sPtr; sPtr++, TEXEL=*sPtr) 19 | -------------------------------------------------------------------------------- /debug/gdb/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # 1. Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # 11 | # 2. Redistributions in binary form must reproduce the above copyright notice, 12 | # this list of conditions and the following disclaimer in the documentation 13 | # and/or other materials provided with the distribution. 14 | # 15 | # 3. Neither the name of the copyright holder nor the names of its 16 | # contributors may be used to endorse or promote products derived from 17 | # this software without specific prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY EXPRESS OR 20 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | # IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 25 | # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 26 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 27 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 28 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | 31 | # Intentionally empty 32 | -------------------------------------------------------------------------------- /doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Target to generate API documentation with Doxygen 4 | # 5 | ################################################################################ 6 | IF(UNIX) 7 | 8 | FIND_PACKAGE(Doxygen) 9 | 10 | ELSE() 11 | 12 | SET(DOXYGEN_EXECUTABLE doxygen.exe) 13 | SET(DOXYGEN_FOUND TRUE) 14 | 15 | ENDIF(UNIX) 16 | 17 | IF(DOXYGEN_FOUND) 18 | 19 | CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile @ONLY) 20 | 21 | FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html) 22 | FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/images) 23 | FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/pdf) 24 | FILE(COPY ${CMAKE_CURRENT_SOURCE_DIR}/images DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) 25 | 26 | ADD_CUSTOM_TARGET(RcsDoc 27 | ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile 28 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 29 | COMMENT "Generating API documentation with Doxygen" VERBATIM) 30 | 31 | INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION doc) 32 | INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/images DESTINATION doc) 33 | INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/pdf DESTINATION doc) 34 | 35 | ENDIF(DOXYGEN_FOUND) 36 | -------------------------------------------------------------------------------- /doc/images/RcsBody.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/RcsBody.png -------------------------------------------------------------------------------- /doc/images/RcsJoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/RcsJoint.png -------------------------------------------------------------------------------- /doc/images/RcsShape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/RcsShape.png -------------------------------------------------------------------------------- /doc/images/ShapeTypes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/ShapeTypes.png -------------------------------------------------------------------------------- /doc/images/WAM-bulb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/WAM-bulb.png -------------------------------------------------------------------------------- /doc/images/asimo-sim-1.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/asimo-sim-1.5.png -------------------------------------------------------------------------------- /doc/images/atlas.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/atlas.jpg -------------------------------------------------------------------------------- /doc/images/darwin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/darwin.jpg -------------------------------------------------------------------------------- /doc/images/ergo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/ergo.jpg -------------------------------------------------------------------------------- /doc/images/example_fwdKinematics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/example_fwdKinematics.png -------------------------------------------------------------------------------- /doc/images/example_prioritizedIK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/example_prioritizedIK.png -------------------------------------------------------------------------------- /doc/images/face.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/face.jpg -------------------------------------------------------------------------------- /doc/images/humanoid.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/humanoid.jpg -------------------------------------------------------------------------------- /doc/images/husky.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/husky.jpg -------------------------------------------------------------------------------- /doc/images/jaco.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/jaco.jpg -------------------------------------------------------------------------------- /doc/images/lwa.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/lwa.jpg -------------------------------------------------------------------------------- /doc/images/mobile-manipulator.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/mobile-manipulator.jpg -------------------------------------------------------------------------------- /doc/images/pa10-creature.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/pa10-creature.jpg -------------------------------------------------------------------------------- /doc/images/pa10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/pa10.jpg -------------------------------------------------------------------------------- /doc/images/rcs-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/rcs-logo.png -------------------------------------------------------------------------------- /doc/images/valkyrie.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/valkyrie.jpg -------------------------------------------------------------------------------- /doc/images/wam.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HRI-EU/Rcs/e243e18dde6d907951997b6229a5978b0327d7d6/doc/images/wam.jpg -------------------------------------------------------------------------------- /examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ADD_EXECUTABLE(ExamplePeriodicCallback ExamplePeriodicCallback.cpp) 2 | TARGET_LINK_LIBRARIES(ExamplePeriodicCallback RcsCore) 3 | 4 | IF(NOT HEADLESS_BUILD) 5 | 6 | ADD_EXECUTABLE(ExampleHighGui ExampleHighGui.cpp) 7 | TARGET_LINK_LIBRARIES(ExampleHighGui RcsCore RcsGui) 8 | 9 | ADD_EXECUTABLE(ExampleIK ExampleIK.cpp) 10 | TARGET_LINK_LIBRARIES(ExampleIK RcsCore RcsGui RcsGraphics RcsPhysics) 11 | 12 | ADD_EXECUTABLE(ExamplePrioritizedIK ExamplePrioritizedIK.cpp) 13 | TARGET_LINK_LIBRARIES(ExamplePrioritizedIK RcsCore RcsGui RcsGraphics) 14 | 15 | ADD_EXECUTABLE(ExampleForwardKinematics ExampleForwardKinematics.cpp) 16 | TARGET_LINK_LIBRARIES(ExampleForwardKinematics RcsCore RcsGui RcsGraphics) 17 | 18 | ADD_EXECUTABLE(ExampleKinetics ExampleKinetics.cpp) 19 | TARGET_LINK_LIBRARIES(ExampleKinetics RcsCore RcsGui RcsGraphics RcsPhysics) 20 | 21 | IF(USE_BULLET) 22 | ADD_EXECUTABLE(ExampleBullet ExampleBullet.cpp) 23 | TARGET_LINK_LIBRARIES(ExampleBullet RcsPhysics) 24 | TARGET_INCLUDE_DIRECTORIES(ExampleBullet SYSTEM PRIVATE ${BULLET_INCLUDE_DIR}) 25 | TARGET_COMPILE_DEFINITIONS(RcsPhysics PRIVATE ${BULLET_DEFINITIONS}) 26 | ENDIF(USE_BULLET) 27 | 28 | # Install the binaries 29 | INSTALL(TARGETS ExampleHighGui ExamplePrioritizedIK ExampleForwardKinematics ExampleKinetics RUNTIME DESTINATION bin LIBRARY DESTINATION lib) 30 | 31 | ENDIF(NOT HEADLESS_BUILD) 32 | -------------------------------------------------------------------------------- /external/QuatTypes.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | This code comes from 4 | Graphics Gems IV, Paul Heckbert (editor), Academic Press, 1994, 5 | ISBN: 0123361559 (Mac: 0123361567). 6 | 7 | License (see e.g. http://www.realtimerendering.com/resources/GraphicsGems): 8 | 9 | EULA: The Graphics Gems code is copyright-protected. In other words, you 10 | cannot claim the text of the code as your own and resell it. Using the 11 | code is permitted in any program, product, or library, non-commercial 12 | or commercial. Giving credit is not required, though is a nice gesture. 13 | The code comes as-is, and if there are any flaws or problems with any 14 | Gems code, nobody involved with Gems - authors, editors, publishers, 15 | or webmasters - are to be held responsible. Basically, don't be a jerk, 16 | and remember that anything free comes with no guarantee. 17 | 18 | ******************************************************************************/ 19 | 20 | #ifndef _H_QuatTypes 21 | #define _H_QuatTypes 22 | /*** Definitions ***/ 23 | typedef struct 24 | { 25 | double x, y, z, w; 26 | } ShoemakeQuat; /* Quaternion */ 27 | enum QuatPart {X, Y, Z, W}; 28 | typedef double HMatrix[4][4]; /* Right-handed, for column vectors */ 29 | typedef ShoemakeQuat EulerAngles; /* (x,y,z)=ang 1,2,3, w=order code */ 30 | #endif 31 | -------------------------------------------------------------------------------- /pkgInfo.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (c) 2020, Honda Research Institute Europe GmbH. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # 9 | # 1. Redistributions of source code must retain the above copyright notice, 10 | # this list of conditions and the following disclaimer. 11 | # 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 16 | # 3. Neither the name of the copyright holder nor the names of its 17 | # contributors may be used to endorse or promote products derived from 18 | # this software without specific prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY EXPRESS OR 21 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23 | # IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, 24 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 26 | # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | name = "Rcs" 32 | 33 | version = "1.0" 34 | 35 | category = "Libraries" 36 | 37 | sqLevel = "basic" 38 | 39 | SQ_12 = [ 'build/${MAKEFILE_PLATFORM}/bin/TestMath -m -1 -numTests 10 -dl 1', 40 | 'build/${MAKEFILE_PLATFORM}/bin/Rcs -m 3 -iter 10 -dl 1 -valgrind', 41 | 'build/${MAKEFILE_PLATFORM}/bin/Rcs -m 6 -valgrind -nTests 10 -dl 1'] 42 | 43 | copyright = { '.': 'Copyright (c) 2017, Honda Research Institute Europe GmbH', 44 | './src/RcsCore/SegFaultHandler.h': 'This code is in the public domain.' } 45 | 46 | gitOriginForCIA = 'git@dmz-gitlab.honda-ri.de:GeneralRobotics/Rcs.git' 47 | 48 | gitBranchForCIA = 'develop' 49 | 50 | 51 | # EOF 52 | -------------------------------------------------------------------------------- /postInstallHook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # additional steps for the installation procedure 4 | # 5 | # Copyright (C) 6 | # Honda Research Institute Europe GmbH 7 | # Carl-Legien-Str. 30 8 | # 63073 Offenbach/Main 9 | # Germany 10 | # 11 | # UNPUBLISHED PROPRIETARY MATERIAL. 12 | # ALL RIGHTS RESERVED. 13 | # 14 | # 15 | 16 | 17 | cd build/${MAKEFILE_PLATFORM} 18 | make doc 19 | make install 20 | #mv ${SIT}/Libraries/Rcs/Rcs/doc/html ${SIT}/Libraries/Rcs/doc/ 21 | #rm -fr ${SIT}/Libraries/Rcs/Rcs 22 | 23 | 24 | # EOF 25 | -------------------------------------------------------------------------------- /remove_coding_style_backups.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | RCS_DIR=$(cd `dirname $0` && pwd) 3 | echo "Deleting astyle backup files from: $RCS_DIR" 4 | find $RCS_DIR -name "*.before_astyle" -delete 5 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ADD_SUBDIRECTORY (RcsCore) 2 | 3 | IF(NOT HEADLESS_BUILD) 4 | ADD_SUBDIRECTORY (RcsGraphics) 5 | ADD_SUBDIRECTORY (RcsGui) 6 | ENDIF() 7 | 8 | ADD_SUBDIRECTORY (RcsPhysics) 9 | -------------------------------------------------------------------------------- /src/RcsCore/IkSolverConstraintRMR.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef RCS_IKSOLVERCONSTRAINTRMR_H 35 | #define RCS_IKSOLVERCONSTRAINTRMR_H 36 | 37 | 38 | 39 | #include "IkSolverRMR.h" 40 | 41 | 42 | 43 | namespace Rcs 44 | { 45 | 46 | /*! \ingroup RcsController 47 | * \brief Constraint Inverse Kinematics solver (Resolved motion rate control) 48 | * using a very simple active set strategy 49 | */ 50 | class IkSolverConstraintRMR : public IkSolverRMR 51 | { 52 | public: 53 | IkSolverConstraintRMR(ControllerBase* controller); 54 | 55 | virtual ~IkSolverConstraintRMR(); 56 | 57 | void solveRightInverse(MatNd* dq_des, const MatNd* dx, const MatNd* dH, 58 | const MatNd* activation, double lambda); 59 | 60 | 61 | protected: 62 | 63 | std::vector activeSet; 64 | std::vector augmentedTasks; 65 | }; 66 | 67 | 68 | } // namespace Rcs 69 | 70 | 71 | #endif // RCS_IKSOLVERCONSTRAINTRMR_H 72 | -------------------------------------------------------------------------------- /src/RcsCore/KeyCatcherBase.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef KEYCATCHERBASE_H 35 | #define KEYCATCHERBASE_H 36 | 37 | #include 38 | #include 39 | #include 40 | 41 | /*! 42 | * \brief Global Rcs namespace encapsulating all Rcs classes 43 | */ 44 | namespace Rcs 45 | { 46 | 47 | class KeyCatcherBase 48 | { 49 | public: 50 | virtual ~KeyCatcherBase(); 51 | virtual bool getAndResetKey(char c) = 0; 52 | virtual bool getAndResetKey(int i) = 0; 53 | 54 | static bool registerKey(const std::string& key, const std::string& description, const std::string& group = "Main"); 55 | static bool deregisterKey(const std::string& key, const std::string& group = "Main"); 56 | static void printRegisteredKeys(); 57 | 58 | private: 59 | static std::map< std::string, std::map > _registered_keys; 60 | }; 61 | 62 | } 63 | 64 | #endif // KEYCATCHERBASE_H 65 | -------------------------------------------------------------------------------- /src/RcsCore/Rcs_bool.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef RCS_BOOL_H 35 | #define RCS_BOOL_H 36 | 37 | #ifndef __cplusplus 38 | 39 | #if defined(_MSC_VER) 40 | typedef int _Bool; 41 | #endif 42 | 43 | #define bool _Bool 44 | #define true 1 45 | #define false 0 46 | #define __bool_true_false_are_defined 1 47 | 48 | #endif // __cplusplus 49 | 50 | #endif // RCS_BOOL_H 51 | -------------------------------------------------------------------------------- /src/RcsCore/Rcs_graphOpenRAVEParser.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef RCS_GRAPHOPENRAVEPARSER_H 35 | #define RCS_GRAPHOPENRAVEPARSER_H 36 | 37 | #include 38 | #include "Rcs_graph.h" 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | void RcsGraph_createBodiesFromOpenRAVEFile(RcsGraph* self, RcsBody* parent, 45 | const char* configFile, double* q0, 46 | unsigned int nq); 47 | 48 | void RcsGraph_createBodiesFromOpenRAVENode(RcsGraph* self, RcsBody* parent, 49 | const xmlNodePtr node, double* q0, 50 | unsigned int nq); 51 | 52 | RcsBody* RcsBody_createFromOpenRAVEXML(RcsGraph* self, xmlNode* bdyNode, 53 | RcsBody* root); 54 | 55 | RcsJoint* RcsJoint_createFromOpenRAVEXML(RcsGraph* self, xmlNode* node, 56 | const double* q0); 57 | 58 | RcsShape* RcsShape_createFromOpenRAVEXML(xmlNode* node, RcsBody* body); 59 | 60 | xmlNodePtr getXMLNodeForOpenRave(const char* filename, xmlDocPtr* doc); 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif // RCS_GRAPHOPENRAVEPARSER_H 67 | -------------------------------------------------------------------------------- /src/RcsCore/Rcs_intersectionWM5.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef RCS_INTERSECTIONWM5_H 35 | #define RCS_INTERSECTIONWM5_H 36 | 37 | #include "Rcs_HTr.h" 38 | #include "Rcs_body.h" 39 | 40 | #include 41 | 42 | 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | /*! \ingroup DistanceFunctions 49 | * \brief Computes a minimum oriented bounding box that encloses the 50 | * given points. 51 | */ 52 | bool Rcs_computeOrientedBox(HTr* A_box, double extents[3], 53 | const double* points, 54 | unsigned int nPoints); 55 | 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | 62 | 63 | #endif // RCS_INTERSECTIONWM5_H 64 | -------------------------------------------------------------------------------- /src/RcsCore/Rcs_macros.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #include "Rcs_macros.h" 35 | 36 | 37 | RCSCORE_API int RcsLogLevel = 0; 38 | 39 | // This function is declared static inline in order to avoid the "defined but 40 | // not used" compiler warnings 41 | #if defined(_MSC_VER) 42 | static void* Rcs_debugCalloc(size_t nmemb, size_t size) 43 | { 44 | RLOGS(1, "Allocating %Iu variables of size %Iu", nmemb, size); 45 | return calloc(nmemb, size); 46 | } 47 | #else 48 | static inline void* Rcs_debugCalloc(size_t nmemb, size_t size) 49 | { 50 | RLOGS(1, "Allocating %zu variables of size %zu", nmemb, size); 51 | return calloc(nmemb, size); 52 | } 53 | #endif 54 | 55 | // by default we don't have a registered callback 56 | RLOG_CB_FUNC RCS_GLOBAL_RLOG_CB = NULL; 57 | 58 | // by default use the system's calloc function for dynamic memory allocation 59 | RCSCORE_API RCS_MALLOC_FUNC Rcs_calloc = calloc; 60 | 61 | -------------------------------------------------------------------------------- /src/RcsCore/Rcs_msvc.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #include "Rcs_msvc.h" 35 | 36 | 37 | 38 | double drand48() 39 | { 40 | return (double) rand() / RAND_MAX; 41 | } 42 | 43 | void srand48(unsigned int seed) 44 | { 45 | srand(seed); 46 | } 47 | 48 | #if (_MSC_VER < 1900) 49 | int round(double x) 50 | { 51 | int i = (int) x; 52 | 53 | if (x >= 0.0) 54 | { 55 | return ((x-i) >= 0.5) ? (i + 1) : (i); 56 | } 57 | else 58 | { 59 | return (-x+i >= 0.5) ? (i - 1) : (i); 60 | } 61 | } 62 | 63 | 64 | double fmin(double x, double y) 65 | { 66 | return (xy?x:y); 72 | } 73 | 74 | double cbrt(double x) 75 | { 76 | if (fabs(x) < DBL_EPSILON) 77 | { 78 | return 0.0; 79 | } 80 | 81 | if (x > 0.0) 82 | { 83 | return pow(x, 1.0/3.0); 84 | } 85 | 86 | return -pow(-x, 1.0/3.0); 87 | } 88 | #endif 89 | -------------------------------------------------------------------------------- /src/RcsCore/SensorComponent.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #include "SensorComponent.h" 35 | 36 | 37 | 38 | Rcs::SensorComponent::SensorComponent(): HardwareComponent() 39 | { 40 | } 41 | 42 | Rcs::SensorComponent::~SensorComponent() 43 | { 44 | } 45 | 46 | void Rcs::SensorComponent::setCommand(const MatNd* q_des, 47 | const MatNd* q_dot_des, 48 | const MatNd* T_des) 49 | { 50 | } 51 | 52 | bool Rcs::SensorComponent::checkEmergencyCondition() 53 | { 54 | return false; 55 | } 56 | 57 | void Rcs::SensorComponent::onEmergencyStop(const HardwareComponent* fault) 58 | { 59 | } 60 | 61 | bool Rcs::SensorComponent::onEmergencyRecovery() 62 | { 63 | return true; 64 | } 65 | -------------------------------------------------------------------------------- /src/RcsCore/SensorComponent.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef RCS_SENSORCOMPONENT_H 35 | #define RCS_SENSORCOMPONENT_H 36 | 37 | 38 | #include "HardwareComponent.h" 39 | 40 | 41 | namespace Rcs 42 | { 43 | class SensorComponent : public HardwareComponent 44 | { 45 | public: 46 | SensorComponent(); 47 | 48 | virtual ~SensorComponent(); 49 | virtual void setCommand(const MatNd* q_des, const MatNd* q_dot_des, 50 | const MatNd* T_des); 51 | virtual bool checkEmergencyCondition(); 52 | virtual void onEmergencyStop(const HardwareComponent* fault); 53 | virtual bool onEmergencyRecovery(); 54 | }; 55 | 56 | } 57 | 58 | #endif // RCS_SENSORCOMPONENT_H 59 | -------------------------------------------------------------------------------- /src/RcsGraphics/BoxNode.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef RCS_BOXNODE_H 35 | #define RCS_BOXNODE_H 36 | 37 | #include "NodeBase.h" 38 | 39 | namespace Rcs 40 | { 41 | 42 | /*! \ingroup RcsGraphics 43 | * \brief Class to display a 3d box. 44 | */ 45 | class BoxNode: public NodeBase 46 | { 47 | 48 | public: 49 | 50 | BoxNode(); 51 | BoxNode(const double center[3], double A_BI[3][3], double lx, double ly, 52 | double lz, bool resizeable = false); 53 | BoxNode(const double center[3], double lx, double ly, 54 | double lz, bool resizeable = false); 55 | BoxNode(const double center[3], double A_BI[3][3], const double extents[3], 56 | bool resizeable=false); 57 | void resize(double lx, double ly, double lz); 58 | void resize(const double extents[3]); 59 | 60 | protected: 61 | 62 | void init(const double center[3], double A_BI[3][3], double lx, double ly, 63 | double lz, bool resizeable); 64 | 65 | osg::ref_ptr box; 66 | }; 67 | 68 | } // namespace Rcs 69 | 70 | #endif // RCS_BOXNODE_H 71 | 72 | -------------------------------------------------------------------------------- /src/RcsGraphics/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # CMakeLists file for the RcsGraphics library 4 | # 5 | ############################################################################### 6 | SET(OpenSceneGraph_MARK_AS_ADVANCED TRUE) 7 | FIND_PACKAGE(OpenSceneGraph REQUIRED 8 | osgUtil 9 | osgDB 10 | osgGA 11 | osg 12 | OpenThreads 13 | osgShadow 14 | osgText 15 | osgViewer 16 | osgFX 17 | osgManipulator) 18 | 19 | SET(RCS_GRAPHICS_SRCS 20 | ArrowNode.cpp 21 | BodyNode.cpp 22 | ShapeNode.cpp 23 | BodyPointDragger.cpp 24 | BoxNode.cpp 25 | CapsuleNode.cpp 26 | COSNode.cpp 27 | CylinderNode.cpp 28 | DepthRenderer.cpp 29 | FTSensorNode.cpp 30 | GraphNode.cpp 31 | HUD.cpp 32 | KeyCatcher.cpp 33 | MeshNode.cpp 34 | MouseDragger.cpp 35 | NodeBase.cpp 36 | PPSSensorNode.cpp 37 | Rcs_graphicsUtils.cpp 38 | RcsViewer.cpp 39 | RigidBodyTracker.cpp 40 | SphereNode.cpp 41 | SSRNode.cpp 42 | TargetSetter.cpp 43 | TextNode3D.cpp 44 | TorusNode.cpp 45 | TransformTrace.cpp 46 | VectorFieldNode.cpp 47 | VertexArrayNode.cpp 48 | ) 49 | 50 | ADD_LIBRARY(RcsGraphics ${LIBRARY_LINKING_TYPE} ${RCS_GRAPHICS_SRCS}) 51 | 52 | TARGET_INCLUDE_DIRECTORIES(RcsGraphics PUBLIC 53 | # Header source location 54 | $ 55 | 56 | # Header install location 57 | $ 58 | 59 | # Regular dependencies 60 | ${OPENSCENEGRAPH_INCLUDE_DIRS} 61 | ) 62 | 63 | IF(USE_OCTOMAP) 64 | TARGET_INCLUDE_DIRECTORIES(RcsGraphics SYSTEM PRIVATE ${OCTOMAP_INCLUDE_DIR}) 65 | TARGET_COMPILE_DEFINITIONS(RcsGraphics PRIVATE ${OCTOMAP_DEFINITIONS}) 66 | ENDIF(USE_OCTOMAP) 67 | 68 | TARGET_LINK_LIBRARIES(RcsGraphics RcsCore ${OPENSCENEGRAPH_LIBRARIES}) 69 | 70 | # copy all .dll files to the same folder as the executable 71 | IF (WIN32) 72 | FILE(GLOB OSG_DLLS "${OPENSCENEGRAPH_INCLUDE_DIRS}/../bin/*.dll") 73 | FILE(GLOB OSGPLUGIN_DLLS "${OPENSCENEGRAPH_INCLUDE_DIRS}/../bin/osgPlugin*/*.dll") 74 | LIST(APPEND OSG_DLLS ${OSGPLUGIN_DLLS}) 75 | LIST(APPEND OSG_DLLS "${LIBRARY_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/RcsGraphics.dll") 76 | ADD_CUSTOM_COMMAND(TARGET RcsGraphics POST_BUILD 77 | COMMAND ${CMAKE_COMMAND} -E copy_if_different 78 | ${OSG_DLLS} ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}) 79 | ENDIF(WIN32) 80 | 81 | # Mark for export 82 | RCS_ADD_EXPORT_LIBRARY(RcsGraphics) 83 | 84 | # Installation 85 | # Headers 86 | INSTALL( 87 | DIRECTORY . 88 | DESTINATION include/RcsGraphics 89 | FILES_MATCHING PATTERN "*.h" 90 | ) 91 | # Install the binaries 92 | INSTALL(TARGETS RcsGraphics EXPORT RcsExport DESTINATION lib) 93 | -------------------------------------------------------------------------------- /src/RcsGraphics/CapsuleNode.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef RCS_CAPSULENODE_H 35 | #define RCS_CAPSULENODE_H 36 | 37 | #include "NodeBase.h" 38 | 39 | #include 40 | 41 | namespace Rcs 42 | { 43 | /*! 44 | * \ingroup RcsGraphics 45 | */ 46 | class CapsuleNode: public NodeBase 47 | { 48 | 49 | public: 50 | 51 | CapsuleNode(); 52 | 53 | CapsuleNode(const double ballPoint[3], 54 | double A_KI[3][3], 55 | const double radius, 56 | const double length, 57 | bool resizeable=false); 58 | 59 | /*! \brief Only works if the class has been instantiated with the resizeable 60 | * flag. 61 | */ 62 | void setHeight(double height); 63 | 64 | /*! \brief Only works if the class has been instantiated with the resizeable 65 | * flag. 66 | */ 67 | void setRadius(double radius); 68 | 69 | void setCenter(double x, double y, double z); 70 | 71 | 72 | protected: 73 | 74 | osg::ref_ptr capsule; 75 | }; 76 | 77 | } // namespace Rcs 78 | 79 | #endif // RCS_CAPSULENODE_H 80 | 81 | -------------------------------------------------------------------------------- /src/RcsGraphics/CylinderNode.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef RCS_CYLINDERNODE_H 35 | #define RCS_CYLINDERNODE_H 36 | 37 | #include "NodeBase.h" 38 | 39 | #include 40 | 41 | namespace Rcs 42 | { 43 | /*! 44 | * \ingroup RcsGraphics 45 | */ 46 | class CylinderNode: public NodeBase 47 | { 48 | 49 | public: 50 | 51 | CylinderNode(); 52 | 53 | CylinderNode(const double center[3], 54 | double A_BI[3][3], 55 | const double radius, 56 | const double length, 57 | bool resizeable=false); 58 | 59 | /*! \brief Only works if the class has been instantiated with the resizeable 60 | * flag. 61 | */ 62 | void setHeight(double height); 63 | 64 | /*! \brief Only works if the class has been instantiated with the resizeable 65 | * flag. 66 | */ 67 | void setRadius(double radius); 68 | 69 | void setCenter(double x, double y, double z); 70 | 71 | 72 | protected: 73 | 74 | osg::ref_ptr cylinder; 75 | }; 76 | 77 | } // namespace Rcs 78 | 79 | #endif // RCS_CYLINDERNODE_H 80 | 81 | -------------------------------------------------------------------------------- /src/RcsGraphics/FTSensorNode.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef RCS_FTSENSORNODE_H 35 | #define RCS_FTSENSORNODE_H 36 | 37 | #include "ArrowNode.h" 38 | 39 | #include 40 | 41 | 42 | 43 | namespace Rcs 44 | { 45 | 46 | /** 47 | * \ingroup RcsGraphics 48 | */ 49 | class FTSensorNode: public ArrowNode 50 | { 51 | 52 | public: 53 | 54 | FTSensorNode(const RcsSensor* fts); 55 | virtual ~FTSensorNode(); 56 | virtual bool frameCallback(); 57 | virtual void setTransformPtr(const HTr* A_BI); 58 | virtual const RcsBody* getMountBody() const; 59 | 60 | protected: 61 | 62 | const RcsSensor* loadCell; 63 | const HTr* A_BI; 64 | }; 65 | 66 | } // namespace Rcs 67 | 68 | #endif // RCS_FTSENSORNODE_H 69 | 70 | -------------------------------------------------------------------------------- /src/RcsGraphics/KeyCatcher.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef RCS_KEYCATCHER_H 35 | #define RCS_KEYCATCHER_H 36 | 37 | #include 38 | #include 39 | 40 | #include 41 | 42 | 43 | 44 | namespace Rcs 45 | { 46 | /*! 47 | * \ingroup RcsGraphics 48 | */ 49 | class KeyCatcher : public osgGA::GUIEventHandler, public KeyCatcherBase 50 | { 51 | public: 52 | 53 | KeyCatcher(); 54 | virtual ~KeyCatcher(); 55 | virtual bool getAndResetKey(char c); 56 | virtual bool getAndResetKey(int i); 57 | bool getKey(const char key); 58 | void setKey(const char key); 59 | void resetKey(const char key); 60 | virtual bool handle(const osgGA::GUIEventAdapter& ea, 61 | osgGA::GUIActionAdapter& aa); 62 | 63 | private: 64 | 65 | bool _charPressed[256]; 66 | pthread_mutex_t _lock; 67 | }; 68 | 69 | 70 | 71 | } // namespace Rcs 72 | 73 | 74 | 75 | #endif // RCS_KEYCATCHER_H 76 | -------------------------------------------------------------------------------- /src/RcsGraphics/MeshNode.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef MESHNODE_H 35 | #define MESHNODE_H 36 | 37 | #include "NodeBase.h" 38 | 39 | #include 40 | #include 41 | 42 | namespace Rcs 43 | { 44 | 45 | /*! 46 | * \ingroup RcsGraphics 47 | * \brief OpenSceneGraph node to display triangle meshes. The data is 48 | * assumed as vertex and face lists in arrays vertex and faces. 49 | * Value numVertices is the number of the (xyz) vertex vectors, 50 | * value numFaces is the number of triangles. The array vertices 51 | * must point to memory with equal to or more than 3*numVertices 52 | * double values. The array faces must point to memory with equal 53 | * to or more than 3*numVertices integer values. The function 54 | * setMesh replaces the current mesh with the new one. 55 | */ 56 | class MeshNode : public NodeBase 57 | { 58 | public: 59 | 60 | MeshNode(); 61 | MeshNode(const char* meshFile); 62 | MeshNode(const double* vertices, unsigned int numVertices, 63 | const unsigned int* faces, unsigned int numFaces); 64 | void setMesh(const double* vertices, unsigned int numVertices, 65 | const unsigned int* faces, unsigned int numFaces); 66 | void clear(); 67 | 68 | protected: 69 | 70 | osg::ref_ptr geode; 71 | void init(); 72 | }; 73 | 74 | } // namespace Rcs 75 | 76 | #endif // MESHNODE_H 77 | -------------------------------------------------------------------------------- /src/RcsGraphics/PPSSensorNode.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef RCS_PPSSENSORNODE_H 35 | #define RCS_PPSSENSORNODE_H 36 | 37 | #include "NodeBase.h" 38 | 39 | #include 40 | 41 | 42 | namespace Rcs 43 | { 44 | 45 | /** 46 | * \ingroup RcsGraphics 47 | */ 48 | class PPSSensorNode: public NodeBase 49 | { 50 | 51 | public: 52 | 53 | PPSSensorNode(const RcsSensor* pps, bool debug=false); 54 | virtual ~PPSSensorNode(); 55 | protected: 56 | 57 | const RcsSensor* pps; 58 | }; 59 | 60 | } // namespace Rcs 61 | 62 | #endif // RCS_PPSSENSORNODE_H 63 | -------------------------------------------------------------------------------- /src/RcsGraphics/RigidBodyTracker.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef RCS_RIGIDBODYTRACKER_H 35 | #define RCS_RIGIDBODYTRACKER_H 36 | 37 | #include 38 | 39 | namespace Rcs 40 | { 41 | 42 | class OriDragger; 43 | 44 | /*! 45 | * \ingroup RcsGraphics 46 | */ 47 | class RigidBodyTracker : public osgManipulator::CompositeDragger 48 | { 49 | public: 50 | 51 | RigidBodyTracker(bool withSphericalTracker = true); 52 | 53 | protected: 54 | 55 | virtual ~RigidBodyTracker(); 56 | }; 57 | 58 | } 59 | 60 | #endif // RCS_RIGIDBODYTRACKER_H 61 | -------------------------------------------------------------------------------- /src/RcsGraphics/SSRNode.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef RCS_SSRNODE_H 35 | #define RCS_SSRNODE_H 36 | 37 | #include "NodeBase.h" 38 | 39 | namespace Rcs 40 | { 41 | 42 | /** 43 | * \ingroup RcsGraphics 44 | */ 45 | class SSRNode: public NodeBase 46 | { 47 | 48 | public: 49 | 50 | SSRNode(const double center[3], 51 | double A_KI[3][3], 52 | const double extent[2], 53 | const double radius, 54 | bool resizeable=false); 55 | 56 | private: 57 | 58 | void init(const double center[3], double A_KI[3][3], 59 | const double extent[2], const double r, 60 | bool resizeable); 61 | 62 | void initMesh(const double center[3], double A_KI[3][3], 63 | const double extent[2], const double r, 64 | bool resizeable); 65 | }; 66 | 67 | } // namespace Rcs 68 | 69 | #endif // RCS_SSRNODE_H 70 | 71 | -------------------------------------------------------------------------------- /src/RcsGraphics/SphereNode.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef RCS_SPHERENODE_H 35 | #define RCS_SPHERENODE_H 36 | 37 | #include "NodeBase.h" 38 | 39 | #include 40 | 41 | namespace Rcs 42 | { 43 | /*! 44 | * \ingroup RcsGraphics 45 | */ 46 | class SphereNode: public NodeBase 47 | { 48 | 49 | public: 50 | 51 | SphereNode(); 52 | 53 | SphereNode(const double pos[3], 54 | const double radius, 55 | bool resizeable=false); 56 | 57 | /*! \brief Only works if the class has been instantiated with the resizeable 58 | * flag. 59 | */ 60 | void setRadius(double radius); 61 | 62 | 63 | protected: 64 | 65 | osg::ref_ptr sphere; 66 | }; 67 | 68 | } // namespace Rcs 69 | 70 | #endif // RCS_SPHERENODE_H 71 | -------------------------------------------------------------------------------- /src/RcsGraphics/TextNode3D.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #include "TextNode3D.h" 35 | 36 | #include 37 | #include 38 | 39 | #include 40 | #include 41 | 42 | 43 | 44 | Rcs::TextNode3D::TextNode3D(std::string text) : NodeBase() 45 | { 46 | init(text); 47 | } 48 | 49 | Rcs::TextNode3D::TextNode3D(std::string text, const double pos[3]) : NodeBase() 50 | { 51 | init(text); 52 | setPosition(pos); 53 | } 54 | 55 | void Rcs::TextNode3D::init(std::string text) 56 | { 57 | setName("TextNode3D"); 58 | osg::ref_ptr textGeode = new osg::Geode(); 59 | addChild(textGeode.get()); 60 | 61 | this->text3D = new osgText::Text; 62 | text3D->setCharacterSize(0.05); 63 | text3D->setText(text); 64 | text3D->setAlignment(osgText::Text::LEFT_CENTER); 65 | text3D->setAxisAlignment(osgText::Text::SCREEN); 66 | char fontFile[256] = ""; 67 | bool fontFound = Rcs_getAbsoluteFileName("fonts/VeraMono.ttf", fontFile); 68 | if (fontFound) 69 | { 70 | text3D->setFont(fontFile); 71 | } 72 | 73 | textGeode->addDrawable(text3D.get()); 74 | } 75 | 76 | void Rcs::TextNode3D::setMaterial(const std::string& material, double alpha) 77 | { 78 | text3D->setColor(colorFromString(material.c_str())); 79 | } 80 | 81 | osg::ref_ptr Rcs::TextNode3D::getText() 82 | { 83 | return this->text3D; 84 | } 85 | -------------------------------------------------------------------------------- /src/RcsGraphics/TextNode3D.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef RCS_TEXTNODE3D_H 35 | #define RCS_TEXTNODE3D_H 36 | 37 | #include "NodeBase.h" 38 | 39 | #include 40 | 41 | #include 42 | 43 | 44 | 45 | namespace Rcs 46 | { 47 | /*! 48 | * \ingroup RcsGraphics 49 | */ 50 | class TextNode3D: public NodeBase 51 | { 52 | 53 | public: 54 | 55 | TextNode3D(std::string text); 56 | TextNode3D(std::string text, const double pos[3]); 57 | void setMaterial(const std::string& material, double alpha=1.0); 58 | osg::ref_ptr getText(); 59 | 60 | protected: 61 | 62 | void init(std::string text); 63 | 64 | osg::ref_ptr text3D; 65 | }; 66 | 67 | } // namespace Rcs 68 | 69 | #endif // RCS_TEXTNODE3D_H 70 | -------------------------------------------------------------------------------- /src/RcsGraphics/TorusNode.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef RCS_TORUSNODE_H 35 | #define RCS_TORUSNODE_H 36 | 37 | #include "NodeBase.h" 38 | 39 | namespace Rcs 40 | { 41 | /*! 42 | * \ingroup RcsGraphics 43 | * \brief An OSG node that draws a torus 44 | */ 45 | class TorusNode : public NodeBase 46 | { 47 | public: 48 | TorusNode(double radius, double thickness, double startAng=0.0, 49 | double endAng=2.0*M_PI); 50 | 51 | virtual ~TorusNode(); 52 | 53 | /*! 54 | * \brief Creates a osg::Geode that holds the vertices and normals of the 55 | * torus 56 | */ 57 | static osg::ref_ptr createGeometry(double radius, 58 | double thickness, 59 | double startAng=0.0, 60 | double endAng=2.0*M_PI); 61 | 62 | static void resize(double radius, double thickness, osg::Geometry* geometry); 63 | 64 | private: 65 | static void createHelperArrays(double radius, double thickness, 66 | double startAngle, double endAngle, 67 | unsigned int nSides, unsigned int nRings, 68 | osg::Vec3Array* vertices, 69 | osg::Vec3Array* normals); 70 | }; 71 | 72 | } // namespace Rcs 73 | 74 | #endif // RCS_TORUSNODE_H 75 | -------------------------------------------------------------------------------- /src/RcsGraphics/TransformTrace.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef TRANSFORMTRACE_H 35 | #define TRANSFORMTRACE_H 36 | 37 | #include 38 | 39 | 40 | 41 | namespace Rcs 42 | { 43 | 44 | /*! 45 | * \ingroup RcsGraphics 46 | */ 47 | class TransformTrace: public osg::Switch 48 | { 49 | 50 | public: 51 | 52 | TransformTrace(const double* pos, unsigned int nPts=100); 53 | void show(); 54 | void hide(); 55 | void toggle(); 56 | }; 57 | 58 | } // namespace Rcs 59 | 60 | #endif // TRANSFORMTRACE_H 61 | -------------------------------------------------------------------------------- /src/RcsGraphics/VectorFieldNode.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef VECTORFIELDNODE_H 35 | #define VECTORFIELDNODE_H 36 | 37 | #include 38 | #include 39 | 40 | #include 41 | #include 42 | 43 | namespace Rcs 44 | { 45 | 46 | /** 47 | * \ingroup RcsGraphics 48 | */ 49 | class VectorFieldNode : public osg::PositionAttitudeTransform 50 | { 51 | public: 52 | VectorFieldNode(const MatNd* xdx, const HTr* refFrame, double scale = 1.0, bool withPoints = true, const char* color = "BLACK_RUBBER"); 53 | VectorFieldNode(const MatNd* x, const MatNd* dx, const HTr* refFrame, double scale = 1.0, bool withPoints = true, const char* color = "BLACK_RUBBER"); 54 | 55 | ~VectorFieldNode(); 56 | 57 | void setTransformation(const HTr* A_KI); 58 | const HTr* getTransform() const; 59 | 60 | protected: 61 | void init(const char* color); 62 | 63 | osg::ref_ptr lines; 64 | osg::ref_ptr points; 65 | // osg::Vec3Array* _color; 66 | 67 | osg::ref_ptr pointsGeom; 68 | osg::ref_ptr linesGeom; 69 | 70 | const HTr* refFrame; 71 | }; 72 | 73 | } // namespace Rcs 74 | 75 | #endif // VECTORFIELDNODE_H 76 | -------------------------------------------------------------------------------- /src/RcsGui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | SET(RCS_HIGHGUI_SRCS 3 | HighGuiWindow.cpp 4 | HighGuiPlot.cpp 5 | HighGuiLabel.cpp 6 | HighGuiImage.cpp 7 | HighGuiButton.cpp 8 | HighGuiWidget.cpp 9 | HighGui.cpp 10 | HighGuiSlider.cpp 11 | ) 12 | 13 | SET(RCS_GUI_SRCS 14 | ControllerWidgetBase.cpp 15 | ForceControlGui.cpp 16 | GuiFactory.cpp 17 | JointSlider.cpp 18 | JointWidget.cpp 19 | LcdSlider.cpp 20 | MatNdWidget.cpp 21 | PPSGui.cpp 22 | PPSWidget.cpp 23 | Rcs_guiFactory.c 24 | SimpleSlider.cpp 25 | Slider1Dof.cpp 26 | SliderCheck1Dof.cpp 27 | TaskWidget.cpp 28 | DblSlider.cpp 29 | DynamicDataPlot.cpp 30 | ${RCS_HIGHGUI_SRCS} 31 | ) 32 | 33 | IF(WIN32) 34 | SET_SOURCE_FILES_PROPERTIES( ${RCS_GUI_SRCS} PROPERTIES LANGUAGE CXX ) 35 | 36 | IF(CREATE_WIN_DLL) 37 | ADD_DEFINITIONS(-DRCSGUI_EXPORTS) 38 | ENDIF(CREATE_WIN_DLL) 39 | 40 | ENDIF() 41 | 42 | FIND_PACKAGE(Qt5 COMPONENTS Core Gui Widgets REQUIRED) 43 | 44 | ADD_LIBRARY(RcsGui ${LIBRARY_LINKING_TYPE} ${RCS_GUI_SRCS} ) 45 | TARGET_LINK_LIBRARIES(RcsGui RcsCore Qt5::Core Qt5::Gui Qt5::Widgets ${QWT_LIBRARIES}) 46 | SET_TARGET_PROPERTIES(RcsGui PROPERTIES AUTOMOC TRUE) 47 | 48 | TARGET_INCLUDE_DIRECTORIES(RcsGui PUBLIC 49 | # Header source location 50 | $ 51 | 52 | # Header install location 53 | $ 54 | 55 | # Regular dependencies 56 | ${Qt5Core_INCLUDE_DIRS} 57 | ${Qt5Gui_INCLUDE_DIRS} 58 | ${Qt5Widgets_INCLUDE_DIRS}) 59 | TARGET_INCLUDE_DIRECTORIES(RcsGui PRIVATE ${QWT_INCLUDE_DIRS}) 60 | 61 | # copy the .dll file to the same folder as the executable 62 | IF (WIN32) 63 | ADD_CUSTOM_COMMAND( 64 | TARGET RcsGui POST_BUILD 65 | COMMAND ${CMAKE_COMMAND} -E copy 66 | ${LIBRARY_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/RcsGui.dll 67 | ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/RcsGui.dll) 68 | ENDIF() 69 | 70 | # Mark for export 71 | RCS_ADD_EXPORT_LIBRARY(RcsGui) 72 | 73 | # Installation 74 | # Headers 75 | INSTALL( 76 | DIRECTORY . 77 | DESTINATION include/RcsGui 78 | FILES_MATCHING PATTERN "*.h*" 79 | ) 80 | # Install the binaries 81 | INSTALL(TARGETS RcsGui EXPORT RcsExport DESTINATION lib) 82 | -------------------------------------------------------------------------------- /src/RcsGui/DblSlider.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #include "DblSlider.h" 35 | 36 | #include 37 | 38 | DoubleSlider::DoubleSlider(double lowerBound, 39 | double initialValue, 40 | double upperBound, 41 | int digits, 42 | int tic, 43 | QWidget* parent) 44 | : 45 | QSlider(parent), 46 | dblScale(pow(10.0, digits)) 47 | { 48 | connect(this, SIGNAL(valueChanged(int)), this, SLOT(notifyValueChanged(int))); 49 | } 50 | 51 | void DoubleSlider::notifyValueChanged(int value) 52 | { 53 | double doubleValue = value / dblScale; 54 | emit doubleValueChanged(doubleValue); 55 | } 56 | -------------------------------------------------------------------------------- /src/RcsGui/DblSlider.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef RCS_DBLSLIDER_H 35 | #define RCS_DBLSLIDER_H 36 | 37 | #include 38 | 39 | class DoubleSlider : public QSlider 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | DoubleSlider(double lowerBound, double initialValue, double upperBound, 45 | int digits, int tic, QWidget* parent=NULL); 46 | 47 | signals: 48 | void doubleValueChanged(double value); 49 | 50 | public slots: 51 | void notifyValueChanged(int value); 52 | 53 | private: 54 | double dblScale; 55 | }; 56 | 57 | #endif // RCS_DBLSLIDER_H 58 | -------------------------------------------------------------------------------- /src/RcsGui/DynamicDataPlot.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef RCS_DYNAMICDATAPLOT_H 35 | #define RCS_DYNAMICDATAPLOT_H 36 | 37 | #include 38 | 39 | #include 40 | 41 | #include 42 | 43 | class QwtPlot; 44 | class QwtPlotCurve; 45 | 46 | namespace Rcs 47 | { 48 | 49 | class DynamicDataPlot : public QWidget 50 | { 51 | Q_OBJECT 52 | 53 | public: 54 | 55 | static int create(MatNd* mat, const char* title = NULL, 56 | pthread_mutex_t* mutex = NULL); 57 | 58 | static bool destroy(int handle); 59 | 60 | DynamicDataPlot(MatNd* mat, const char* title, pthread_mutex_t* mutex); 61 | 62 | virtual ~DynamicDataPlot(); 63 | 64 | void timerEvent(QTimerEvent*); 65 | 66 | private: 67 | 68 | static void* threadFunc(void* arg); 69 | 70 | QwtPlot* plot; 71 | QwtPlotCurve* curve; 72 | 73 | const MatNd* mat; 74 | }; 75 | 76 | } // namespace Rcs 77 | 78 | #endif // RCS_DYNAMICDATAPLOT_H 79 | -------------------------------------------------------------------------------- /src/RcsGui/GuiFactory.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | /****************************************************************************** 35 | 36 | Description: This class declaration needs to be here, otherwise the moc 37 | compiler doesn't create the signal/slot code. 38 | 39 | ******************************************************************************/ 40 | 41 | #ifndef GUIFACTORY_H 42 | #define GUIFACTORY_H 43 | 44 | #include 45 | 46 | /*! 47 | * \defgroup RcsGui Qt Gui and Widget classes 48 | * 49 | * A library for various Qt Guis and Widgets 50 | */ 51 | 52 | class GuiFactory: public QObject 53 | { 54 | Q_OBJECT 55 | 56 | public: 57 | GuiFactory(); 58 | virtual ~GuiFactory(); 59 | 60 | public slots: 61 | void update(); 62 | 63 | }; 64 | 65 | #endif // GUIFACTORY_H 66 | -------------------------------------------------------------------------------- /src/RcsGui/HighGuiButton.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef HIGHGUIBUTTON_H 35 | #define HIGHGUIBUTTON_H 36 | 37 | #include "HighGuiWidget.h" 38 | 39 | class QPushButton; 40 | 41 | namespace Rcs 42 | { 43 | 44 | class HighGuiButton : public HighGuiWidget 45 | { 46 | Q_OBJECT 47 | 48 | public: 49 | typedef void (*CallbackType)(); 50 | 51 | 52 | public: 53 | HighGuiButton(const std::string& name); 54 | ~HighGuiButton(); 55 | 56 | static HighGuiButton* create(const std::string& name); 57 | 58 | bool pressed(bool reset = true); 59 | 60 | void registerCallback(CallbackType cb_function); 61 | 62 | protected Q_SLOTS: 63 | virtual void update(); 64 | virtual void buttonClicked(); 65 | 66 | protected: 67 | QPushButton* _button; 68 | typedef std::list CallbackList; 69 | CallbackList _cb_functions; 70 | }; 71 | 72 | } 73 | 74 | #endif // HIGHGUIBUTTON_H 75 | -------------------------------------------------------------------------------- /src/RcsGui/HighGuiImage.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifdef USE_OPENCV 35 | 36 | #ifndef HIGHGUIIMAGE_H 37 | #define HIGHGUIIMAGE_H 38 | 39 | #include "HighGuiWidget.h" 40 | 41 | #include 42 | 43 | namespace Rcs 44 | { 45 | 46 | class HighGuiImage : public HighGuiWidget 47 | { 48 | Q_OBJECT 49 | 50 | public: 51 | HighGuiImage(const std::string& name); 52 | ~HighGuiImage(); 53 | 54 | static HighGuiImage* create(const std::string& name); 55 | 56 | void setImage(const cv::Mat& image); 57 | 58 | QSize sizeHint() const; 59 | 60 | QSize minimumSizeHint() const; 61 | 62 | protected Q_SLOTS: 63 | virtual void update(); 64 | 65 | protected: 66 | void paintEvent(QPaintEvent* event); 67 | 68 | protected: 69 | std::string _label_string; 70 | QImage _image; 71 | cv::Mat _tmp_image; 72 | }; 73 | 74 | } 75 | 76 | #endif // HIGHGUIIMAGE_H 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /src/RcsGui/HighGuiLabel.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef HIGHGUILABEL_H 35 | #define HIGHGUILABEL_H 36 | 37 | #include "HighGuiWidget.h" 38 | 39 | class QLabel; 40 | 41 | namespace Rcs 42 | { 43 | 44 | class HighGuiLabel : public HighGuiWidget 45 | { 46 | Q_OBJECT 47 | 48 | public: 49 | HighGuiLabel(const std::string& name); 50 | ~HighGuiLabel(); 51 | 52 | static HighGuiLabel* create(const std::string& name); 53 | 54 | void setLabel(const std::string& label); 55 | 56 | protected Q_SLOTS: 57 | virtual void update(); 58 | 59 | protected: 60 | std::string _label_string; 61 | QLabel* _label; 62 | bool _new_label; 63 | }; 64 | 65 | } 66 | 67 | #endif // HIGHGUILABEL_H 68 | -------------------------------------------------------------------------------- /src/RcsGui/HighGuiSlider.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef HIGHGUISLIDER_H 35 | #define HIGHGUISLIDER_H 36 | 37 | #include "Atomic.hpp" 38 | #include "HighGuiWidget.h" 39 | 40 | #include 41 | 42 | class QSlider; 43 | class QLabel; 44 | 45 | namespace Rcs 46 | { 47 | class HighGuiSlider : public HighGuiWidget 48 | { 49 | Q_OBJECT 50 | 51 | public: 52 | typedef void (*CallbackType)(double); 53 | 54 | public: 55 | HighGuiSlider(const std::string& name, double min, double max, 56 | double step_size, Atomic* feedback); 57 | ~HighGuiSlider(); 58 | 59 | static HighGuiSlider* create(const std::string& name, double min, double max, 60 | double step_size, Atomic* feedback); 61 | 62 | double getValue(); 63 | 64 | void registerCallback(CallbackType cb_function); 65 | 66 | protected Q_SLOTS: 67 | virtual void update(); 68 | virtual void sliderValueChanged(int value); 69 | 70 | protected: 71 | QSlider* _slider; 72 | QLabel* _label; 73 | QLabel* _value_label; 74 | double _min, _max, _step_size; 75 | double _last_value; 76 | Atomic* _feedback_value; 77 | 78 | typedef std::list CallbackList; 79 | CallbackList _cb_functions; 80 | }; 81 | 82 | } 83 | 84 | #endif // HIGHGUISLIDER_H 85 | -------------------------------------------------------------------------------- /src/RcsGui/HighGuiWidget.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #include "HighGuiWidget.h" 35 | #include "Rcs_guiFactory.h" 36 | 37 | #include 38 | 39 | #include 40 | 41 | namespace Rcs 42 | { 43 | 44 | HighGuiWidget::HighGuiWidget(const std::string& name) : 45 | QWidget(), 46 | _name(name) 47 | { 48 | setAttribute(Qt::WA_DeleteOnClose, false); 49 | setAttribute(Qt::WA_QuitOnClose, false); 50 | 51 | pthread_mutex_init(&_mutex, NULL); 52 | 53 | setWindowTitle(QString::fromStdString(_name)); 54 | 55 | // 25 Hz timer callback for updating 56 | QTimer* timer = new QTimer(this); 57 | connect(timer, SIGNAL(timeout()), SLOT(update())); 58 | timer->start(40); 59 | } 60 | 61 | HighGuiWidget::~HighGuiWidget() 62 | { 63 | RLOGS(5, "HighGuiWidget::~HighGuiWidget() for \"%s\"", 64 | windowTitle().toStdString().c_str()); 65 | pthread_mutex_destroy(&_mutex); 66 | } 67 | 68 | std::string HighGuiWidget::getName() const 69 | { 70 | return _name; 71 | } 72 | 73 | 74 | void HighGuiWidget::lock() 75 | { 76 | pthread_mutex_lock(&_mutex); 77 | } 78 | 79 | void HighGuiWidget::unlock() 80 | { 81 | pthread_mutex_unlock(&_mutex); 82 | } 83 | 84 | void HighGuiWidget::update() 85 | { 86 | } 87 | 88 | 89 | } 90 | -------------------------------------------------------------------------------- /src/RcsGui/HighGuiWidget.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef HIGHGUIWIDGET_H 35 | #define HIGHGUIWIDGET_H 36 | 37 | #include 38 | #include 39 | 40 | namespace Rcs 41 | { 42 | class HighGuiWidget : public QWidget 43 | { 44 | Q_OBJECT 45 | 46 | public: 47 | HighGuiWidget(const std::string& name); 48 | virtual ~HighGuiWidget(); 49 | std::string getName() const; 50 | 51 | protected: 52 | virtual void lock(); 53 | virtual void unlock(); 54 | 55 | protected Q_SLOTS: 56 | virtual void update(); 57 | 58 | protected: 59 | std::string _name; 60 | pthread_mutex_t _mutex; 61 | }; 62 | } 63 | 64 | #endif // HIGHGUIWIDGET_H 65 | -------------------------------------------------------------------------------- /src/RcsGui/HighGuiWindow.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef HIGHGUIWINDOW_H 35 | #define HIGHGUIWINDOW_H 36 | 37 | #include "HighGuiWidget.h" 38 | 39 | #include 40 | 41 | #if defined (WITH_X11_SUPPORT) 42 | #include 43 | #endif 44 | 45 | class QVBoxLayout; 46 | class QGridLayout; 47 | 48 | namespace Rcs 49 | { 50 | 51 | class HighGuiWindow : public HighGuiWidget 52 | { 53 | Q_OBJECT 54 | 55 | public: 56 | HighGuiWindow(const std::string& name); 57 | ~HighGuiWindow(); 58 | 59 | 60 | static HighGuiWindow* create(const std::string& name); 61 | 62 | virtual void showSafe(); 63 | 64 | void addWidget(HighGuiWidget* widget); 65 | 66 | void setWindowTitleSafe(const std::string& window_name); 67 | 68 | #if defined (WITH_X11_SUPPORT) 69 | void attachToWindow(Window window); 70 | #endif 71 | 72 | private Q_SLOTS: 73 | virtual void update(); 74 | virtual void updateAttachment(); 75 | 76 | private: 77 | std::list _new_widgets; 78 | std::list _widgets; 79 | QVBoxLayout* _main_layout; 80 | QGridLayout* _button_area; 81 | QVBoxLayout* _misc_area; 82 | std::string _window_name; 83 | bool _new_window_name; 84 | #if defined (WITH_X11_SUPPORT) 85 | Window _window; 86 | Display* _display; 87 | #endif 88 | bool _show; 89 | }; 90 | 91 | } 92 | #endif // HIGHGUIWINDOW_H 93 | -------------------------------------------------------------------------------- /src/RcsGui/JointSlider.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef JOINTSLIDER_H 35 | #define JOINTSLIDER_H 36 | 37 | #include 38 | #include 39 | 40 | 41 | 42 | class SimpleSlider; 43 | 44 | class QwtThermo; 45 | class QwtSlider; 46 | 47 | class JointSlider: public QWidget 48 | { 49 | Q_OBJECT 50 | 51 | public: 52 | JointSlider(double lowerBound, 53 | double zeroPos, 54 | double upperBound, 55 | double scaleFactor = 1.0, 56 | QWidget* parent = 0, 57 | const char* name = 0); 58 | void setValue(double val); 59 | void setSliderValue(double val); 60 | double getSliderValue(void); 61 | QwtSlider* getSlider(); 62 | 63 | private: 64 | double _lb; 65 | double _ub; 66 | double _zp; 67 | double _dzp; 68 | double _scaleFactor; 69 | QwtThermo* t1, *t2; 70 | SimpleSlider* sl; 71 | }; 72 | 73 | 74 | 75 | #endif // JOINTSLIDER_H 76 | -------------------------------------------------------------------------------- /src/RcsGui/PPSGui.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef PPSGUI_H 35 | #define PPSGUI_H 36 | 37 | #include 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | 44 | namespace Rcs 45 | { 46 | 47 | class PPSGui: public QScrollArea 48 | { 49 | Q_OBJECT 50 | 51 | public: 52 | // The user needs to specify offset and scaling such that the range is [0..1]. 53 | // A negative scaling value means auto-scaling. 54 | struct Entry 55 | { 56 | Entry(const std::string& _name, const size_t _width, const size_t _height, const double* _data, double _scaling=1.0, double _offset=0.0, bool _palm=false): 57 | name(_name), width(_width), height(_height), data(_data), scaling(_scaling), offset(_offset), palm(_palm) {} 58 | std::string name; 59 | size_t width; 60 | size_t height; 61 | const double* data; 62 | double scaling; 63 | double offset; 64 | bool palm; 65 | }; 66 | 67 | public: 68 | static PPSGui* create(std::vector ppsEntries, 69 | pthread_mutex_t* mutex=NULL); 70 | PPSGui(std::vector* entries, pthread_mutex_t* mutex); 71 | virtual ~PPSGui(); 72 | 73 | }; 74 | 75 | } 76 | 77 | #endif // PPSGUI_H 78 | -------------------------------------------------------------------------------- /src/RcsGui/PPSWidget.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef PPSWIDGET_H 35 | #define PPSWIDGET_H 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | 46 | 47 | namespace Rcs 48 | { 49 | 50 | class PPSWidget: public QWidget 51 | { 52 | Q_OBJECT 53 | public: 54 | static PPSWidget* create(const size_t width, const size_t height, const double* data, const char* name); 55 | PPSWidget(const std::string& name, const size_t width, const size_t height, const double* data, double scaling=1.0, double offset=0.0, bool palm=false, pthread_mutex_t* mtx=NULL); 56 | virtual ~PPSWidget(); 57 | 58 | protected: 59 | 60 | void lock() const; 61 | void unlock() const; 62 | 63 | std::string name; 64 | size_t width; 65 | size_t height; 66 | const double* data; 67 | double scaling; 68 | double offset; 69 | bool palm; 70 | 71 | QLabel* PPS; 72 | QVBoxLayout* main_layout; 73 | QPixmap* pixmap; 74 | QPainter painter; 75 | 76 | int pixelSize; 77 | mutable pthread_mutex_t* mtx; 78 | 79 | private slots: 80 | void updateDisplay(); 81 | }; 82 | 83 | } 84 | 85 | #endif // PPSWIDGET_H 86 | -------------------------------------------------------------------------------- /src/RcsPhysics/BulletDebugNode.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef RCS_BULLETDEBUGNODE_H 35 | #define RCS_BULLETDEBUGNODE_H 36 | 37 | #include 38 | #include 39 | 40 | #include 41 | 42 | namespace Rcs 43 | { 44 | 45 | class BulletDebugNode : public NodeBase 46 | { 47 | public: 48 | 49 | BulletDebugNode(PhysicsBase* sim, pthread_mutex_t* viewerLock); 50 | virtual ~BulletDebugNode(); 51 | virtual void show(); 52 | virtual void hide(); 53 | virtual bool isVisible() const; 54 | 55 | private: 56 | 57 | virtual bool eventCallback(const osgGA::GUIEventAdapter& ea, 58 | osgGA::GUIActionAdapter& aa); 59 | 60 | void lockViewer() const; 61 | void unlockViewer() const; 62 | 63 | PhysicsBase* sim; 64 | mutable pthread_mutex_t* viewerLock; 65 | }; 66 | 67 | } // namespace Rcs 68 | 69 | #endif // RCS_BULLETDEBUGNODE_H 70 | -------------------------------------------------------------------------------- /src/RcsPhysics/BulletHelpers.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef RCS_BULLETHELPERS_H 35 | #define RCS_BULLETHELPERS_H 36 | 37 | #include 38 | #include 39 | 40 | #include 41 | 42 | 43 | 44 | namespace Rcs 45 | { 46 | btTransform btTransformFromHTr(const HTr* A_KI); 47 | void HTrFromBtTransform(HTr* A_KI, const btTransform& trf); 48 | void printTransform(const btTransform& trf); 49 | void printTransform(const char* comment, const btTransform& trf); 50 | btConvexHullShape* meshToHull(const RcsMeshData* mesh, 51 | double collisionMargin=0.002); 52 | btConvexHullShape* meshToCompressedHull(const RcsMeshData* mesh, 53 | double collisionMargin=0.002); 54 | RcsMeshData* hullToMesh(const btConvexHullShape* convHull); 55 | void convertMesh(const char* to, const char* from); 56 | } 57 | 58 | 59 | #endif // RCS_BULLETHELPERS_H 60 | -------------------------------------------------------------------------------- /src/RcsPhysics/BulletJointBase.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | #ifndef RCS_BULLETJOINTBASE_H 35 | #define RCS_BULLETJOINTBASE_H 36 | 37 | 38 | 39 | namespace Rcs 40 | { 41 | class BulletJointBase 42 | { 43 | public: 44 | 45 | virtual double getJointPosition() const = 0; 46 | virtual double getJointVelocity() const = 0; 47 | virtual double getJointAcceleration() const = 0; 48 | virtual double getJointTorque() const = 0; 49 | virtual unsigned int getJointIndex() const = 0; 50 | virtual void update(double dt) = 0; 51 | virtual void setJointPosition(double angle, double dt) = 0; 52 | virtual void setJointTorque(double torque, double dt) = 0; 53 | virtual void setJointLimit(bool enable, double q_min, double q_max) = 0; 54 | virtual void reset(double hingeAngle) = 0; 55 | virtual bool isHinge() const = 0; 56 | virtual bool isSlider() const = 0; 57 | 58 | protected: 59 | 60 | virtual double getConstraintPos() = 0; 61 | }; 62 | 63 | } // namespace Rcs 64 | 65 | #endif // RCS_BULLETJOINTBASE_H 66 | -------------------------------------------------------------------------------- /src/RcsPhysics/PhysicsHeadless.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | 3 | Copyright (c) 2017, Honda Research Institute Europe GmbH 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, 10 | this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | *******************************************************************************/ 33 | 34 | namespace Rcs 35 | { 36 | 37 | bool isPhysicsHeadless() 38 | { 39 | #if defined (HEADLESS_BUILD) 40 | return true; 41 | #else 42 | return false; 43 | #endif 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/RcsPhysics/Vortex/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | PROJECT(RcsVortex) 4 | 5 | # Check if we are included as subproject (on old systems) or separate 6 | SET(RCSVORTEX_MASTER_PROJECT OFF) 7 | IF(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) 8 | SET(RCSVORTEX_MASTER_PROJECT ON) 9 | ENDIF() 10 | 11 | IF(RCSVORTEX_MASTER_PROJECT) 12 | # We need to use gcc 4.8 for this 13 | FIND_PROGRAM(GCC_48 "gcc-4.8") 14 | FIND_PROGRAM(GXX_48 "g++-4.8") 15 | SET(CMAKE_C_COMPILER ${GCC_48}) 16 | SET(CMAKE_CXX_COMPILER ${GXX_48}) 17 | 18 | # Use compile settings and dependency management from Rcs proper 19 | LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake) 20 | INCLUDE(Externals) 21 | INCLUDE(CompileSettings) 22 | FIND_PACKAGE(Vortex REQUIRED) 23 | FIND_PACKAGE(LibXml2 REQUIRED) 24 | 25 | SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) 26 | 27 | ELSE() 28 | # As subproject, we need no special library installation 29 | SET(RCSVORTEX_INSTALL_LIBDIR "lib") 30 | ENDIF() 31 | 32 | SET(SRCS 33 | VortexHelpers.cpp 34 | VortexSimulation.cpp) 35 | 36 | # Define the library 37 | ADD_LIBRARY(RcsVortex SHARED ${SRCS}) 38 | 39 | # Vortex dependency 40 | TARGET_INCLUDE_DIRECTORIES(RcsVortex SYSTEM PRIVATE ${VORTEX_INCLUDE_DIR}) 41 | TARGET_COMPILE_DEFINITIONS(RcsVortex PRIVATE ${VORTEX_DEFINITIONS}) 42 | # RcsCore dependencies 43 | TARGET_INCLUDE_DIRECTORIES(RcsVortex PRIVATE 44 | ${CMAKE_CURRENT_SOURCE_DIR}/../../RcsCore 45 | ${LIBXML2_INCLUDE_DIR} 46 | ${PTHREAD_INCLUDE_DIR}) 47 | 48 | IF (WIN32) 49 | TARGET_LINK_LIBRARIES(RcsVortex RcsCore ${VORTEX_LIBRARIES}) 50 | ENDIF() 51 | 52 | # We intentionally do not link against Vortex and RcsCore. This allows the 53 | # resulting library to use the version available at runtime. The linker 54 | # needs us to specify vortex libraries explicitly anyways. Thus, a single 55 | # prebuilt binary can be used with any vortex installation. 56 | IF(RCSVORTEX_MASTER_PROJECT) 57 | TARGET_LINK_LIBRARIES(RcsVortex ${VORTEX_LIBRARIES}) 58 | ENDIF() 59 | 60 | # Always use C++11 61 | IF (UNIX) 62 | TARGET_COMPILE_OPTIONS(RcsVortex PRIVATE "-std=c++11") 63 | ENDIF() 64 | # Avoid symbol conflicts 65 | SET_TARGET_PROPERTIES(RcsVortex PROPERTIES CXX_VISIBILITY_PRESET "hidden") 66 | 67 | # The install command is used to put the library into Rcs' own library dir. 68 | IF(NOT RCSVORTEX_MASTER_PROJECT) 69 | #INSTALL(TARGETS RcsVortex DESTINATION ${RCSVORTEX_INSTALL_LIBDIR}) 70 | ENDIF() 71 | 72 | INSTALL(FILES ${PROJECT_BINARY_DIR}/libRcsVortex.so DESTINATION ${RCSVORTEX_INSTALL_LIBDIR}) 73 | -------------------------------------------------------------------------------- /unittest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2020, Honda Research Institute Europe GmbH. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # 9 | # 1. Redistributions of source code must retain the above copyright notice, 10 | # this list of conditions and the following disclaimer. 11 | # 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 16 | # 3. Neither the name of the copyright holder nor the names of its 17 | # contributors may be used to endorse or promote products derived from 18 | # this software without specific prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY EXPRESS OR 21 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23 | # IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, 24 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 26 | # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | 32 | function testMath() 33 | { 34 | build/bionic64/bin/bionic64/TestMath -m -1 -numTests 10 -dl 1 &> UnitTestResults.txt 35 | testMathResult=$? 36 | } 37 | 38 | function testGraph() 39 | { 40 | build/bionic64/bin/bionic64/Rcs -m 3 -iter 10 -dl 1 -valgrind &>> UnitTestResults.txt 41 | testGraphResult=$? 42 | } 43 | 44 | function testController() 45 | { 46 | build/bionic64/bin/bionic64/Rcs -m 6 -valgrind -nTests 10 -dl 1 &>> UnitTestResults.txt 47 | testControllerResult=$? 48 | } 49 | 50 | echo -n "Testing mathematics functions ... " 51 | testMath 52 | 53 | if [ $testMathResult -eq 0 ] 54 | then 55 | echo "succeeded" 56 | elif [ $testMathResult -eq 255 ] 57 | then 58 | echo "failed with more than 255 errors" 59 | else 60 | echo "failed with $testMathResult errors" 61 | fi 62 | 63 | 64 | 65 | echo -n "Testing graph functions ... " 66 | testGraph 67 | 68 | if [ $testGraphResult -eq 0 ] 69 | then 70 | echo "succeeded" 71 | elif [ $testGraphResult -eq 255 ] 72 | then 73 | echo "failed with more than 255 errors" 74 | else 75 | echo "failed with $testGraphResult errors" 76 | fi 77 | 78 | 79 | 80 | echo -n "Testing controller functions ... " 81 | testController 82 | 83 | if [ $testControllerResult -eq 0 ] 84 | then 85 | echo "succeeded" 86 | elif [ $testControllerResult -eq 255 ] 87 | then 88 | echo "failed with more than 255 errors" 89 | else 90 | echo "failed with $testControllerResult errors" 91 | fi 92 | 93 | --------------------------------------------------------------------------------