Hi, I'am trying to use boost::UTF (unit test module) to test my orocos task. When I add an attribut or Property, I've get this error msg in the console:
Running 1 test case... 0.001 [ ERROR ][TypeInfoName] Can not build Property of unknown_t. 0.001 [ Info ][main()] ready?169.45 0.001 [ Warning][main()] Lowering scheduler type to SCHED_OTHER for non-privileged users.. 0.001 [ Warning][main()] Forcing priority (1) of thread with SCHED_OTHER policy to 0. 0.001 [ Info ][PeriodicThread] Creating PeriodicThread for scheduler: 0 0.001 [ Info ][TimerThreadInstance] PeriodicThread created with scheduler type '0', priority 0 and period 0.5. 0.001 [ Info ][main()] **** Starting the 'Hello' component **** 0.001 [ Info ][main()] **** Using the 'Hello' component **** 0.001 [ Info ][main()] **** Reading a Attibutes: **** 0.001 [ Info ][main()] DesPosition = 69.45 0.001 [ Info ][main()] **** Starting the TaskBrowser **** *** No errors detected
When I use the same code, without the boost::UTF, in a main(), I've didn`t get the error warning. The number of this error in the shell is the same as the Attribute count
This is my class
#ifndef DUAL_AXIS_CONVERTER_H #define DUAL_AXIS_CONVERTER_H #include <rtt/Logger.hpp> #include <rtt/TaskContext.hpp> #include <rtt/Property.hpp> #include <rtt/Attribute.hpp> #include <rtt/Method.hpp> #include <rtt/Command.hpp> #include <rtt/Event.hpp> #include <rtt/Ports.hpp> #include <rtt/TimeService.hpp> #include <vector> using namespace RTT; using namespace std; namespace RCL { class DualAxisConverter : public TaskContext { public: DualAxisConverter(string name); ///< Constructeur ~DualAxisConverter(); ///< Destructeur virtual bool configureHook(); ///< Methode de configuration virtual bool startHook(); ///< Methode de pre-demarrage virtual void updateHook(); ///< Methode execute en boucle virtual void stopHook(); ///< Methode d'arret virtual void cleanupHook(); ///< Methode execute a la deconfiguration protected: Attribute<double> mDesPositionAttr; ///< Contient la position désirée }; } #endif //DUAL_AXIS_CONVERTER_H
This is the cpp file
#include "DualAxisConverter.h" using namespace std; using namespace RTT; namespace RCL { DualAxisConverter::DualAxisConverter(string name) : TaskContext(name), mDesPositionAttr("DesPosition", 69.450) { // Ajout des Attributs attributes()->addAttribute(&mDesPositionAttr); } DualAxisConverter::~DualAxisConverter() { } bool DualAxisConverter::startHook() { return true; } }// Namesapce RCL
This is the test file:
#include "DualAxisConverter.h" #include <rtt/PeriodicActivity.hpp> #include <rtt/Logger.hpp> #define BOOST_TEST_MODULE MyTest #include <boost/test/unit_test.hpp> BOOST_AUTO_TEST_CASE( testStartHook ) { Logger::In in("main()"); // Set log level more verbose than default, // such that we can see output : if ( log().getLogLevel() < Logger::Info ) { log().setLogLevel( Logger::Info ); //log(Info) << argv[0] << " manually raises LogLevel to 'Info' (5). See also file 'orocos.log'."<<endlog(); } log(Info) << "**** Creating the 'Hello' component ****" <<endlog(); // Create the task: RCL::DualAxisConverter hello("Hello"); // Create the activity which runs the task's engine: // 1: Priority // 0.5: Period (2Hz) // hello.engine(): is being executed. hello.setActivity( new PeriodicActivity(1, 0.5, hello.engine() ) ); log(Info) << "**** Starting the 'Hello' component ****" <<endlog(); // Start the component: hello.start(); log(Info) << "****code Using the 'Hello' component ****" <<endlog(); // Do some 'client' calls : log(Info) << "**** Reading a Attibutes: ****" <<endlog(); Attribute<double> p = hello.attributes()->getAttribute<double>("DesPosition"); assert( p.ready() ); log(Info) << " "<<p.getName() << " = " << p.get() <<endlog(); log(Info) << "**** Starting the TaskBrowser ****" <<endlog(); }
The Attribut is initiated with the right value because of the print.
This is the only thread I`ve found on UTF: http://www.kindyn.org.tirant.priorweb.be/forum/rtt/rtt-dev/bug-641-new-migrate-cppunit-boosttests-utf
When I define the variable, nothing change: ENABLE_TESTS=OFF and ENABLE_BOOST_TESTS=ON
Can someone help me