Commit 9ca0b854 authored by Pierre Fernbach's avatar Pierre Fernbach
Browse files

Merge branch 'master' into 'master'

Change python installation directory

See merge request anybotics/anymal-rbprm!6
parents 10824bd0 2cbc01fa
# Copyright (c) 2012 CNRS
# Author: Florent Lamiraux
#
# This file is part of hpp-rbprm-corba.
# hpp-rbprm-corba is free software: you can redistribute it
# and/or modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation, either version
# 3 of the License, or (at your option) any later version.
#
# hpp-rbprm-corba is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Lesser Public License for more details. You should have
# received a copy of the GNU Lesser General Public License along with
# hpp-rbprm-corba. If not, see
# <http://www.gnu.org/licenses/>.
# Requires at least CMake 2.6 to configure the package.
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(CXX_DISABLE_WERROR true)
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
SET(PROJECT_NAME anymal-rbprm)
SET(PROJECT_DESCRIPTION "Database for anymal robot using hpp-rbprm")
SET(PROJECT_URL "")
SET(CUSTOM_HEADER_DIR "hpp/anymal-rbprm")
SET(CXX_DISABLE_WERROR true)
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/idl.cmake)
INCLUDE(cmake/hpp.cmake)
INCLUDE(cmake/python.cmake)
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
SET(CUSTOM_HEADER_DIR "hpp/anymal-rbprm")
SETUP_PROJECT ()
# search for python
FINDPYTHON()
PKG_CONFIG_APPEND_LIBS(${PROJECT_NAME})
ADD_LIBRARY(${PROJECT_NAME} INTERFACE)
INSTALL(TARGETS ${PROJECT_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION lib)
SET(CATKIN_PACKAGE_SHARE_DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME})
install(DIRECTORY data/ DESTINATION share/${PROJECT_NAME} )
SET(CATKIN_PACKAGE_SHARE_DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/anymal-rbprm)
install(DIRECTORY
data/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install (FILES
src/hpp/corbaserver/rbprm/anymal/robot.py
src/hpp/corbaserver/rbprm/anymal/__init__.py
DESTINATION ${PYTHON_SITELIB}/hpp/corbaserver/rbprm/anymal)
install (FILES
src/hpp/corbaserver/rbprm/anymal_contact6D/robot.py
src/hpp/corbaserver/rbprm/anymal_contact6D/__init__.py
DESTINATION ${PYTHON_SITELIB}/hpp/corbaserver/rbprm/anymal_contact6D)
install (FILES
src/hpp/corbaserver/rbprm/anymal_abstract/robot.py
src/hpp/corbaserver/rbprm/anymal_abstract/__init__.py
DESTINATION ${PYTHON_SITELIB}/hpp/corbaserver/rbprm/anymal_abstract)
STRING(REGEX REPLACE "-" "_" PY_NAME ${PROJECT_NAME})
SET(${PROJECT_NAME}_PYTHON_FILES
__init__.py
anymal.py
anymal_abstract.py
anymal_contact6D.py
)
SETUP_PROJECT_FINALIZE()
FOREACH(SOURCE ${${PROJECT_NAME}_PYTHON_FILES})
PYTHON_INSTALL_ON_SITE(${PY_NAME} ${SOURCE})
ENDFOREACH(SOURCE ${${PROJECT_NAME}_PYTHON_SOURCES})
......@@ -23,7 +23,7 @@ import numpy as np
class Robot (Parent):
##
# Information to retrieve urdf and srdf files.
name = "anymal"
packageName = "anymal_data"
meshPackageName = "anymal_data"
rootJointType = "freeflyer"
......@@ -129,12 +129,10 @@ class Robot (Parent):
kneeIds = {"LF":9,"LH":12,"RF":15,"RH":18}
def __init__ (self, name = None,load = True):
Parent.__init__ (self,load)
if load:
self.loadFullBodyModel(self.urdfName, self.rootJointType, self.meshPackageName, self.packageName, self.urdfSuffix, self.srdfSuffix)
if name != None:
def __init__(self, name=None, load=True, client=None, clientRbprm=None):
if name is not None:
self.name = name
Parent.__init__(self, self.name, self.rootJointType, load, client, None, clientRbprm)
# save original bounds of the urdf for futur reset
self.LF_HAA_bounds = self.getJointBounds('LF_HAA')
self.LF_HFE_bounds = self.getJointBounds('LF_HFE')
......@@ -166,7 +164,21 @@ class Robot (Parent):
print("add limb : ",id)
eff = self.dict_limb_joint[id]
print("effector name = ",eff)
self.addLimb(id,self.dict_limb_rootJoint[id],eff,self.dict_offset[eff].translation.tolist(),self.dict_normal[eff],self.dict_size[eff][0]/2.,self.dict_size[eff][1]/2.,nbSamples,dict_heuristic[id],octreeSize,self.cType,disableEffectorCollision = disableEffectorCollision,kinematicConstraintsPath=self.kinematicConstraintsPath+self.dict_limb_rootJoint[id]+"_06_com_constraints.obj",limbOffset=self.dict_limb_offset[id],kinematicConstraintsMin=self.minDist)
self.addLimb(id,
self.dict_limb_rootJoint[id],
eff,
self.dict_offset[eff].translation.tolist(),
self.dict_normal[eff],
self.dict_size[eff][0]/2.,
self.dict_size[eff][1]/2.,
nbSamples,
dict_heuristic[id],
octreeSize,
self.cType,
disableEffectorCollision = disableEffectorCollision,
kinematicConstraintsPath=self.kinematicConstraintsPath+self.dict_limb_rootJoint[id]+"_06_com_constraints.obj",
limbOffset=self.dict_limb_offset[id],
kinematicConstraintsMin=self.minDist)
if analysis :
self.runLimbSampleAnalysis(id, analysis, True)
......
......@@ -30,6 +30,9 @@ class Robot (Parent):
urdfNameRom = ['anymal_RFleg_rom','anymal_LHleg_rom','anymal_LFleg_rom','anymal_RHleg_rom']
urdfSuffix = ""
srdfSuffix = ""
name = urdfName
ref_height = 0.465
# TODO
ref_EE_lLeg =[0.373, 0.264, -0.448]
......@@ -41,12 +44,10 @@ class Robot (Parent):
#ref_EE_lArm = [-0.3, 0.165 , -0.44]
#ref_EE_rArm = [-0.3, -0.165 , -0.44]
def __init__ (self, name = None, load = True):
Parent.__init__ (self,load)
if load:
self.loadModel(self.urdfName, self.urdfNameRom, self.rootJointType, self.meshPackageName, self.packageName, self.urdfSuffix, self.srdfSuffix)
if name != None:
def __init__(self, name=None, load=True, client=None, clientRbprm=None):
if name is not None:
self.name = name
Parent.__init__(self, self.name, self.rootJointType, load, client, None, clientRbprm)
self.setReferenceEndEffector('anymal_LFleg_rom',self.ref_EE_lLeg)
self.setReferenceEndEffector('anymal_RFleg_rom',self.ref_EE_rLeg)
self.setReferenceEndEffector('anymal_LHleg_rom',self.ref_EE_lArm)
......
Subproject commit 2de34adfce816937d2403cb602261ade0c26f0cd
Subproject commit 0ec0f542c02839bcbdf1faa8f5a4559dcf8632ec
#!/usr/bin/env python
# Copyright (c) 2019 CNRS
# Author : Pierre Fernbach
from .robot import Robot
#!/usr/bin/env python
# Copyright (c) 2019 CNRS
# Author : Pierre Fernbach
from .robot import Robot
#!/usr/bin/env python
# Copyright (c) 2019 CNRS
# Author : Pierre Fernbach
from .robot import Robot
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment