...
 
Commits (4)
# Copyright 2013, Florent Lamiraux, CNRS
# Copyright 2013, 2020, Florent Lamiraux, Guilhem Saurel, CNRS
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
SET(PROJECT_NAMESPACE stack-of-tasks)
# Project properties
SET(PROJECT_ORG stack-of-tasks)
SET(PROJECT_NAME sot-application)
SET(PROJECT_DESCRIPTION "Initialization of control graph dependending on applications")
SET(PROJECT_URL "https://github.com/${PROJECT_NAMESPACE}/${PROJECT_NAME}")
SET(PROJECT_URL "https://github.com/${PROJECT_ORG}/${PROJECT_NAME}")
# Project configuration
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
SET(DOXYGEN_USE_MATHJAX YES)
# JRL-cmakemodule setup
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/python.cmake)
INCLUDE(cmake/sphinx.cmake)
FINDPYTHON()
# Project definition
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
SET(DOXYGEN_USE_MATHJAX YES)
# Project dependencies
ADD_PROJECT_DEPENDENCY(sot-dynamic-pinocchio REQUIRED PKG_CONFIG_REQUIRES sot-dynamic-pinocchio)
FINDPYTHON()
STRING(REGEX REPLACE "-" "_" PY_NAME ${PROJECT_NAME})
CMAKE_POLICY(SET CMP0048 OLD)
PROJECT(${PROJECT_NAME} CXX)
ADD_LIBRARY(${PROJECT_NAME} INTERFACE)
INSTALL(TARGETS ${PROJECT_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION lib)
PYTHON_INSTALL_ON_SITE(${PY_NAME} __init__.py)
PYTHON_INSTALL_ON_SITE(${PY_NAME}/velocity __init__.py)
PYTHON_INSTALL_ON_SITE(${PY_NAME}/velocity precomputed_tasks.py)
PYTHON_INSTALL_ON_SITE(${PY_NAME}/velocity precomputed_meta_tasks.py)
# Search for dependencies.
ADD_REQUIRED_DEPENDENCY("sot-dynamic-pinocchio >= 2.8")
PYTHON_INSTALL_ON_SITE(${PY_NAME}/acceleration __init__.py)
PYTHON_INSTALL_ON_SITE(${PY_NAME}/acceleration precomputed_meta_tasks.py)
# Add subdirectories.
ADD_SUBDIRECTORY(${PY_NAME})
ADD_SUBDIRECTORY(doc)
BSD 2-Clause License
Copyright (c) 2010-2019, CNRS
Copyright (c) 2010-2020, CNRS
All rights reserved.
Redistribution and use in source and binary forms, with or without
......
Subproject commit 046c3be5553c4ea340eb672d0289627f0c07b1a4
Subproject commit 321eb1ccf1d94570eb564f3659b13ef3ef82239e
......@@ -24,7 +24,7 @@ sys.path = [os.path.abspath('@CMAKE_SOURCE_DIR@/src')]+sys.path
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.pngmath']
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.todo']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
......
# Copyright 2013, Florent Lamiraux, CNRS
INSTALL(FILES
__init__.py
DESTINATION ${PYTHON_SITELIB}/${PY_NAME}
)
INSTALL(FILES
__init__.py
velocity/precomputed_tasks.py
velocity/precomputed_meta_tasks.py
DESTINATION ${PYTHON_SITELIB}/${PY_NAME}/velocity
)
INSTALL(FILES
__init__.py
acceleration/precomputed_meta_tasks.py
DESTINATION ${PYTHON_SITELIB}/${PY_NAME}/acceleration
)
......@@ -5,7 +5,7 @@
from numpy import eye
from dynamic_graph import plug
from dynamic_graph.sot.core import FeatureGeneric
from dynamic_graph.sot.core.feature_generic import FeatureGeneric
from dynamic_graph.sot.core.matrix_util import matrixToTuple
from dynamic_graph.sot.dyninv import SolverKine, TaskDynInequality, TaskDynLimits
from dynamic_graph.sot.dyninv.meta_task_dyn_6d import MetaTaskDyn6d
......
......@@ -5,7 +5,8 @@
from numpy import eye
from dynamic_graph import plug
from dynamic_graph.sot.core import FeatureGeneric, JointLimitator
from dynamic_graph.sot.core.feature_generic import FeatureGeneric
from dynamic_graph.sot.core.joint_limitator import JointLimitator
from dynamic_graph.sot.core.matrix_util import matrixToTuple
from dynamic_graph.sot.core.meta_task_6d import toFlags
from dynamic_graph.sot.core.meta_task_posture import MetaTaskKinePosture
......
......@@ -7,9 +7,12 @@ import warnings
from numpy import identity
from dynamic_graph import plug
from dynamic_graph.sot.core import SOT, FeatureGeneric, GainAdaptive, JointLimitator, Task
from dynamic_graph.sot.core.feature_generic import FeatureGeneric
from dynamic_graph.sot.core.feature_position import FeaturePosition
from dynamic_graph.sot.core.gain_adaptive import GainAdaptive
from dynamic_graph.sot.core.joint_limitator import JointLimitator
from dynamic_graph.sot.core.matrix_util import matrixToTuple
from dynamic_graph.sot.core.sot import SOT, Task
class Solver:
......@@ -151,17 +154,19 @@ def initialize(robot, solverType=SOT):
Use dynamic_graph.sot.application.velocity.precomputed_tasks.Application""")
# --- center of mass ------------
(robot.featureCom, robot.featureComDes, robot.comTask, robot.gainCom) = createCenterOfMassFeatureAndTask(
robot, '{0}_feature_com'.format(robot.name), '{0}_feature_ref_com'.format(robot.name),
'{0}_task_com'.format(robot.name))
(robot.featureCom, robot.featureComDes, robot.comTask,
robot.gainCom) = createCenterOfMassFeatureAndTask(robot, '{0}_feature_com'.format(robot.name),
'{0}_feature_ref_com'.format(robot.name),
'{0}_task_com'.format(robot.name))
# --- operational points tasks -----
robot.features = dict()
robot.tasks = dict()
robot.gains = dict()
for op in robot.OperationalPoints:
(robot.features[op], robot.tasks[op], robot.gains[op]) = createOperationalPointFeatureAndTask(
robot, op, '{0}_feature_{1}'.format(robot.name, op), '{0}_task_{1}'.format(robot.name, op))
(robot.features[op], robot.tasks[op],
robot.gains[op]) = createOperationalPointFeatureAndTask(robot, op, '{0}_feature_{1}'.format(robot.name, op),
'{0}_task_{1}'.format(robot.name, op))
# define a member for each operational point
w = op.split('-')
memberName = w[0]
......@@ -201,23 +206,25 @@ class Application(object):
- comdot: input (vector) reference velocity of the center of mass
"""
def __init__(self, robot, solverType=SOT):
self.robot = robot
# --- center of mass ------------
(self.featureCom, self.featureComDes, self.taskCom, self.gainCom) = createCenterOfMassFeatureAndTask(
robot, '{0}_feature_com'.format(robot.name), '{0}_feature_ref_com'.format(robot.name),
'{0}_task_com'.format(robot.name))
(self.featureCom, self.featureComDes, self.taskCom,
self.gainCom) = createCenterOfMassFeatureAndTask(robot, '{0}_feature_com'.format(robot.name),
'{0}_feature_ref_com'.format(robot.name),
'{0}_task_com'.format(robot.name))
# --- operational points tasks -----
self.features = dict()
self.tasks = dict()
self.gains = dict()
for op in robot.OperationalPoints:
(self.features[op], self.tasks[op], self.gains[op]) = createOperationalPointFeatureAndTask(
robot, op, '{0}_feature_{1}'.format(robot.name, op), '{0}_task_{1}'.format(robot.name, op))
(self.features[op], self.tasks[op],
self.gains[op]) = createOperationalPointFeatureAndTask(robot, op,
'{0}_feature_{1}'.format(robot.name, op),
'{0}_task_{1}'.format(robot.name, op))
# define a member for each operational point
w = op.split('-')
memberName = w[0]
......@@ -235,8 +242,8 @@ class Application(object):
(self.tasks['balance'], self.gains['balance']) = createBalanceTask(robot, self,
'{0}_task_balance'.format(robot.name))
(self.featurePosture, self.featurePostureDes, self.taskPosture, self.gainPosture) = createPostureTask(
robot, "posture")
(self.featurePosture, self.featurePostureDes, self.taskPosture,
self.gainPosture) = createPostureTask(robot, "posture")
self.tasks['posture'] = self.taskPosture
self.features['posture'] = self.featurePosture
self.gains['posture'] = self.gainPosture
......