From d761866d520da49471b19ef64ad8b32c121d1c38 Mon Sep 17 00:00:00 2001 From: Florent Lamiraux <florent@laas.fr> Date: Mon, 14 Feb 2011 14:23:53 +0100 Subject: [PATCH] Reintroduce robotSimu. RobotSimu now derives from Device. --- include/sot/core/device.hh | 4 ++-- src/CMakeLists.txt | 3 ++- src/dynamic_graph/sot/core/__init__.py | 4 ++-- src/tools/device.cpp | 23 ++++------------------- 4 files changed, 10 insertions(+), 24 deletions(-) diff --git a/include/sot/core/device.hh b/include/sot/core/device.hh index f1941a58..4aca1bf3 100644 --- a/include/sot/core/device.hh +++ b/include/sot/core/device.hh @@ -97,8 +97,8 @@ namespace dynamicgraph { dynamicgraph::Signal<ml::Vector,int> ZMPPreviousControllerSOUT; public: /* --- COMMANDS --- */ - void commandLine(const std::string& cmdLine,std::istringstream& cmdArgs, - std::ostream& os){} + void commandLine(const std::string&, std::istringstream&, + std::ostream&){} }; } // namespace sot diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 713f1a0a..4abd5866 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -73,7 +73,7 @@ SET(plugins tools/timer tools/seq-play tools/sequencer - tools/device + tools/robot-simu tools/motion-period tools/neck-limitation tools/mailbox-vector @@ -144,6 +144,7 @@ SET(${LIBRARY_NAME}_SOURCES tools/utils-windows tools/periodic-call + tools/device ) ADD_LIBRARY(${LIBRARY_NAME} diff --git a/src/dynamic_graph/sot/core/__init__.py b/src/dynamic_graph/sot/core/__init__.py index 4fc98dbc..868fdc21 100644 --- a/src/dynamic_graph/sot/core/__init__.py +++ b/src/dynamic_graph/sot/core/__init__.py @@ -1,4 +1,4 @@ -from device import Device +from robot_simu import RobotSimu from unary_op import RPYToMatrix, MatrixHomoToPoseRollPitchYaw from feature_point6d import FeaturePoint6d from feature_position import FeaturePosition @@ -12,7 +12,7 @@ from constraint import Constraint from gain_adaptive import GainAdaptive from sot import SOT -Device('') +RobotSimu('') RPYToMatrix('') MatrixHomoToPoseRollPitchYaw('') FeaturePoint6d('') diff --git a/src/tools/device.cpp b/src/tools/device.cpp index 779e1145..8d93676f 100644 --- a/src/tools/device.cpp +++ b/src/tools/device.cpp @@ -31,12 +31,11 @@ using namespace std; #include <dynamic-graph/factory.h> #include <dynamic-graph/all-commands.h> + using namespace dynamicgraph::sot; using namespace dynamicgraph; - -DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(Device, "Device"); - +const std::string Device::CLASS_NAME = "Device"; /* --------------------------------------------------------------------- */ /* --- CLASS ----------------------------------------------------------- */ @@ -139,24 +138,14 @@ Device( const std::string& n ) /* --- Commands --- */ { - using namespace dynamicgraph::command; 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"; - addCommand("increment", - makeCommandVoid1( *this,&Device::increment,docstring)); /* Command setStateSize. */ docstring = "\n" " Set size of state vector\n" "\n"; addCommand("resize", - new Setter<Device, unsigned int> + new command::Setter<Device, unsigned int> (*this, &Device::setStateSize, docstring)); /* Command set. */ docstring = @@ -164,7 +153,7 @@ Device( const std::string& n ) " Set state vector value\n" "\n"; addCommand("set", - new Setter<Device, Vector> + new command::Setter<Device, Vector> (*this, &Device::setState, docstring)); } } @@ -225,12 +214,8 @@ increment( const double & dt ) ml::Vector zmp(3); zmp.fill( .0 ); ZMPPreviousControllerSOUT .setConstant( zmp ); - - } - - /* --- DISPLAY ------------------------------------------------------------ */ void Device::display ( std::ostream& os ) const -- GitLab