From 7ced72947909f0e17a79107605a58d42442c47bb Mon Sep 17 00:00:00 2001 From: Marco Randazzo Date: Mon, 27 Nov 2023 15:49:04 +0100 Subject: [PATCH] documentation update changelog update --- doc/001_installation/4_yarp_env_variables.dox | 9 - doc/040_idl_thrift/0_thrift.dox | 2 +- doc/040_idl_thrift/idl_rosmsg.dox | 15 - .../thrift_tutorial_portable.dox | 11 - doc/050_ros/rostypes_tutorial_continued.dox | 268 -------------- doc/050_ros/rostypes_tutorial_portable.dox | 326 ------------------ doc/050_ros/yarp_with_ros.dox | 27 -- doc/050_ros/yarp_with_ros_configure.dox | 16 - .../yarp_with_ros_existing_yarp_ports.dox | 307 ----------------- doc/050_ros/yarp_with_ros_nameservers.dox | 118 ------- doc/050_ros/yarp_with_ros_parameters.dox | 56 --- doc/050_ros/yarp_with_ros_services.dox | 40 --- .../yarp_with_ros_writing_code_topics.dox | 141 -------- doc/090_tutorials.dox | 4 - doc/module_carriers/carrier_config.dox | 53 --- doc/module_executables/cmd_yarpdataplayer.dox | 10 - doc/module_executables/cmd_yarpidl_rosmsg.dox | 10 - doc/module_executables/cmd_yarpserver.dox | 1 - doc/release/master.md | 29 ++ 19 files changed, 30 insertions(+), 1413 deletions(-) delete mode 100644 doc/040_idl_thrift/idl_rosmsg.dox delete mode 100644 doc/050_ros/rostypes_tutorial_continued.dox delete mode 100644 doc/050_ros/rostypes_tutorial_portable.dox delete mode 100644 doc/050_ros/yarp_with_ros.dox delete mode 100644 doc/050_ros/yarp_with_ros_configure.dox delete mode 100644 doc/050_ros/yarp_with_ros_existing_yarp_ports.dox delete mode 100644 doc/050_ros/yarp_with_ros_nameservers.dox delete mode 100644 doc/050_ros/yarp_with_ros_parameters.dox delete mode 100644 doc/050_ros/yarp_with_ros_services.dox delete mode 100644 doc/050_ros/yarp_with_ros_writing_code_topics.dox delete mode 100644 doc/module_executables/cmd_yarpidl_rosmsg.dox create mode 100644 doc/release/master.md diff --git a/doc/001_installation/4_yarp_env_variables.dox b/doc/001_installation/4_yarp_env_variables.dox index d771876d716..478fd4a0517 100644 --- a/doc/001_installation/4_yarp_env_variables.dox +++ b/doc/001_installation/4_yarp_env_variables.dox @@ -85,15 +85,6 @@ UDP Carrier configuration | `YARP_DGRAM_SND_BUFFER_SIZE` | This variable controls the size in bytes of the UDP socket sending buffer. | | -ROS configuration -================= - -| Environmental variable | Description | Related documentation page | -|:-----------------------------:|:-----------:|:--------------------------:| -| `ROS_MASTER_URI` | If a ROS1 roscore is present in the network, this variable should contain its URI. If a ROS1 installation is present on the machine, this variable is typically set by ROS configuration scripts. | http://wiki.ros.org/ROS/EnvironmentVariables | -| `YARP_USE_ROS` | If this variable is set to something different from an empty string, the `yarpserver` will always be launched with `ROS` support. For example ``YARP_USE_ROS=1 yarpserver` is equivalent to `yarpserver --ros`. | \ref yarp_with_ros_nameservers | - - Misc configuration ================== diff --git a/doc/040_idl_thrift/0_thrift.dox b/doc/040_idl_thrift/0_thrift.dox index 7ffb4a9797e..2a7e253f61f 100644 --- a/doc/040_idl_thrift/0_thrift.dox +++ b/doc/040_idl_thrift/0_thrift.dox @@ -8,6 +8,6 @@ IDLs offers a convenient way to define structures and services and separate inte \section idls_list List of IDLs (Interface Description Languages) used in YARP \li \subpage idl_thrift -\li \subpage idl_rosmsg +\li \subpage idl_rosmsg */ diff --git a/doc/040_idl_thrift/idl_rosmsg.dox b/doc/040_idl_thrift/idl_rosmsg.dox deleted file mode 100644 index b8227bf94e9..00000000000 --- a/doc/040_idl_thrift/idl_rosmsg.dox +++ /dev/null @@ -1,15 +0,0 @@ -/** -\page idl_rosmsg ROS message types - -\tableofcontents - -\section idl_rosmsg_tutorials yarpidl_rosmsg tutorials - -\li \subpage rostypes_tutorial_portable -\li \subpage rostypes_tutorial_continued - -\section ros_msg_files ros .msg files - -See http://wiki.ros.org/Messages for an explanation of how ros .msg files work and their format. - -*/ diff --git a/doc/040_idl_thrift/thrift_tutorial_portable.dox b/doc/040_idl_thrift/thrift_tutorial_portable.dox index c9de4c84fae..cf7264402ff 100644 --- a/doc/040_idl_thrift/thrift_tutorial_portable.dox +++ b/doc/040_idl_thrift/thrift_tutorial_portable.dox @@ -259,15 +259,4 @@ The Thrift IDL also allows defining modules interfaces, this is explained here: \li \ref thrift_tutorial_simple \li \ref thrift_tutorial -YARP supports ROS types. -An alternative method to define portable objects in YARP is to use the ROS -syntax (i.e. through a .msg file). -The disadvantage of this approach is that you cannot use native YARP types, but -the advantage is that your messages will be compatible with ROS and readable -from a topic. This tutorial shows how you do this: - -\li \ref rostypes_tutorial_portable - -Code for this tutorial can be found here: `example/idl/portable` - */ diff --git a/doc/050_ros/rostypes_tutorial_continued.dox b/doc/050_ros/rostypes_tutorial_continued.dox deleted file mode 100644 index 221557d4f10..00000000000 --- a/doc/050_ros/rostypes_tutorial_continued.dox +++ /dev/null @@ -1,268 +0,0 @@ -/** -\page rostypes_tutorial_continued ROS Types in YARP: sending data to ROS - -\tableofcontents - -This tutorial assumes that you have completed the -steps in \ref rostypes_tutorial_portable. -That tutorial showed how to use types defined in -a ROS-style .msg file within YARP. Now, we will -work on sending data from YARP to ROS. - -At the beginning of this tutorial, we assume you have a YARP -server running, without any special configuration. During -the tutorial, we will reconfigure the name server to communicate -with ROS. - -\section rostypes_tutorial_continued_sender Making the sender program ROS-compatible - -The sender program from -\ref rostypes_tutorial_portable looks like this: - -\code -#include -#include -#include -#include -#include - -int main() -{ - yarp::os::Network network; - - yarp::os::Port port; - - if (!port.open("/sender")) - { - std::cerr<<"Error opening port, check your yarp network\n"; - return -1; - } - - std::cout<<"Starting sender\n"; - double count=0.0; - while(true) - { - yarp::rosidl::SharedData d; - - // d.text is a string - d.text="Hello from sender"; - - //d.content is a vector, let's push some data - d.content.push_back(count++); - d.content.push_back(count++); - - port.write(d); - - yarp::os::Time::delay(0.1); - } - - return 0; -} -\endcode - -This program was written using a yarp::os::Port, a very -flexible creature. It can communicate with ROS, if we tame it -a little bit to fit in with ROS's expectations that promise to -never change the type of data sent, and promise to always send data in -a particular direction. We can make those promises by calls to -yarp::os::Port::setWriteOnly and yarp::os::Port::promiseType, or -we can switch to using the helper class yarp::os::Publisher -that is already correctly configured. We can also add a -yarp::os::Node to make ROS even happier. - -\include example/idl/rosPortable/sender2.cpp - -Great, at this point our port is nice and tame by ROS standards. -And the code will still work just fine without ROS. For example, -we can run our existing receiver program from -\ref rostypes_tutorial_portable. We're now using a topic called -`/data` so -after running the receiver you'll need to subscribe it -to the topic: - -\verbatim -yarp connect topic://data /receiver -\endverbatim - -We can also update the receiver code to use -the yarp::os::Subscriber helper class: - -\include example/idl/rosPortable/receiver2.cpp - -\section rostypes_tutorial_continued_visible Registering with ROS - -Now let's make our programs visible with ROS. Stop running them, -and then also stop the yarp name server. Make sure you have -a ROS name server running ("roscore"/"rosmaster"), and that the -ROS_MASTER_URI environment variable is correctly set. -Then run the yarp name server with the --ros flag: - -\verbatim -$ yarpserver --ros -... start-up messages omitted .. -Using ROS with ROS_MASTER_URI=http://127.0.0.1:11311 -... start-up messages omitted .. -Ok. Ready! -\endverbatim - -Done! Now, if we rerun the sender and receiver programs, they should -work as before. The (invisible) difference is that they are being -connected by ROS rather than YARP. A visible difference is that -the programs are now visible within ROS. Try: - -\verbatim -$ rostopic list -... -/data -... -\endverbatim - -\verbatim -$ rosnode list -... -/receiver/node -/sender/node -... -\endverbatim - -\verbatim -$ rostopic info /data -Type: yarp/SharedData - -Publishers: - * /sender/node (http://192.168.1.3:10005) - -Subscribers: - * /receiver/node (http://192.168.1.3:10003) -\endverbatim - -\verbatim -$ rosnode info /receiver/node -Node [/receiver/node] -Publications: None - -Subscriptions: - * /data [yarp/SharedData] - -Services: None - -contacting node http://192.168.1.3:10003 ... -Pid: [12432] -\endverbatim - -Notice that ROS is reporting the topic `/data` as having the type -`yarp/SharedData`. ROS needs types to include a "package" name, -and we haven't specified one yet, so YARP has added a fake one. -To get full interoperation, we now need to add our `SharedData` -type in ROS (not just YARP), and as part of that process we'll -end up making a real ROS package. - -\section rostypes_tutorial_continued_msg Making the .msg file available to ROS - -In \ref rostypes_tutorial_portable we defined a SharedData -structure in a SharedData.msg file -and used it to communicate between sender and receiver programs -written using YARP. Now we need to make that file visible to ROS. -ROS expects .msg files to be in a directory called msg within -a ROS "package". If you already have a package set up for your work, -you can just use that. For completeness, we give -a very minimal ROS package here, just enough to experiment with, but -you can also just follow ROS tutorials, there's nothing YARP-specific -here. Do the following: - - + Create an empty directory, called say yarpros_tutorial. - + Within that directory, create another empty directory called `src`. - + Within that directory, create another empty directory that will be - our package, called say yarp. - + Within yarp, create an empty directory called msg. - + Copy SharedData.msg into yarpros_tutorial/src/yarp/msg/. - + Create a file called yarpros_tutorial/src/yarp/package.xml and place the following in it: - -\code - - - yarp - 0.0.0 - A test yarp package - Paul Fitzpatrick - BSD-3-Clause - message_generation - message_runtime - catkin - -\endcode - - + Create a file called yarpros_tutorial/src/CMakeLists.txt and place the following in it: - -\code -cmake_minimum_required(VERSION 3.16) -project(yarp) -find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation) -add_message_files(FILES SharedData.msg) -generate_messages(DEPENDENCIES std_msgs) -catkin_package(CATKIN_DEPENDS message_runtime) -\endcode - - + While in the `yarpros_tutorial` directory, run `catkin_make`. You should see something like: - -\verbatim -... --- +++ processing catkin package: 'yarp' -... -Generating C++ code from yarp/SharedData.msg -[ 50%] Generating Python from MSG yarp/SharedData -... -[100%] Built target yarp_generate_messages -\endverbatim - -Now we need to tell ROS about the existence of yarpros_tutorial. -There are many ways to do that. In a bash shell, the simplest -is to do (from the `yarpros_tutorial` directory): - -\verbatim -$ source devel/setup.bash -\endverbatim - -At this point, the rosmsg command should be able to find -our type: - -\verbatim -$ rosmsg show yarp/SharedData -string text -float64[] content -\endverbatim - -And if we run the `sender` program, we can print it from ROS: - -\verbatim -$ rostopic echo /data -text: Hello from sender -content: [4794.0, 4795.0] ---- -text: Hello from sender -content: [4796.0, 4797.0] ---- -text: Hello from sender -content: [4798.0, 4799.0] ---- -text: Hello from sender -content: [4800.0, 4801.0] ---- -\endverbatim - -If we stop the `sender` program and run the `receiver`, we can publish to -if from ROS. If we do this: - -\verbatim -rostopic pub /data yarp/SharedData "hello from ROS" "[1.1,2.2,3.3]" -\endverbatim - -The `receiver` program prints this: - -\verbatim -0 Received SharedData: -hello from ROS -1.1 2.2 3.3 -\endverbatim - -*/ diff --git a/doc/050_ros/rostypes_tutorial_portable.dox b/doc/050_ros/rostypes_tutorial_portable.dox deleted file mode 100644 index 6fd20ca3c2e..00000000000 --- a/doc/050_ros/rostypes_tutorial_portable.dox +++ /dev/null @@ -1,326 +0,0 @@ -/** -\page rostypes_tutorial_portable ROS Types in YARP: writing a portable - -\tableofcontents - -YARP built-in types can be sent through Ports. Sometimes you need to send custom -datatypes, in YARP objects that can be sent through ports are called -\em portable objects. \ref port_expert shows how you can manually implement a -portable object. - -For ROS interoperability YARP supports ROS msg types. In this tutorial we see -how you can automatically generate YARP portable objects using ROS syntax. -The advantage in this case is that your type is compatible with ROS and can be -directly read from a topic. - -\section rostypes_intro Introduction - -Suppose we have two modules that wish to share a \em SharedData \m struct that -contains a string and a vector. -Normally you would define the data in a C++ header file and write -serialization/deserialization methods to allow it to be sent and received -to/from a port (this process is called marshalling/demarshalling). -This process requires some YARP specific expertise, is error-prone and tedious. -The idea here is that instead of manually writing the class you define the -structure using the ROS syntax, then you ask a compiler (called -\em yarpidl_rosmsg) to generate the class for you, including all the required -code. -Because you use the ROS syntax this type is also compatible with ROS and can be -read from a topic. - -Let's see how to do it. - -\section rostypes_ros_defintion ROS definition for SharedData - -We start by defining our \em ShareData structure. Open a text editor and type -the following: - -\code -string text -float64[] content -\endcode - -name this file \em SharedData.msg save and close it. - -In ROS this specifies that SharedData is a struct that contains a \em text field -of type \em string and a \em content field which type is a \em vector of double -precision floating point numbers. ROS in fact supports much more options, see -http://wiki.ros.org/msg. - -Now you can convert the ROS type in a YARP compatible type. - -Type: - -\code -yarpidl_rosmsg SharedData.msg -\endcode - -This is the output you shuld get: -\code -[type] BEGIN SharedData.msg -[type] string text [] -[type] float64[] content [] -[type] END SharedData.msg -Generating SharedData.h -\endcode - -This will generate one file: \em yarp/rosidl/SharedData.h - -In case you are interested you can inspect it to see that it defines a C++ class -with some extra code. The good thing is that you don't actually need to bother -about the details, but you can readily use the class in your code. - -Now we can use these files in your YARP programs. We now write a sender and a -receiver. - -\section rostypes_code Code - -This code is straightforward. We define a sender executable that opens a port -and periodically writes a \em yarp::rosidl::SharedData object and a receiver -that opens a port and receives the same message type. - -As usual we start with the CMake code, write your CMakeLists.txt: - -\code - -cmake_minimum_required(VERSION 3.16) - -find_package(YARP COMPONENTS os REQUIRED) - -add_executable(sender) -target_sources(sender PRIVATE sender.cpp) -target_include_directories(sender PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries(sender PRIVATE YARP::YARP_os - YARP::YARP_init) - -\endcode -Now we write the code for the sender in \em sender.cpp: - -\code - - -#include -#include -#include -#include -#include - -int main() -{ - yarp::os::Network network; - - yarp::os::Port port; - - if (!port.open("/sender")) - { - std::cerr<<"Error opening port, check your yarp network\n"; - return -1; - } - - std::cout<<"Starting sender\n"; - double count=0.0; - while(true) - { - yarp::rosidl::SharedData d; - - // d.text is a string - d.text="Hello from sender"; - - //d.content is a vector, let's push some data - d.content.push_back(count++); - d.content.push_back(count++); - - port.write(d); - - yarp::os::Time::delay(0.1); - } - - return 0; -} - -\endcode - -Now compile the code -\code -mkdir build -cd build -cmake ../ -make - -./sender -\endcode - -Now you can run yarp read on a separate console to inspect the content that is -being transmitted on the port, the output should be something like this (you'll -need a very recent version of YARP for this to work - if it doesn't just skip -it): -\code -~$ yarp read ... /sender -yarp: Port /tmp/port/1 active at tcp://127.0.0.1:10003 -yarp: Receiving input from /sender to /tmp/port/1 using tcp -"Hello from sender" (276.0 277.0) -"Hello from sender" (278.0 279.0) -\endcode - -It is simple to write a receiver: - -Append the following to the CMakeLists.txt - -\code -add_executable(receiver) -target_sources(receiver PRIVATE receiver.cpp) -target_link_libraries(receiver YARP::YARP_os - YARP::YARP_init) -\endcode - -Now we write the code for the receiver in \em receiver.cpp: - -\code - -#include -#include -#include -#include - -int main() -{ - yarp::os::Network network; - - std::cout<<"Starting receiver\n"; - - yarp::os::Port port; - if (!port.open("/receiver")) - { - std::cerr<<"Error opening port, check your yarp network\n"; - return -1; - } - - network.connect("/sender", "/receiver"); - - int count=0; - while(true) - { - yarp::rosidl::SharedData d; - port.read(d); - - //access d - cout << count << " Received SharedData:\n"; - cout << d.text << "\n"; - for (int i=0; i 2.3.15 for this part. - -To see how to access /motor/state:o from ROS, do: -\verbatim -yarpros sniff out /motor/state:o -\endverbatim -This gives us the following rather arcane lines: -\verbatim -int32 v_tag # set to 266 (BOTTLE_TAG_LIST+code) -float64[] v # suggested length: 4 -\endverbatim -This is a valid .msg file, and can be used directly in ROS. - -See some more examples in the yarp source code, in the -example/yarpros_examples directory. - -\section yarp_with_ros_configuring_ports How to configure Ports to talk to ROS - -In a previous example (\ref yarp_with_ros_services) we have seen how to use -yarp::os::RpcClient to talk to a ROS service. -In fact we could have used a normal port configured appropriately: - -\code -Port client; -client.setRpcClient(); -\endcode - -In \ref yarp_with_ros_writing_code_topics we have used special classes -(yarp::os::Node, yarp::os::Publisher, yarp::os::Subscriber) to crate ROS nodes, -publishers and subscribers. -The same result can be achieved by configuring a yarp::os::Port. -However if we try to use a regular port without telling YARP how we'll be using -it (by calling one of setRpcClient(), setRpcServer(), setWriteOnly(), -setReadOnly()), YARP will complain because it won't know how to describe it to -ROS. -However, if you have a YARP-using program that you can't easily modify to add -such a call, you can sneak the needed information into the port name using the -special syntax described above. - - - - - - - -
ROS ideaCall needed to specialize a Port/BufferedPortOr add this decoration before "@" in port nameSpecialized class
Topic Subscriberport.setWriteOnly()-yarp::os::Subscriber
Topic Publisherport.setReadOnly()+yarp::os::Publisher
Serviceport.setRpcServer()-1yarp::os::RpcServer
Clientport.setRpcClient()+1yarp::os::RpcClient
- -For new code, however, it may be convenient to create ROS-like nodes and topics -explicitly rather than having names that bundles node and topic/service names -together. - -One thing to watch out for is that if you stop a program using ^C or -if it crashes, YARP will not yet unregister your ports with ROS. If -this bothers you, either add a signal handler to close the -Port, or run "rosnode cleanup" from time to time. Will fix this soon. - -*/ diff --git a/doc/050_ros/yarp_with_ros_nameservers.dox b/doc/050_ros/yarp_with_ros_nameservers.dox deleted file mode 100644 index c36f9325f54..00000000000 --- a/doc/050_ros/yarp_with_ros_nameservers.dox +++ /dev/null @@ -1,118 +0,0 @@ -/** -\page yarp_with_ros_nameservers Decide on what name server to use - -\tableofcontents - -Both YARP and ROS usually operate with a name server to help -track what ports/topics/nodes are where (but see also \ref yarp_without_nameserver). - -We assume you have ROS's usual name server "roscore" running somewhere. -Now, with YARP, you have several options: -\li You can configure YARP to use ROS's name server. So "roscore" will run, but - not "yarpserver". - This is the best option if the bulk of the network is ROS-based and you have - just one or two YARP modules you want to hook in. -\li You can configure YARP's name server to talk to ROS's name server. - So both "roscore" and "yarpserver" will run. - This is the best option for mixed networks, with many YARP modules and many - ROS modules. -\li You can configure YARP clients to talk to multiple name servers, in this - case the YARP server and the ROS name server. - This solution works but can be confusing to understand. - -For the first option, using "roscore" only, see \ref yarp_with_ros_roscore_only. -For the third option, using both name servers independently, see -\ref yarp_with_ros_roscore_added. -Here we are going to the middle option, where yarpserver is configured to be -ROS-aware. -Setting this up is simple. -Once roscore is running, and ROS_MASTER_URI is correctly set to point to it, do: -\verbatim -yarpserver --ros -\endverbatim -You should see lines like these as the server starts up: -\verbatim -.. -Using ROS with ROS_MASTER_URI=http://127.0.0.1:11311 -... - * register "/ros" xmlrpc "127.0.0.1" 11311 -... -\endverbatim - -To make sure that everything has worked, start a quick test program in one -console: -\verbatim -yarp read /testtopic@/testnode -\endverbatim -Then in another do: -\verbatim -rostopic list # /testtopic should be listed -rosnode list # /testnode should be listed -rostopic pub /testtopic std_msgs/String "Hello YARP" # yarp read should echo this -\endverbatim - - -\section yarp_with_ros_roscore_only Using YARP with roscore only - -If instructed, YARP can use ROSCORE's name server (the "roscore" program) -rather than its own native name server (the "yarpserver" program). -Here's how. First, make sure you have started roscore: -\verbatim -roscore -\endverbatim -Make sure that the ROS_MASTER_URI environment variable is set as roscore -proposes. -Now, place YARP in a new namespace, called for example "/ros" -itself -\verbatim -yarp namespace /ros -\endverbatim -Then ask YARP to detect ROS a nameserver and save its address: -\verbatim -yarp detect --ros --write -\endverbatim -This should report something along the lines of: -\verbatim -Trying ROS_MASTER_URI=http://127.0.0.1:11311... -Reachable. Writing. -Configuration stored. Testing. -Looking for name server on 127.0.0.1, port number 11311 -If there is a long delay, try: - yarp conf --clean -ROS Name server /ros is available at ip 127.0.0.1 port 11311 -\endverbatim - -An alternative procedure is to manually configure YARP to use a ROS -name server with a particular host name or ip address and port number: -\verbatim -yarp conf icubsrv 11311 ros -\endverbatim - -YARP ports should be usable at the point. To test this, you could run: -\verbatim -yarp check -\endverbatim -Or try some of the exercises in \ref note_ports. - -YARP ports should behave as normal. -One caveat: the multicast protocol requires some support from the name -server that ROSCORE does not currently provide. -So don't use multicast if you want to work also -with ROS (or use multiple name servers). - - -\section yarp_with_ros_roscore_added Configuring YARP clients to use two nameservers independently - -YARP has a general ability to use multiple nameservers. The trick is to set up -two namespaces, for example /yarp and /ros: - -\verbatim -yarp namespace /yarp # Make a YARP namespace -yarp detect --write # detect and store contact info for yarpserver -yarp namespace /ros # Make a ROS namespace -yarp detect --ros --write # detect and store contact info for roscore -yarp namespace /yarp /ros # Now select *both* namespaces -# queries / registrations now go to *both* YARP and ROS as needed -\endverbatim - -*/ diff --git a/doc/050_ros/yarp_with_ros_parameters.dox b/doc/050_ros/yarp_with_ros_parameters.dox deleted file mode 100644 index 34d339ce007..00000000000 --- a/doc/050_ros/yarp_with_ros_parameters.dox +++ /dev/null @@ -1,56 +0,0 @@ -/** -\page yarp_with_ros_parameters Talking to the ROS parameter server - - -YARP has no special support for the ROS parameter server, but can -communicate with it via its -[network API](http://wiki.ros.org/ROS/Parameter%20Server%20API). -Here is a command-line example: - -\verbatim -yarp rpc /ros ->>setParam /demo foo 15 -Response: 1 "parameter /foo set" 0 ->>getParam /demo foo -Target disappeared, reconnecting... -Response: 1 "Parameter [/foo]" 15 -\endverbatim - -From code, you could use a Bottle: - -\code - Network yarp; - Contact ros = Network::queryName("/ros"); - printf("ROS available as %s\n", ros.toURI().c_str()); - - // set a parameter called "foo" to 15 - Bottle cmd, reply; - cmd.addString("setParam"); - cmd.addString("/demo"); - cmd.addString("foo"); - cmd.addInt32(15); - Network::write(ros,cmd,reply); - printf("reply to setParam is: %s\n", reply.toString().c_str()); - - // read "foo" back - cmd.clear(); - cmd.addString("getParam"); - cmd.addString("/demo"); - cmd.addString("foo"); - Network::write(ros,cmd,reply); - printf("reply to getParam is: %s\n", reply.toString().c_str()); - printf("Stored value is hopefully %d\n", reply.get(2).asInt32()); - return 0; -\endcode - -This should give: - -\verbatim -ROS available as xmlrpc://127.0.0.1:11311 -reply to setParam is: 1 "parameter /foo set" 0 -reply to getParam is: 1 "Parameter [/foo]" 15 -Stored value is hopefully 15 -\endverbatim - -*/ - diff --git a/doc/050_ros/yarp_with_ros_services.dox b/doc/050_ros/yarp_with_ros_services.dox deleted file mode 100644 index 05e08b6caeb..00000000000 --- a/doc/050_ros/yarp_with_ros_services.dox +++ /dev/null @@ -1,40 +0,0 @@ -/** -\page yarp_with_ros_services Use YARP to talk to ROS services - -Please see "example/ros" in the YARP source code for full examples. -For simple cases, we can just use YARP Bottles whose content matches ROS types -structurally. -For example, to call a ROS service that adds two integers, we could do this: - -\include example/ros/add_int_client_v2.cpp - -An example CMakeLists.txt file to compile this and link with YARP would be: - -~~~{.cmake} -cmake_minimum_required(VERSION 3.16) -find_package(YARP COMPONENTS os REQUIRED) -add_executable(add_int_client_v1) -target_sources(add_int_client_v1 PRIVATE add_int_client_v1.cpp) -target_link_libraries(add_int_client_v1 PRIVATE YARP::YARP_os - YARP::YARP_init) -~~~ - -On the ROS side we'd do: - -~~~{.sh} -rosrun rospy_tutorials add_two_ints_server -~~~ - -Then on the YARP side we can try it out (assume the above program is compiled as -'add_int_client_v1'): - -~~~{.sh} -./add_int_client_v1 4 6 -~~~ -\verbatim -yarp: Port /yarp_add_int_client active at tcp://192.168.1.2:35731 -yarp: Port /add_two_ints+1@/yarp_add_int_client active at tcp://192.168.1.2:35004 -Got 10 -\endverbatim - -*/ diff --git a/doc/050_ros/yarp_with_ros_writing_code_topics.dox b/doc/050_ros/yarp_with_ros_writing_code_topics.dox deleted file mode 100644 index b37207c1ca1..00000000000 --- a/doc/050_ros/yarp_with_ros_writing_code_topics.dox +++ /dev/null @@ -1,141 +0,0 @@ -/** -\page yarp_with_ros_writing_code_topics Writing code to talk to ROS topics - -While you can configure conventional YARP ports to talk to ROS topics (see -\ref yarp_with_ros_existing_yarp_ports), YARP provides specialized classes that -simplify this task: - -\li `yarp::os::Node`: a class to create a ROS node. -\li `yarp::os::Subscriber`: a class to subscribe to a topic. -\li `yarp::os::Publisher`: a class to publish to a topic. - -An important thing to keep in mind is that YARP needs to be aware of ROS types. -If you are writing new code it is easy to generate ROS compatible YARP data -types starting. - -For example the following code shows how to write a program that listen to the -/chatter topic. In this case we use the ROS type std_msgs/String. - -The first thing to do is to generate a YARP compatible type for std_msgs/String: - -~~~{.sh} -$ yarpidl_rosmsg String -~~~ - -This will produce the file `yarp/rosmsg/String.h` which can be used directly -in our YARP program. - -Type the following code in a file, e.g. listener.cpp: - -\include example/ros/listener.cpp - -An example CMakeLists.txt file to compile this code would be: - -~~~{.cpp} - cmake_minimum_required(VERSION 3.16) - find_package(YARP COMPONENTS os REQUIRED) - add_executable(listener) - target_sources(listener PRIVATE listener.cpp) - target_link_libraries(listener PRIVATE YARP::YARP_os - YARP::YARP_init) -~~~ - -You can now publish the string "Hello World" to the topic /chatter using ROS: - -~~~{.sh} -rostopic pub /chatter std_msgs/String "hello yarp" --r 10 -~~~ - -and listen to it using the YARP program above: - -~~~{.sh} -./listener -~~~ -\verbatim -yarp: Port /yarp/listener active at tcp://192.168.152.130:10002 -yarp: Port /chatter-@/yarp/listener active at tcp://192.168.152.130:10003 -yarp: Receiving input from /rostopic_36275_1464212662655 to /chatter-@/yarp/listener using tcpros+role.pub+topic./chatter -Received:hello yarp -Received:hello yarp -Received:hello yarp -... -\endverbatim - -You can verify the existence of a node called /yarp/listener by running: - -~~~{.sh} -rosnode list -~~~ -\verbatim -/rosout -/yarp/listener -\endverbatim - -We can now write our own publisher using YARP. The code is quite simple, type it -in a file, e.g. talker.cpp: - -\include example/ros/talker.cpp - -an example `CMakeLists.txt` file to compile this code would be: - -~~~{.cmake} - cmake_minimum_required(VERSION 3.16) - find_package(YARP COMPONENTS os REQUIRED) - add_executable(talker) - target_sources(talker PRIVATE talker.cpp) - target_link_libraries(talker PRIVATE YARP::YARP_os - YARP::YARP_init) -~~~ - -We can run this code on a terminal: -~~~{.sh} -./talker -~~~ -\verbatim -yarp: Port /yarp/talker active at tcp://192.168.152.130:10004 -yarp: Port /chatter+@/yarp/talker active at tcp://192.168.152.130:10006 -yarp: Sending output from /chatter+@/yarp/talker to /listener using tcpros -yarp: Removing output from /chatter+@/yarp/talker to /listener -\endverbatim - -You can verify the existence of a node called `/yarp/talker` and topic -`/chatter` -by running: - -~~~{.sh} -rosnode list -~~~ -\verbatim -/rosout -/yarp/talker -\endverbatim - -~~~{.sh} -rostopic list -~~~ -\verbatim -/chatter -/rosout -/rosout_agg -\endverbatim - -And see the output using the listener from ros tutorials: - -~~~{.sh} -rosrun roscpp_tutorials listener -~~~ -\verbatim -[ INFO] [1464213813.965287858]: I heard: [Hello from YARP] -[ INFO] [1464213814.066799996]: I heard: [Hello from YARP] -[ INFO] [1464213814.169264100]: I heard: [Hello from YARP] -[ INFO] [1464213814.271588965]: I heard: [Hello from YARP] -[ INFO] [1464213814.373758392]: I heard: [Hello from YARP] -... -\endverbatim - -The following tutorials show how to write your own data type using ROS syntax: - -\li \subpage rostypes_tutorial_portable -\li \subpage rostypes_tutorial_continued - -*/ diff --git a/doc/090_tutorials.dox b/doc/090_tutorials.dox index facbfa5b106..d576a89798c 100644 --- a/doc/090_tutorials.dox +++ b/doc/090_tutorials.dox @@ -31,10 +31,6 @@ Here are a collection of tutorials on various topics in YARP. - \ref yarp_resource_finder_tutorials - \ref yarp_rfmodule_tutorial -\section tutorial_rostypes ROS types in YARP: -- \ref rostypes_tutorial_portable -- \ref rostypes_tutorial_continued - \section tutorial_thrift Using the Thrift IDL to define data types and interfaces: - \ref thrift_tutorial_portable - \ref thrift_tutorial_simple diff --git a/doc/module_carriers/carrier_config.dox b/doc/module_carriers/carrier_config.dox index 2eaf5797a6c..bbabd6e38ba 100644 --- a/doc/module_carriers/carrier_config.dox +++ b/doc/module_carriers/carrier_config.dox @@ -36,8 +36,6 @@ carriers. Optional carriers: \li \ref carrier_config_mpi \li \ref carrier_config_mjpeg -\li \ref carrier_config_xmlrpc -\li \ref carrier_config_tcpros \li \ref carrier_config_bayer @@ -241,57 +239,6 @@ yarp::mjpeg::MjpegDecompression for helper functions. The motivation for disabling automatic decompression is to reduce load for clients that need to read images only occasionally. -\section carrier_config_xmlrpc xmlrpc carrier - -This carrier transmits and receives messages in XMLRPC format. - -\verbatim -yarp connect /src /dest local -\endverbatim - -Messages are automatically converted to and from Bottle-compatible -format. Here is the mapping used: - \li XMLRPC int = Bottle int - \li XMLRPC string = Bottle string - \li XMLRPC double = Bottle double - \li XMLRPC array = Bottle list - \li XMLRPC struct = Bottle list - -Both arrays and structures in XMLRPC are mapped to Bottle lists. -Structures are mapped to a list with the tag "dict" prepended, -followed by sublists with key-value mappings: -\verbatim - (dict (key1 val1) (key2 val2)) -\endverbatim - -The yarp::os::Bottle find/findGroup/check methods will work fine on -such lists, or you could populate a Property object if you want fast -look-up. - -If you want to convert a Bottle list that may start with the -string "dict" or "list", prepend the keyword "list". -\verbatim - (list ...) -\endverbatim -That keyword will be silently consumed, and will guarantee -that an XMLRPC array is produced. - -XMLRPC messages that start with a string may be treated as an -administrative message (and not passed on to the client reading -from a port) if the initial string is one of the following: - \li publisherUpdate - \li requestTopic - \li getPid - \li getBusInfo - -This is for ROS compatibility (see \ref yarp_with_ros). - - -\section carrier_config_tcpros tcpros carrier - -This carrier is for interoperations with ROS. -See \ref yarp_with_ros and http://www.ros.org/wiki/ROS/TCPROS - \section carrier_config_bayer bayer carrier diff --git a/doc/module_executables/cmd_yarpdataplayer.dox b/doc/module_executables/cmd_yarpdataplayer.dox index ab95e9949be..f7f59677662 100644 --- a/doc/module_executables/cmd_yarpdataplayer.dox +++ b/doc/module_executables/cmd_yarpdataplayer.dox @@ -114,16 +114,6 @@ the player will successfully load all required data. The parts name will be taken from each subdirectory of the `/experiment1` forder. -\section yarpdataplayer_ros Topic/ros compatibility - -Yarpdataplayer allows also to reproduce topics which can be subscribed by ROS nodes. -For example, you can record a topic (e.g. /mytopic+@/mynode) as a standard yarp port using the Bottle format provided by yarpdatadumper. The Bottle format is needed because -yarpdatadumper is currently not able to automatically detect the type of the incoming messages. -After the recording, you have to manually edit the info.log file created by yarpdatadumper and replace the type Bottle with the type of the ROS message you want to publish. -For example, if you want to publish a sensor_msgs/LaserScan ROs Message, replace Bottle with sensor_msgs/LaserScan. -That's all. When Yarpdataplayer plays the recorded data, it will open the /mytopic+@/mynode port and will publish LaserScan data. The corresponding topic will be visible also by ROS. - - \note Currently, if the directory selected is (in this example) head, torso etc, the player will not load the files as it will not be able to find subdirs. diff --git a/doc/module_executables/cmd_yarpidl_rosmsg.dox b/doc/module_executables/cmd_yarpidl_rosmsg.dox deleted file mode 100644 index 3f4fc8f2375..00000000000 --- a/doc/module_executables/cmd_yarpidl_rosmsg.dox +++ /dev/null @@ -1,10 +0,0 @@ -/** -\defgroup yarpidl_rosmsg yarpidl_rosmsg: YARP code generator/compiler for ROS IDL - -\ingroup yarp_tools - -\tableofcontents - -\section yarpidl_rosmsg_intro Description - -*/ diff --git a/doc/module_executables/cmd_yarpserver.dox b/doc/module_executables/cmd_yarpserver.dox index 10709a298d0..2f1ac8c8e4f 100644 --- a/doc/module_executables/cmd_yarpserver.dox +++ b/doc/module_executables/cmd_yarpserver.dox @@ -21,7 +21,6 @@ --socket NNNNN Set port number of server. --web dir Serve web resources from given directory. --no-web-cache Reload pages from file for each request. - --ros Delegate pub/sub to ROS name server. \endverbatim This starts a name server running on the current machine, optionally diff --git a/doc/release/master.md b/doc/release/master.md new file mode 100644 index 00000000000..712078c88c1 --- /dev/null +++ b/doc/release/master.md @@ -0,0 +1,29 @@ +YARP 3.10.0 (XXXX-XX-XX) {#v3_10_0} +================== + +[TOC] + +YARP 3.10.0 Release Notes +=================== + +A (partial) list of bug fixed and issues resolved in this release can be found +[here](https://github.com/robotology/yarp/issues?q=label%3A%22Fixed+in%3A+YARP+v3.10.0%22). + +Major Behaviour Changes +--------------------------------- + +* ROS1 support removed from github repo https://github.com/robotology/yarp and moved to legacy repo https://github.com/robotology/yarp-ros + +Deprecations and removals +--------------------------------- +* Removed `xmlrpc` and `tcpros` carriers. +* Removed `yarpidl_rosmsg`. +* Removed library `libYARP_wire_rep_utils`. +* Removed `extern/md5` +* Removed `extern/ros` messages and examples. + +Fixes +----- + +New Features +------------