opspace/src/Task.cpp

Go to the documentation of this file.
00001 /*
00002  * Shared copyright notice and LGPLv3 license statement.
00003  *
00004  * Copyright (C) 2011 The Board of Trustees of The Leland Stanford Junior University. All rights reserved.
00005  * Copyright (C) 2011 University of Texas at Austin. All rights reserved.
00006  *
00007  * Authors: Roland Philippsen (Stanford) and Luis Sentis (UT Austin)
00008  *          http://cs.stanford.edu/group/manips/
00009  *          http://www.me.utexas.edu/~hcrl/
00010  *
00011  * This program is free software: you can redistribute it and/or
00012  * modify it under the terms of the GNU Lesser General Public License
00013  * as published by the Free Software Foundation, either version 3 of
00014  * the License, or (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful, but
00017  * WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  * Lesser General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Lesser General Public
00022  * License along with this program.  If not, see
00023  * <http://www.gnu.org/licenses/>
00024  */
00025 
00026 #include <opspace/Task.hpp>
00027 
00028 using namespace jspace;
00029 
00030 namespace opspace {
00031   
00032   
00033   Task::
00034   Task(std::string const & name)
00035     : ParameterReflection("task", name),
00036       sigma_threshold_(1.0e-2)
00037   {
00038     declareParameter("sigma_threshold", &sigma_threshold_);
00039     // these will become read-only, as soon as that is supported in
00040     // the Parameter interface...
00041     declareParameter("actual", &actual_);
00042     declareParameter("command", &command_);
00043     // overkill? declareParameter("jacobian", &jacobian_);
00044   }
00045   
00046   
00047   void Task::
00048   dump(std::ostream & os, std::string const & title, std::string const & prefix) const
00049   {
00050     if ( ! title.empty()) {
00051       os << title << "\n";
00052     }
00053     os << prefix << "task: `" << instance_name_ << "'\n";
00054     ParameterReflection::dump(os, prefix + "  parameters", prefix + "    ");
00055     pretty_print(actual_, os, prefix + "  actual:", prefix + "    ");
00056     pretty_print(command_, os, prefix + "  command:", prefix + "    ");
00057     pretty_print(jacobian_, os, prefix + "  Jacobian:", prefix + "    ");
00058   }
00059   
00060   
00061   void Task::
00062   dbg(std::ostream & os, std::string const & title, std::string const & prefix) const
00063   {
00064     // too noisy...
00065     // os << prefix << "task " << instance_name_ << "\n";
00066     // ParameterReflection::dump(os, prefix + "  parameters", prefix + "    ");
00067   }
00068   
00069 }

Generated on Fri Aug 26 01:31:17 2011 for Stanford Whole-Body Control Framework by  doxygen 1.5.4