rosnode with rtt_ros_integration

Hi,

I used to type the following lines in my ros-orocos components in the
contructor :

ros::NodeHandle nh;
m_srvSetMotorPower = nh.advertiseService("/Ubiquity/setMotorPower",
&RosHmlItf::srvSetMotorPower, this);

But I have the following error :

[FATAL] [1395527990.310948091]: You must call ros::init() before creating
the first NodeHandle
[FATAL] [1395527990.311063471]: BREAKPOINT HIT
file =
/home/ard/arp_os/dependencies/ros/src/roscpp/src/libros/node_handle.cpp
line=151

Should I add the ros::init() call or should I use something else ? I have
sawn a rtt_rosnode package, but there is no instructions about it.

rosnode with rtt_ros_integration

Willy,

You shouldn't have to do anything other than import the `rtt_rosnode`
orocos plugin. This will call ros::init with the proper arguments. You
should never have to call ros::init yourself in an orocos component.

Previously, orocos would attempt to load all dependencies in a package's
manifest.xml file. In Catkin, this changed so that identifiers listed in
the package.xml as dependencies might be either system dependencies or
packages. Unfortunately with this new XML specification, there's an
ambiguity in the case where a package isn't found: it could either be a
system dependency, or it could be a missing orocos package. To make this
explicit, plugins form ROS packages and their dependencies can be imported
by using the <export> section of a package.xml file or manifest.xml file.
This works in the following way:
https://github.com/orocos/rtt_ros_integration/tree/hydro-devel/rtt_ros#r...

So if you want to automatically load `rtt_rosnode` when your package is
imported by `rtt_ros.import`, you can add it as a plugin_depend in your
package's XML manifest.

Additionally, if you want to connect an operation to a ROS service, you can
now use this API if you like:
https://github.com/orocos/rtt_ros_integration/tree/hydro-devel/rtt_rosco...

-j

On Sat, Mar 22, 2014 at 6:43 PM, Willy Lambert <lambert [dot] willy [..] ...>wrote:

> Hi,
>
> I used to type the following lines in my ros-orocos components in the
> contructor :
>
> ros::NodeHandle nh;
> m_srvSetMotorPower = nh.advertiseService("/Ubiquity/setMotorPower",
> &RosHmlItf::srvSetMotorPower, this);
>
> But I have the following error :
>
> [FATAL] [1395527990.310948091]: You must call ros::init() before creating
> the first NodeHandle
> [FATAL] [1395527990.311063471]: BREAKPOINT HIT
> file =
> /home/ard/arp_os/dependencies/ros/src/roscpp/src/libros/node_handle.cpp
> line=151
>
> Should I add the ros::init() call or should I use something else ? I have
> sawn a rtt_rosnode package, but there is no instructions about it.
>
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>
>

rosnode with rtt_ros_integration

In fact it was my deployer that was doing the job of the rosnode and I was
certainly automatically turned into a node the previous implementation of
the ros bridge.

I was having hard time in connecting ros-messages to ports, but updating my
git trees to last versions solved the issue.

Thanks for the other tips, I'll have a look at this.

2014-03-23 18:12 GMT+01:00 Jonathan Bohren <jonathan [dot] bohren [..] ...>:

> Willy,
>
> You shouldn't have to do anything other than import the `rtt_rosnode`
> orocos plugin. This will call ros::init with the proper arguments. You
> should never have to call ros::init yourself in an orocos component.
>
> Previously, orocos would attempt to load all dependencies in a package's
> manifest.xml file. In Catkin, this changed so that identifiers listed in
> the package.xml as dependencies might be either system dependencies or
> packages. Unfortunately with this new XML specification, there's an
> ambiguity in the case where a package isn't found: it could either be a
> system dependency, or it could be a missing orocos package. To make this
> explicit, plugins form ROS packages and their dependencies can be imported
> by using the <export> section of a package.xml file or manifest.xml file.
> This works in the following way:
>
> https://github.com/orocos/rtt_ros_integration/tree/hydro-devel/rtt_ros#r...
>
> So if you want to automatically load `rtt_rosnode` when your package is
> imported by `rtt_ros.import`, you can add it as a plugin_depend in your
> package's XML manifest.
>
> Additionally, if you want to connect an operation to a ROS service, you
> can now use this API if you like:
>
> https://github.com/orocos/rtt_ros_integration/tree/hydro-devel/rtt_rosco...
>
> -j
>
>
> On Sat, Mar 22, 2014 at 6:43 PM, Willy Lambert <lambert [dot] willy [..] ...>wrote:
>
>> Hi,
>>
>> I used to type the following lines in my ros-orocos components in the
>> contructor :
>>
>> ros::NodeHandle nh;
>> m_srvSetMotorPower = nh.advertiseService("/Ubiquity/setMotorPower",
>> &RosHmlItf::srvSetMotorPower, this);
>>
>> But I have the following error :
>>
>> [FATAL] [1395527990.310948091]: You must call ros::init() before creating
>> the first NodeHandle
>> [FATAL] [1395527990.311063471]: BREAKPOINT HIT
>> file =
>> /home/ard/arp_os/dependencies/ros/src/roscpp/src/libros/node_handle.cpp
>> line=151
>>
>> Should I add the ros::init() call or should I use something else ? I have
>> sawn a rtt_rosnode package, but there is no instructions about it.
>>
>> --
>> Orocos-Users mailing list
>> Orocos-Users [..] ...
>> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>>
>>
>
>
> --
> Jonathan Bohren
> Laboratory for Computational Sensing and Robotics
> http://dscl.lcsr.jhu.edu/People/JonathanBohren
>
>