Commit 6ec2f2a1 authored by olivier stasse's avatar olivier stasse
Browse files

Merge pull request #9 from andreadelprete/fix_indentation

Fix indentation
parents c3122074 f306ba9c
......@@ -73,14 +73,47 @@ PYTHON_INSTALL_ON_SITE("${PYTHON_MODULE}" "__init__.py" )
PYTHON_INSTALL_BUILD("${PYTHON_MODULE}" "robot.py" "${PYTHON_SITELIB}")
PYTHON_INSTALL_ON_SITE("${PYTHON_MODULE}" "prologue.py")
# Add the library to wrap the controller of HRP2-JRL.
# Add the library to wrap the device of HRP2.
MACRO(build_hrp2_device)
SET(DEVICE_NAME sot-hrp2-device)
ADD_LIBRARY(${DEVICE_NAME}
SHARED
sot-hrp2-device.cpp
)
# Link the dynamic library containing the SoT with its dependencies.
PKG_CONFIG_USE_DEPENDENCY(${DEVICE_NAME} "dynamic-graph")
PKG_CONFIG_USE_DEPENDENCY(${DEVICE_NAME} "dynamic-graph-python")
PKG_CONFIG_USE_DEPENDENCY(${DEVICE_NAME} "sot-core")
ROSPACK_USE_DEPENDENCY(${DEVICE_NAME} "dynamic_graph_bridge")
IF(UNIX AND NOT APPLE)
TARGET_LINK_LIBRARIES(${DEVICE_NAME} ${Boost_LIBRARIES})
ENDIF(UNIX AND NOT APPLE)
INSTALL(TARGETS ${DEVICE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
# build python submodule
STRING(REPLACE - _ PYTHON_LIBRARY_NAME ${DEVICE_NAME})
SET(NEW_ENTITY_CLASS ${ENTITIES})
DYNAMIC_GRAPH_PYTHON_MODULE("sot/hrp2/${PYTHON_LIBRARY_NAME}"
${DEVICE_NAME}
sot-hrp2-${PYTHON_LIBRARY_NAME}-wrap
)
ENDMACRO()
build_hrp2_device()
# Add the library to wrap the controller of HRP2.
MACRO(build_hrp2_controller robotnumber)
SET(CONTROLLER_NAME sot-hrp2-${robotnumber}-controller)
ADD_LIBRARY(${CONTROLLER_NAME}
SHARED
sot-hrp2-controller.cpp
sot-hrp2-device.cpp
sot-hrp2-${robotnumber}-controller.cpp
)
......@@ -91,6 +124,9 @@ MACRO(build_hrp2_controller robotnumber)
ROSPACK_USE_DEPENDENCY(${CONTROLLER_NAME} "dynamic_graph_bridge")
ADD_DEPENDENCIES(${CONTROLLER_NAME} "sot-hrp2-device")
TARGET_LINK_LIBRARIES(${CONTROLLER_NAME} "sot-hrp2-device")
IF(UNIX AND NOT APPLE)
TARGET_LINK_LIBRARIES(${CONTROLLER_NAME} ${Boost_LIBRARIES})
......@@ -98,15 +134,8 @@ MACRO(build_hrp2_controller robotnumber)
INSTALL(TARGETS ${CONTROLLER_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
# build python submodule
STRING(REPLACE - _ PYTHON_LIBRARY_NAME ${CONTROLLER_NAME})
SET(NEW_ENTITY_CLASS ${ENTITIES})
DYNAMIC_GRAPH_PYTHON_MODULE("sot/hrp2/${PYTHON_LIBRARY_NAME}"
${CONTROLLER_NAME}
sot-hrp2-${PYTHON_LIBRARY_NAME}-wrap
)
ENDMACRO()
build_hrp2_controller("10")
build_hrp2_controller("14")
\ No newline at end of file
build_hrp2_controller("14")
......@@ -6,7 +6,7 @@
* LAAS, CNRS
*
* This file is part of HRP2Controller.
* HRP2Controller is not a free software,
* HRP2Controller is not a free software,
* it contains information related to HRP-2 which involves
* that you either purchased the proper license to have access to
* those informations, or that you signed the appropriate
......@@ -57,14 +57,14 @@ SoTHRP2Device::SoTHRP2Device(std::string RobotName):
std::string docstring;
/* Command increment. */
docstring =
"\n"
" Integrate dynamics for time step provided as input\n"
"\n"
" take one floating point number as input\n"
"\n";
"\n"
" Integrate dynamics for time step provided as input\n"
"\n"
" take one floating point number as input\n"
"\n";
addCommand("increment",
makeCommandVoid1((Device&)*this,
&Device::increment, docstring));
makeCommandVoid1((Device&)*this,
&Device::increment, docstring));
sotDEBUGOUT(25);
}
......@@ -117,9 +117,9 @@ void SoTHRP2Device::setSensors(map<string,dgsot::SensorValues> &SensorsIn)
it = SensorsIn.find("accelerometer_0");
if (it!=SensorsIn.end())
{
const vector<double>& accelerometer =
SensorsIn ["accelerometer_0"].getValues ();
for (std::size_t i=0; i<3; ++i)
const vector<double>& accelerometer =
SensorsIn ["accelerometer_0"].getValues ();
for (std::size_t i=0; i<3; ++i)
accelerometer_ (i) = accelerometer [i];
accelerometerSOUT_.setConstant (accelerometer_);
}
......@@ -128,7 +128,7 @@ void SoTHRP2Device::setSensors(map<string,dgsot::SensorValues> &SensorsIn)
if (it!=SensorsIn.end())
{
const vector<double>& gyrometer = SensorsIn ["gyrometer_0"].getValues ();
for (std::size_t i=0; i<3; ++i)
for (std::size_t i=0; i<3; ++i)
gyrometer_ (i) = gyrometer [i];
gyrometerSOUT_.setConstant (gyrometer_);
}
......@@ -173,7 +173,7 @@ void SoTHRP2Device::getControl(map<string,dgsot::ControlValues> &controlOut)
sotDEBUG (25) << "state = " << state_ << std::endl;
sotDEBUG (25) << "diff = " << ((previousState_.size() == state_.size())?
(state_ - previousState_) : state_ ) << std::endl;
(state_ - previousState_) : state_ ) << std::endl;
previousState_ = state_;
// Specify the joint values for the controller.
......
......@@ -6,7 +6,7 @@
* LAAS, CNRS
*
* This file is part of HRP2Controller.
* HRP2Controller is not a free software,
* HRP2Controller is not a free software,
* it contains information related to HRP-2 which involves
* that you either purchased the proper license to havec access to
* those informations, or that you signed the appropriate
......@@ -29,16 +29,16 @@
namespace dgsot=dynamicgraph::sot;
class SoTHRP2Device: public
dgsot::Device
dgsot::Device
{
public:
public:
static const std::string CLASS_NAME;
static const double TIMESTEP_DEFAULT;
virtual const std::string& getClassName () const
{
return CLASS_NAME;
virtual const std::string& getClassName () const
{
return CLASS_NAME;
}
SoTHRP2Device(std::string RobotName);
......
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