rtiddsgen Request-Reply C++

11 posts / 0 new
Last post
Offline
Last seen: 8 years 8 months ago
Joined: 03/26/2016
Posts: 6
rtiddsgen Request-Reply C++

I have been using rtiddsgen to make my publish-subscribe programs on a Raspberry Pi up until this point, but now I am looking for a request-reply model instead.

How can I use rtiddsgen to make a requester and replier along with the proper make file for the ARM processor? If I can't use rtiddsgen, I understand how to make a requester and replier in c++ from scatch, but I wouldn't know how to create a make file that could compile it for a Raspberry Pi, so how would I go about doing that?


Any help is appreciated,

Timothy Castiglia

Fernando Garcia's picture
Offline
Last seen: 5 months 1 week ago
Joined: 05/18/2011
Posts: 200

Hi Timothy,

RTI Connext DDS includes a C++ example on how to use Request-Reply that includes a Makefile for armv6vfphLinux3.xgcc4.7.2 (i.e., the platform that runs on the Raspberry Pi). If you are using RTI Connext DDS 5.2.0, you should be able to find the example under ~/rti_workspace/5.2.0/examples/connext_dds/c++/hello_world_request_reply. To build the example from the example directory run:

cd ~/rti_workspace/5.2.0/examples/connext_dds/c++/hello_world_request_reply
export NDDSHOME=/path/to/your/installation/rti_connext_dds-5.2.0
make -f make/Makefile.armv6vfphLinux3.xgcc4.7.2

Note that you will need to have the  arm-linux-gnueabihf-g++ cross compiler in your path.

Alternatively, you can use rtiddsgen to create an example and tweak the example code and the makefile to build your Request-Reply application. That is, first create an example with the following command:

rtiddsgen -language C++ -example armv6vfphLinux3.xgcc4.7.2 Hello.idl

And then tweak the publisher and subscriber applications to behave as a Requester and a Replier like in the example.

For more information on how to use the Request/Reply API, check out this section of the RTI Connext DDS User's manual.

Let me know if this answers your question,
Fernando.

Offline
Last seen: 8 years 8 months ago
Joined: 03/26/2016
Posts: 6

I have taken your second line of advice, I generated my own code and followed the Prime Number Calculator as an example to make my own Request and Reply model. However, I seem to be running into errors when I try to build the makefile, mostly saying there are undefined references. For example:

ColorRR_publisher.cxx:(.text._ZN21ColorRequesterExample11run_exampleEii[ColorRequesterExample::run_example(int, int)]+0x36): undefined reference to ‘connext::RequesterParams::RequesterParams(DDSDomainParticipant*)’

I am only working with the requester side right now. I get similar errors when I try building the Prime Calculator example. I looked into the files that are needed for these functions but they are already included in the code. Does this have something to do with me using Connext 5.0.0? Or something else?

 

Fernando Garcia's picture
Offline
Last seen: 5 months 1 week ago
Joined: 05/18/2011
Posts: 200

Hi Timothy,

Rtiddsgen does not include the library that contains the symbols for the Request/Reply API. Please, make sure that you include librticonnextmsgcppz in the autogenerated makefile:

LIBS = -L$(NDDSHOME)/lib/$(TARGET_ARCH) -lrticonnextmsgcppz -lnddscppz -lnddscz -lnddscorez $(SYSLIBS)

Let me know if this fixes your issue. If it does not, please share your makefile and I will help you debug what may be missing.

Thanks,
Fernando.

 

Offline
Last seen: 8 years 8 months ago
Joined: 03/26/2016
Posts: 6

Thank you, this worked for my linux machine test case. However, it isn't the same for the raspberry pi. Do you know the equivalent request/reply library for Raspberry Pi (armv6vfphLinux3.xgcc4.7.2)? Or is there not one?

Fernando Garcia's picture
Offline
Last seen: 5 months 1 week ago
Joined: 05/18/2011
Posts: 200

Hi Timothy,

Support for Request/Reply on Raspberry Pi was added in 5.1.0. The 5.0.0 libraries are part of an experimental port that was released only in this website, which only included the core libraries. Can you upgrade to 5.2.0 or 5.1.0 at least on the Raspberry Pi?

Thanks,
Fernando.

Offline
Last seen: 8 years 8 months ago
Joined: 03/26/2016
Posts: 6

Yes I can upgrade. But what is the name of the library from 5.2.0 that I would need to include in the makefile? It doesn't seem to be the same name as with Linux. 

Gerardo Pardo's picture
Offline
Last seen: 4 days 13 hours ago
Joined: 06/02/2010
Posts: 602

Hello,

The libraries should be the same as for Linux. RaspberryPi is a Linux larget, only it is an ARM rather than Intel architecture. But that does not affect the library names for example the dynamic non-debug libraries are  librticonnextmsgcpp.so  and   librticonnextmsgc.so. . For static it would be  librticonnextmsgcppz.a and  librticonnextmsgcz.a.

Perhaps you did not download the right target package? You need the Connext Pro targets. I think for the RaspberryPi that would be

rti_connext_dds-5.2.0-pro-target-armv6vfphLinux3.xgcc4.7.2.rtipkg

Note that the "basic" target package does not include the libraries needed for request/reply.

Gerardo

 

 

Offline
Last seen: 8 years 8 months ago
Joined: 03/26/2016
Posts: 6

That would explain it. I have been using the core library downloads, not pro. Where can I find the downloads for pro libraries? I can only seem to find a link to downloads of the Raspberry Pi Core libraries.

By the way, this HowTo has been really helpful, but I think it's time to be updated, and could use some request/reply examples: https://community.rti.com/content/forum-topic/howto-run-rti-connext-dds-raspberry-pi

 

Gerardo Pardo's picture
Offline
Last seen: 4 days 13 hours ago
Joined: 06/02/2010
Posts: 602

The pro libraries are in the customer support portal (https://support.rti.com/). You need to log in. I assume this is where you are downloading the 5.2 "basic" libraries for Arm as well... Is this right?

If after you log in to the portal you do not see the PRO package in your downnloads page it may be that you have not been enabled to access them? If that is the case you should send email to support@rti.com and request to have this download enabled.  Your affiliation says RPI so I assume you have an academic/research license in which case you are qualified to have the PRO bundles...

Thank you for the positve comments on the RaspberryPi HOWTO.  We will need to find some time to update it following your recommendation given the populatity. It is by far the HOWTO that has the most views :)

Gerardo

 

Offline
Last seen: 8 years 8 months ago
Joined: 03/26/2016
Posts: 6

I was not downloading the libraries through the support portal, I found them in a link from the HOWTO. Getting a portal login turned into a bit of a hassle but I finally got one and was able to download the appropriate libraries. The code compile and I tried running it on my Raspberry Pi. I'm getting the follow error:

  DDS_QosProvider_get_typecode_from_type_library:ERROR: library not found
Exception: create_participant failed

Is this still a problem with how I compiled the code or is there something I need on the Pi in order to run the code that I'm missing?