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&#10;think OutputPort and InputPort are templeted types. So you migth need to&#10;use :&#10;OutputPort&lt;double&gt; outPort;&#10;InputPort&lt;double&gt; port;&#10;&#10;&#10;&#10;&#10;&gt; 0.574 [ Warning][Thread] Forcing priority (0) of thread with !SCHED_OTHER&#10;&gt; policy to 1.&#10;&gt; 0.575 [ Warning][Thread] Forcing priority (0) of thread with !SCHED_OTHER&#10;&gt; policy to 1.&#10;&gt; 0.576 [ ERROR  ][DeploymentComponent::configureComponents] No OutputPort&#10;&gt; listed that writes ROSConTwistOut&#10;&gt; 0.576 [ ERROR  ][Logger] Failed to configure a component: aborting&#10;&gt; kick-start.&#10;&gt;&#10;&gt; I found this post&#10;&gt;&#10;&gt; http://www.orocos.org/forum/orocos/orocos-users/rttrosintegrationexample... I tried to follow the proposed solution but I still have the same errors.&#10;&gt;&#10;&gt; I created my components in 2 separate cpp files and the connection is&#10;&gt; defined&#10;&gt; in an xml file as follows:&#10;&gt; file VirtualSensor.cpp&#10;&gt; [code]&#10;&gt;&#10;&gt; #include&#10;&gt;&#10;&gt; #include&#10;&gt; #include&#10;&gt; #include&#10;&gt; #include&#10;&gt; #include&#10;&gt; #include&#10;&gt; #include&#10;&gt; #include&#10;&gt; #include&#10;&gt;&#10;&gt; using namespace std;&#10;&gt; using namespace RTT;&#10;&gt;&#10;&gt; namespace SimpleExample&#10;&gt; {&#10;&gt;&#10;&gt;        class VirtualSensorComponent&#10;&gt;        : public TaskContext{&#10;&gt;&#10;&gt;        protected:&#10;&gt;                OutputPort port;&#10;&gt;                int value;&#10;&gt;&#10;&gt;&#10;&gt;        public:&#10;&gt;                VirtualSensorComponent(std::string name)&#10;&gt;                : TaskContext(name),&#10;&gt;                  port(&quot;port&quot;)&#10;&gt;                {&#10;&gt;                        this-&gt;ports()-&gt;addPort(port).doc(&quot;port&quot;);&#10;&gt;                        value = 0;&#10;&gt;&#10;&gt;                }&#10;&gt;                void updateHook() {&#10;&gt;                        port.write(value);&#10;&gt;                        value++;&#10;&gt;                }&#10;&gt;        };&#10;&gt;&#10;&gt;&#10;&gt; }&#10;&gt;&#10;&gt;&#10;&gt; #include&#10;&gt;&#10;&gt; ORO_CREATE_COMPONENT( SimpleExample::VirtualSensorComponent );&#10;&gt;
>
> file Avoid.cpp
> &#10;&gt; #include&#10;&gt;&#10;&gt; #include&#10;&gt; #include&#10;&gt;&#10;&gt; #include&#10;&gt; #include&#10;&gt; #include&#10;&gt; #include&#10;&gt;&#10;&gt; #include&#10;&gt; #include&#10;&gt; #include&#10;&gt;&#10;&gt; using namespace std;&#10;&gt; using namespace RTT;&#10;&gt;&#10;&gt; namespace SimpleExample&#10;&gt; {&#10;&gt;        class AvoidComponent: public TaskContext{&#10;&gt;&#10;&gt;        protected:&#10;&gt;                InputPort port;&#10;&gt;                OutputPort outport;&#10;&gt;&#10;&gt;        public:&#10;&gt;                AvoidComponent(std::string name)&#10;&gt;                : TaskContext(name),&#10;&gt;                  port(&quot;port&quot;),&#10;&gt;                  outport(&quot;outport&quot;)&#10;&gt;                {&#10;&gt;                  this-&gt;ports()-&gt;addPort(port);&#10;&gt;                  this-&gt;ports()-&gt;addPort(outport);&#10;&gt;                }&#10;&gt;&#10;&gt;                bool configureHook() {&#10;&gt;                        return true;&#10;&gt;                }&#10;&gt;&#10;&gt;                void updateHook() {&#10;&gt;                        geometry_msgs::Twist cmd;&#10;&gt;                        cmd.angular.z = 1;&#10;&gt;                        outport.write(cmd);&#10;&gt;                        cout&#10;&gt;&#10;&gt;&#10;&gt;&#10;&gt;&#10;&gt;        1&#10;&gt;        1&#10;&gt;&#10;&gt;&#10;&gt;       0&#10;&gt;       1&#10;&gt;       ORO_SCHED_RT&#10;&gt;&#10;&gt;&#10;&gt;       AvoidComponent&#10;&gt;&#10;&gt;&#10;&gt;        portConnection&#10;&gt;&#10;&gt;     1&#10;&gt;     1&#10;&gt;&#10;&gt;&#10;&gt;&#10;&gt;&#10;&gt;     1&#10;&gt;        1&#10;&gt;&#10;&gt;&#10;&gt;       0&#10;&gt;       1&#10;&gt;       ORO_SCHED_RT&#10;&gt;&#10;&gt;&#10;&gt;       VirtualSensorComponent&#10;&gt;&#10;&gt;&#10;&gt;        portConnection&#10;&gt;        RosConTwistOut&#10;&gt;&#10;&gt;     1&#10;&gt;     1&#10;&gt;&#10;&gt;&#10;&gt;&#10;&gt;&#10;&gt;
>
> 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.