Skip to content

Commit

Permalink
added log/extra cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
randaz81 committed Feb 5, 2024
1 parent 4cf10f8 commit 6d2f382
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 12 deletions.
10 changes: 9 additions & 1 deletion doc/release/master.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Deprecations and removals
* Removed library `libYARP_wire_rep_utils`.
* Removed `extern/md5`
* Removed `extern/ros` messages and examples.
* The syntax yarpdev --device xxx --subdevice yyy has been deprecated. See discussion: https://github.com/robotology/yarp/discussions/3078

Fixes
-----
Expand All @@ -31,4 +32,11 @@ Fixes
New Features
------------

* Added new command line tool `yarpDeviceParamParserGenerator`. See official yarp documentation (cmd_yarpDeviceParamParserGenerator.dox)
* Added new command line tool `yarpDeviceParamParserGenerator`. See official yarp documentation (cmd_yarpDeviceParamParserGenerator.dox)

### Devices

#### deviceBundler

* Added new device `deviceBundler` which can be useful to open two devices and attach them while using a single yarpdev command line.
See https://github.com/robotology/yarp/discussions/3078
10 changes: 5 additions & 5 deletions src/devices/deviceBundler/DeviceBundler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ bool DeviceBundler::open(yarp::os::Searchable& config)
ret = m_pdev_wrapper.open(config_wrap);
if (!ret || !m_pdev_wrapper.isValid())
{
yCError(DEVICEBUNDLER, "Unable to open device:%s", m_wrapper_device);
yCError(DEVICEBUNDLER, "Unable to open device:%s", m_wrapper_device.c_str());
return false;
}

Expand All @@ -49,7 +49,7 @@ bool DeviceBundler::open(yarp::os::Searchable& config)
ret = m_pdev_subdevice.open(config_sub);
if (!ret || !m_pdev_subdevice.isValid())
{
yCError(DEVICEBUNDLER, "Unable to open subdevice:%s", m_attached_device);
yCError(DEVICEBUNDLER, "Unable to open subdevice:%s", m_attached_device.c_str());
return false;
}

Expand All @@ -63,18 +63,18 @@ bool DeviceBundler::open(yarp::os::Searchable& config)
ret = m_pdev_wrapper.view(m_iWrapper);
if (!ret)
{
yCError(DEVICEBUNDLER, "Unable to open iWrapper interface. Maybe %s is not a wrapper device?", m_wrapper_device);
yCError(DEVICEBUNDLER, "Unable to open iWrapper interface. Maybe %s is not a wrapper device?", m_wrapper_device.c_str());
return false;
}

ret = m_iWrapper->attach(&m_pdev_subdevice);
if (!ret)
{
yCError(DEVICEBUNDLER, "Unable to attach the two devices: %s and %s", m_wrapper_device, m_attached_device);
yCError(DEVICEBUNDLER, "Unable to attach the two devices: %s and %s", m_wrapper_device.c_str(), m_attached_device.c_str());
return false;
}

yCDebug(DEVICEBUNDLER, "Attach operation between %s and %s completed.", m_wrapper_device, m_attached_device);
yCDebug(DEVICEBUNDLER, "Attach operation between %s and %s completed.", m_wrapper_device.c_str(), m_attached_device.c_str());
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/devices/deviceBundler/DeviceBundler.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define YARP_DEVICEBUNDLER_H

#include <yarp/dev/DeviceDriver.h>
#include <yarp/dev/Polydriver.h>
#include <yarp/dev/PolyDriver.h>
#include <yarp/dev/IWrapper.h>
#include "DeviceBundler_ParamsParser.h"

Expand Down
2 changes: 1 addition & 1 deletion src/devices/deviceBundler/DeviceBundler_ParamsParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ bool DeviceBundler_ParamsParser::parseParams(const yarp::os::Searchable & c
//Check for --help option
if (config.check("help"))
{
yCInfo(DeviceBundlerParamsCOMPONENT) << getDocumentationOfDeviceParams();
yCInfo(DeviceBundlerParamsCOMPONENT) << getDocumentationOfDeviceParams();
}

std::string config_string = config.toString();
Expand Down
2 changes: 1 addition & 1 deletion src/devices/deviceBundler/DeviceBundler_params.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
|:----------:|:---------------:|:------:|:-----:|:--------------:|:--------:|:---------------------------------------------------------------------:|:-----------------------------------------------------:|
| | wrapper_device | string | - | device_name1 | Yes | Name of the wrapper device | This device must derive from yarp::dev::IWrapper |
| | attached_device | string | - | device_name2 | Yes | Name of the subdevice that will be attached to the wrapper device | |
| | doNotAttach | bool | - | false | No | If set to true, the two devices are opened, but not attached | It should not be used, except for debugging purposes |
| | doNotAttach | bool | - | false | No | If set to true, the two devices are opened, but not attached | It should not be used, except for debugging purposes |
3 changes: 0 additions & 3 deletions src/devices/map2DStorage/map2DStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@
* |:--------------:|:--------------:|:-------:|:--------------:|:----------------:|:-----------: |:-----------------------------------------------------------------:|:-----:|
* | name | - | string | - | /mapServer/rpc | No | Full name of the rpc port opened by the Map2DServer device. | |
* | mapCollection | - | string | - | - | No | The name of .ini file containing a map collection. | |
* \section Notes:
* Integration with ROS map server is currently under development.
*/

class Map2DStorage :
Expand Down
13 changes: 13 additions & 0 deletions src/libYARP_dev/src/yarp/dev/Drivers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,19 @@ int Drivers::yarpdev(int argc, char *argv[]) {
return 0;
}

//The following syntax is deprecated: generate an error!
if (options.check("device") && options.check("subdevice"))
{
std::string dev_name = options.find("device").asString();
std::string subdev_name = options.find("subdevice").asString();
yCError(DRIVERS, "The syntax:");
yCError(DRIVERS, "yarpdev --device %s --subdevice %s", dev_name.c_str(), subdev_name.c_str());
yCError(DRIVERS, "has been deprecated.");
yCError(DRIVERS, "Use the following command line instead:");
yCError(DRIVERS, "yarpdev --device deviceBundler --wrapper_device %s --attached_device %s", dev_name.c_str(), subdev_name.c_str());
return 0;
}

//yarpdev enables the wrapping mechanism, which is not enabled by default if,
//for example a device is opened from the code, using PolyDriver.open()
//When enabled, it asks for a wrapped, remotable device rather than raw device
Expand Down

0 comments on commit 6d2f382

Please sign in to comment.