error deployment component

Hi,

I'm trying to create an example with 2 orocos components communicating together and one of these components sends then a command to an actuator. I can compile the example without any problem but when I launch the example using rosrun ocl deployer-gnulinux -s connect.xml I get these errors: 0.574 [ Warning][Thread] Forcing priority (0) of thread with !SCHED_OTHER policy to 1. 0.575 [ Warning][Thread] Forcing priority (0) of thread with !SCHED_OTHER policy to 1. 0.576 [ ERROR ][DeploymentComponent::configureComponents] No OutputPort listed that writes ROSConTwistOut 0.576 [ ERROR ][Logger] Failed to configure a component: aborting kick-start.

I found this post http://www.orocos.org/forum/orocos/orocos-users/rttrosintegrationexample-problem I tried to follow the proposed solution but I still have the same errors.

I created my components in 2 separate cpp files and the connection is defined in an xml file as follows: file VirtualSensor.cpp

#include <rtt/os/main.h>
 
#include <rtt/Logger.hpp>
#include <rtt/TaskContext.hpp>
#include <rtt/Activity.hpp>
#include <rtt/Property.hpp>
#include <rtt/Attribute.hpp>
#include <rtt/OperationCaller.hpp>
#include <rtt/Port.hpp>
#include <rtt/TaskContext.hpp>
#include <rtt/Service.hpp>
 
using namespace std;
using namespace RTT;
 
namespace SimpleExample
{
 
    class VirtualSensorComponent
    : public TaskContext{
 
    protected:
        OutputPort<int> port;
        int value;
 
 
    public:
        VirtualSensorComponent(std::string name)
        : TaskContext(name),
          port("port")
        {
            this->ports()->addPort(port).doc("port");
            value = 0;
 
        }
        void updateHook() {
            port.write(value);
            value++;
        }
    };
 
 
}
 
 
#include <rtt/Component.hpp>
 
ORO_CREATE_COMPONENT( SimpleExample::VirtualSensorComponent );

file Avoid.cpp

#include <rtt/os/main.h>
 
#include <rtt/Logger.hpp>
#include <rtt/TaskContext.hpp>
 
#include <rtt/Property.hpp>
#include <rtt/Port.hpp>
#include <rtt/ServiceRequester.hpp>
#include <rtt/OperationCaller.hpp>
 
#include <rtt/SendHandle.hpp>
#include <rtt/SendStatus.hpp>
#include <geometry_msgs/Twist.h>
 
using namespace std;
using namespace RTT;
 
namespace SimpleExample
{
    class AvoidComponent: public TaskContext{
 
    protected:
        InputPort<int> port;
        OutputPort<geometry_msgs::Twist> outport;
 
    public:
        AvoidComponent(std::string name)
        : TaskContext(name),
           port("port"),
          outport("outport")
        {
          this->ports()->addPort(port);
          this->ports()->addPort(outport);        
        }
 
        bool configureHook() {
            return true;
        }
 
        void updateHook() {
            geometry_msgs::Twist cmd; 
             cmd.angular.z = 1;
               outport.write(cmd);
            cout<<"command"<<cmd;    
 
            int value;
            if(NewData == port.read(value))
                cout<<"read value"<<value<<"\n";
 
            //FlowStatus rv = port.read(value);
            //if ( rv == RTT::NewData ) {
            //    log(Info) << "Avoid port data: " << value << endlog();
            //}
        }
    };
}
 
#include <rtt/Component.hpp>
ORO_CREATE_COMPONENT(SimpleExample::AvoidComponent);

File connect.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "cpf.dtd">
<properties>
 
<simple name="Import" type="string"><value>ExampleToFollow</value></simple>
 
  <struct name="ROSConTwistOut" type="ConnPolicy">
    <simple name="type" type="short"><value>0</value></simple><!-- type of connection: 0 means Data -->
    <simple name="size" type="short"><value>1</value></simple><!-- buffer size -->
    <simple name="transport" type="short"><value>3</value></simple><!--3 means ROS-->
    <simple name="name_id" type="string"><value>/ATRV/Motion_Controller</value></simple><!-- topic name -->
  </struct>
 
  <struct name="VirtualSensorComponent" type="SimpleExample::VirtualSensorComponent">
 
      <simple name="Server" type="boolean"><value>1</value></simple>
      <simple name="UseNamingService" type="boolean"><value>1</value></simple>
 
    <struct name="Activity" type="Activity">
      <simple name="Priority" type="short"><value>0</value></simple>
      <simple name="Period" type="double"><value>1</value></simple>
      <simple name="Scheduler" type="string"><value>ORO_SCHED_RT</value></simple>
    </struct>
    <struct name="Peers" type="PropertyBag">
      <simple type="string"><value>AvoidComponent</value></simple>
    </struct>
    <struct name="Ports" type="PropertyBag">
    <simple name="port" type="string"><value>portConnection</value></simple>
    </struct>
    <simple name="AutoConf" type="boolean"><value>1</value></simple>
    <simple name="AutoStart" type="boolean"><value>1</value></simple>
  </struct>
 
  <struct name="AvoidComponent" type="SimpleExample::AvoidComponent">
 
    <simple name="Server" type="boolean"><value>1</value></simple>
      <simple name="UseNamingService" type="boolean"><value>1</value></simple>
 
    <struct name="Activity" type="Activity">
      <simple name="Priority" type="short"><value>0</value></simple>
      <simple name="Period" type="double"><value>1</value></simple>
      <simple name="Scheduler" type="string"><value>ORO_SCHED_RT</value></simple>
    </struct>
    <struct name="Peers" type="PropertyBag">
      <simple type="string"><value>VirtualSensorComponent</value></simple>
    </struct>
    <struct name="Ports" type="PropertyBag">
    <simple name="port" type="string"><value>portConnection</value></simple>
    <simple name="outport" type="string"><value>RosConTwistOut</value></simple>
    </struct>
    <simple name="AutoConf" type="boolean"><value>1</value></simple>
    <simple name="AutoStart" type="boolean"><value>1</value></simple>    
  </struct>
 
 
</properties>

Is there anything wrong in my code? Any help will be appreciated.

Thanks in advance, selma.

error deployment component

On Tue, Jan 17, 2012 at 2:52 PM, <selma [dot] kchir [..] ...> wrote:
>
> Hi,
>
> I'm trying to create an example with 2 orocos components communicating
> together and one of these components sends then a command to an actuator.
> I can compile the example without any problem but when I launch the example
> using
> rosrun ocl deployer-gnulinux -s connect.xml I get these errors:
> 0.574 [ Warning][Thread] Forcing priority (0) of thread with !SCHED_OTHER
> policy to 1.
> 0.575 [ Warning][Thread] Forcing priority (0) of thread with !SCHED_OTHER
> policy to 1.
> 0.576 [ ERROR  ][DeploymentComponent::configureComponents] No OutputPort
> listed that writes ROSConTwistOut
> 0.576 [ ERROR  ][Logger] Failed to configure a component: aborting
> kick-start.
>
> I found this post
> http://www.orocos.org/forum/orocos/orocos-users/rttrosintegrationexample...
> I tried to follow the proposed solution but I still have the same errors.

Can you change the addPort statements into something like the following:

this->addPort("portname",portobject)

and see if it changes?

error deployment component

Thanks Ruben but I still have the same errors, it seems like the output port is not recognized? I tried to add an input port connected to a Laser sensor in the same way (I added a connection in the xml file and the port type is sensor_msgs::LaserScan) and it worked. Maybe the problem is related to the use of output ports or geometry_msgs?

Selma.

error deployment component

2012/1/17 <selma [dot] kchir [..] ...>

> Hi,
>
> I'm trying to create an example with 2 orocos components communicating
> together and one of these components sends then a command to an actuator.
> I can compile the example without any problem but when I launch the example
> using
> rosrun ocl deployer-gnulinux -s connect.xml I get these errors:
>

Hi,

Your post has been very altered on the mailing list (there is maybe an
issue with the

 tag), so I am not sure to have read the full code. I
think OutputPort and InputPort are templeted types. So you migth need to
use :
OutputPort<double> outPort;
InputPort<double> port;
 
 
 
 
> 0.574 [ Warning][Thread] Forcing priority (0) of thread with !SCHED_OTHER
> policy to 1.
> 0.575 [ Warning][Thread] Forcing priority (0) of thread with !SCHED_OTHER
> policy to 1.
> 0.576 [ ERROR  ][DeploymentComponent::configureComponents] No OutputPort
> listed that writes ROSConTwistOut
> 0.576 [ ERROR  ][Logger] Failed to configure a component: aborting
> kick-start.
>
> I found this post
>
> http://www.orocos.org/forum/orocos/orocos-users/rttrosintegrationexample-problem
> I tried to follow the proposed solution but I still have the same errors.
>
> I created my components in 2 separate cpp files and the connection is
> defined
> in an xml file as follows:
> file VirtualSensor.cpp
> [code]
>
> #include
>
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
>
> using namespace std;
> using namespace RTT;
>
> namespace SimpleExample
> {
>
>        class VirtualSensorComponent
>        : public TaskContext{
>
>        protected:
>                OutputPort port;
>                int value;
>
>
>        public:
>                VirtualSensorComponent(std::string name)
>                : TaskContext(name),
>                  port("port")
>                {
>                        this->ports()->addPort(port).doc("port");
>                        value = 0;
>
>                }
>                void updateHook() {
>                        port.write(value);
>                        value++;
>                }
>        };
>
>
> }
>
>
> #include
>
> ORO_CREATE_COMPONENT( SimpleExample::VirtualSensorComponent );
> 

>
> file Avoid.cpp
>
> #include
>
> #include
> #include
>
> #include
> #include
> #include
> #include
>
> #include
> #include
> #include
>
> using namespace std;
> using namespace RTT;
>
> namespace SimpleExample
> {
>        class AvoidComponent: public TaskContext{
>
>        protected:
>                InputPort port;
>                OutputPort outport;
>
>        public:
>                AvoidComponent(std::string name)
>                : TaskContext(name),
>                  port("port"),
>                  outport("outport")
>                {
>                  this->ports()->addPort(port);
>                  this->ports()->addPort(outport);
>                }
>
>                bool configureHook() {
>                        return true;
>                }
>
>                void updateHook() {
>                        geometry_msgs::Twist cmd;
>                        cmd.angular.z = 1;
>                        outport.write(cmd);
>                        cout
>
>
>
>
>        1
>        1
>
>
>       0
>       1
>       ORO_SCHED_RT
>
>
>       AvoidComponent
>
>
>        portConnection
>
>     1
>     1
>
>
>
>
>     1
>        1
>
>
>       0
>       1
>       ORO_SCHED_RT
>
>
>       VirtualSensorComponent
>
>
>        portConnection
>        RosConTwistOut
>
>     1
>     1
>
>
>
>
> 

>
> Is there anything wrong in my code? Any help will be appreciated.
>
> Thanks in advance,
> selma.
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>

error deployment component

Thanks for your answer Willy but I need Ros messages to communicate with the actuator and I can't use simple types.

Thanks again,

Selma.