0001-fixes-1424-reduce-public-link-interface.patch

J. Wienke, 06/21/2013 10:39 AM

Download (17.9 KB)

View differences:

cpp/src/CMakeLists.txt
4 4
SET(HEADERS)
5 5
SET(LIBRARIES ${RSB_LIBRARIES}
6 6
              ${RST_LIBRARIES})
7
# List of libraries to expose in the external link interface
8
SET(INTERFACE_LIBRARIES ${RSB_LIBRARIES}
9
                        ${RST_LIBRARIES})
7 10

  
8 11
# --- converters ---
9 12

  
10 13
SET(PKGCONFIG_REQUIRES)
11 14

  
12
# TODO ALImageConverter
13

  
14 15
# ALImageConverter
15 16
SET_FEATURE_INFO(ALImageConverter "Converter for images received from the humanoid robot NAO using the NAOqi API.")
16 17
IF(ALVISION_FOUND)
......
27 28
    SET_PROPERTY(GLOBAL APPEND PROPERTY ENABLED_FEATURES IplImageConverter)
28 29
    LIST(APPEND SOURCES "rst/converters/opencv/IplImageConverter.cpp")
29 30
    LIST(APPEND HEADERS "rst/converters/opencv/IplImageConverter.h")
31
    LIST(APPEND LIBRARIES ${OpenCV_LIBS})
30 32
ELSE()
31 33
    SET_PROPERTY(GLOBAL APPEND PROPERTY DISABLED_FEATURES IplImageConverter)
32 34
ENDIF()
......
66 68
                        "rst/converters/rci/PoseConverter.cpp"
67 69
                        "rst/converters/rci/PressureConverter.cpp"
68 70
                        "rst/converters/rci/TranslationConverter.cpp"
69
                        "rst/converters/rci/DoublesConverter.cpp"
70
                        )
71
                        "rst/converters/rci/DoublesConverter.cpp")
71 72
    LIST(APPEND HEADERS "rst/converters/rci/JointAnglesConverter.h"
72 73
                        "rst/converters/rci/JointImpedanceConverter.h"
73 74
                        "rst/converters/rci/JointTorquesConverter.h"
......
76 77
                        "rst/converters/rci/PoseConverter.h"
77 78
                        "rst/converters/rci/PressureConverter.h"
78 79
                        "rst/converters/rci/TranslationConverter.h"
79
                        "rst/converters/rci/DoublesConverter.h"
80
                        )
80
                        "rst/converters/rci/DoublesConverter.h")
81 81

  
82 82
    LIST(APPEND LIBRARIES ${RCI_LIBRARIES})
83 83
    LIST(APPEND PKGCONFIG_REQUIRES ", rci0.4")
......
97 97

  
98 98
ADD_LIBRARY(${RST_CONVERTERS_NAME} SHARED ${SOURCES} ${HEADERS})
99 99
TARGET_LINK_LIBRARIES(${RST_CONVERTERS_NAME} ${LIBRARIES})
100
# special hack for the strange opencv library list
101
IF(OpenCV_FOUND)
102
    TARGET_LINK_LIBRARIES(${RST_CONVERTERS_NAME} ${OpenCV_LIBS})
103
ENDIF()
100
# Restrict the link interface to the explicitly specified interface
101
TARGET_LINK_LIBRARIES(${RST_CONVERTERS_NAME} LINK_INTERFACE_LIBRARIES ${INTERFACE_LIBRARIES})
104 102
SET_TARGET_PROPERTIES(${RST_CONVERTERS_NAME}
105 103
                      PROPERTIES
106 104
                      VERSION ${SO_VERSION})
cpp/src/rst/converters/boost/TransformationPoseConverter.cpp
29 29
#include "TransformationPoseConverter.h"
30 30

  
31 31
#include <boost/shared_ptr.hpp>
32
#include <boost/multi_array.hpp>
32 33

  
33 34
#include <rsc/runtime/TypeStringTools.h>
34 35

  
36
typedef ::boost::multi_array<double, 2> DoubleMatrix;
37

  
35 38
#define IS_ZERO(a) (abs(a) < 1e-6)
36 39

  
37 40
using namespace std;
cpp/src/rst/converters/boost/TransformationPoseConverter.h
29 29

  
30 30
#include <string>
31 31

  
32
#include <boost/multi_array.hpp>
33

  
34 32
#include <rsb/converter/Converter.h>
35 33
#include <rsb/converter/ProtocolBufferConverter.h>
36 34

  
......
42 40
namespace converters {
43 41
namespace boost {
44 42

  
45
typedef ::boost::multi_array<double, 2> DoubleMatrix;
46

  
47 43
/**
48 44
 * Converter for 4x4 transformation matrix to PoseMessage type.
49 45
 *
cpp/src/rst/converters/boost/TwoDPoseConverter.cpp
29 29
#include "TwoDPoseConverter.h"
30 30

  
31 31
#include <boost/shared_ptr.hpp>
32
#include <boost/multi_array.hpp>
32 33

  
33 34
#include <rsc/runtime/TypeStringTools.h>
34 35

  
36
typedef ::boost::multi_array<double, 1> DoubleVector;
37

  
35 38
#define IS_NONZERO(a) (a > 0.5)
36 39
#define IS_ZERO(a) (abs(a) < 1e-6)
37 40

  
cpp/src/rst/converters/boost/TwoDPoseConverter.h
29 29

  
30 30
#include <string>
31 31

  
32
#include <boost/multi_array.hpp>
33

  
34 32
#include <rsb/converter/Converter.h>
35 33
#include <rsb/converter/ProtocolBufferConverter.h>
36 34

  
......
42 40
namespace converters {
43 41
namespace boost {
44 42

  
45
typedef ::boost::multi_array<double, 1> DoubleVector;
46

  
47 43
/**
48 44
 * Converter for 3 vector to PoseMessage type.
49 45
 *
cpp/src/rst/converters/naoqi/ALImageConverter.cpp
31 31

  
32 32
#include <rsc/misc/langutils.h>
33 33

  
34
#include <alvisiondefinitions.h>
35
#include <alimage.h>
36

  
34 37
using namespace std;
35 38
using namespace AL;
36 39

  
cpp/src/rst/converters/naoqi/ALImageConverter.h
32 32

  
33 33
#include <rsb/converter/ProtocolBufferConverter.h>
34 34

  
35
#include <alvisiondefinitions.h>
36
#include <alimage.h>
37

  
38 35
#include <rst/vision/Image.pb.h>
39 36

  
40 37
#include "rst/rstconvertersexports.h"
cpp/src/rst/converters/rci/DoublesConverter.cpp
31 31

  
32 32
#include <rst/math/VectorDouble.pb.h>
33 33

  
34
#include <rci/dto/Doubles.h>
35

  
34 36
using namespace std;
35 37
using namespace nemo;
36 38
using namespace rci;
cpp/src/rst/converters/rci/DoublesConverter.h
31 31

  
32 32
#include <rsb/converter/Converter.h>
33 33

  
34
#include <rci/dto/Doubles.h>
35

  
36 34
#include "rst/rstconvertersexports.h"
37 35

  
38 36
namespace rst {
cpp/src/rst/converters/rci/JointAnglesConverter.cpp
31 31

  
32 32
#include <rst/kinematics/JointAngles.pb.h>
33 33

  
34
#include <rci/dto/JointAngles.h>
35

  
34 36
using namespace std;
35 37
using namespace nemo;
36 38
using namespace rci;
cpp/src/rst/converters/rci/JointAnglesConverter.h
31 31

  
32 32
#include <rsb/converter/Converter.h>
33 33

  
34
#include <rci/dto/JointAngles.h>
35

  
36 34
#include "rst/rstconvertersexports.h"
37 35

  
38 36
namespace rst {
cpp/src/rst/converters/rci/JointImpedanceConverter.cpp
31 31

  
32 32
#include <rst/dynamics/JointImpedance.pb.h>
33 33

  
34
#include <rci/dto/JointImpedance.h>
35

  
34 36
using namespace std;
35 37
using namespace nemo;
36 38
using namespace rci;
cpp/src/rst/converters/rci/JointImpedanceConverter.h
31 31

  
32 32
#include <rsb/converter/Converter.h>
33 33

  
34
#include <rci/dto/JointImpedance.h>
35

  
36 34
#include "rst/rstconvertersexports.h"
37 35

  
38 36
namespace rst {
cpp/src/rst/converters/rci/JointTorquesConverter.cpp
31 31

  
32 32
#include <rst/dynamics/JointTorques.pb.h>
33 33

  
34
#include <rci/dto/JointTorques.h>
35

  
34 36
using namespace std;
35 37
using namespace nemo;
36 38
using namespace rci;
cpp/src/rst/converters/rci/JointTorquesConverter.h
31 31

  
32 32
#include <rsb/converter/Converter.h>
33 33

  
34
#include <rci/dto/JointTorques.h>
35

  
36 34
#include "rst/rstconvertersexports.h"
37 35

  
38 36
namespace rst {
cpp/src/rst/converters/rci/LengthConverter.cpp
31 31

  
32 32
#include <rst/geometry/Length.pb.h>
33 33

  
34
#include <rci/dto/Length.h>
35

  
34 36
using namespace std;
35 37
using namespace nemo;
36 38
using namespace rci;
cpp/src/rst/converters/rci/LengthConverter.h
31 31

  
32 32
#include <rsb/converter/Converter.h>
33 33

  
34
#include <rci/dto/Length.h>
35

  
36 34
#include "rst/rstconvertersexports.h"
37 35

  
38 36
namespace rst {
cpp/src/rst/converters/rci/PhaseConverter.cpp
31 31

  
32 32
#include <rst/InstantaneousPhase.pb.h>
33 33

  
34
#include <rci/dto/Phase.h>
35

  
34 36
using namespace std;
35 37
using namespace nemo;
36 38

  
cpp/src/rst/converters/rci/PhaseConverter.h
31 31

  
32 32
#include <rsb/converter/Converter.h>
33 33

  
34
#include <rci/dto/Phase.h>
35

  
36 34
#include "rst/rstconvertersexports.h"
37 35

  
38 36
namespace rst {
cpp/src/rst/converters/rci/PoseConverter.cpp
29 29
#include <rsb/converter/SerializationException.h>
30 30
#include <rsb/converter/ProtocolBufferConverter.h>
31 31

  
32
#include <rci/dto/CartesianPose.h>
33

  
32 34
using namespace std;
33 35
using namespace nemo;
34 36

  
......
36 38
namespace converters {
37 39
namespace rci {
38 40

  
41
void rstToDomain(const rst::geometry::Pose& rst,
42
                 ::rci::Pose& domain) {
43
    domain.setValue(0, rst.translation().x());
44
    domain.setValue(1, rst.translation().y());
45
    domain.setValue(2, rst.translation().z());
46

  
47
    domain.setValue(3, rst.rotation().qw());
48
    domain.setValue(4, rst.rotation().qx());
49
    domain.setValue(5, rst.rotation().qy());
50
    domain.setValue(6, rst.rotation().qz());
51
}
52

  
53
void domainToRST(const ::rci::Pose& domain,
54
                 rst::geometry::Pose& rst) {
55

  
56
    //    1. reserve()
57
    //    2. std::copy(begin, begin+n) // oder memcpy
58
    rst.mutable_translation()->set_x(domain.x());
59
    rst.mutable_translation()->set_y(domain.y());
60
    rst.mutable_translation()->set_z(domain.z());
61

  
62
    rst.mutable_rotation()->set_qw(domain.q0()); // Check semantics
63
    rst.mutable_rotation()->set_qx(domain.q1());
64
    rst.mutable_rotation()->set_qy(domain.q2());
65
    rst.mutable_rotation()->set_qz(domain.q3());
66
}
67

  
39 68
PoseConverter::PoseConverter() :
40 69
        rsb::converter::Converter<string>(
41 70
                rsc::runtime::typeName<rst::geometry::Pose>(),
......
86 115
    return rsb::AnnotatedData(getDataType(), domain);
87 116
}
88 117

  
89
void PoseConverter::rstToDomain(const rst::geometry::Pose& rst,
90
        ::rci::Pose& domain) {
91
    domain.setValue(0, rst.translation().x());
92
    domain.setValue(1, rst.translation().y());
93
    domain.setValue(2, rst.translation().z());
94

  
95
    domain.setValue(3, rst.rotation().qw());
96
    domain.setValue(4, rst.rotation().qx());
97
    domain.setValue(5, rst.rotation().qy());
98
    domain.setValue(6, rst.rotation().qz());
99
}
100

  
101
void PoseConverter::domainToRST(const ::rci::Pose& domain,
102
        rst::geometry::Pose& rst) {
103

  
104
    //    1. reserve()
105
    //    2. std::copy(begin, begin+n) // oder memcpy
106
    rst.mutable_translation()->set_x(domain.x());
107
    rst.mutable_translation()->set_y(domain.y());
108
    rst.mutable_translation()->set_z(domain.z());
109

  
110
    rst.mutable_rotation()->set_qw(domain.q0()); // Check semantics
111
    rst.mutable_rotation()->set_qx(domain.q1());
112
    rst.mutable_rotation()->set_qy(domain.q2());
113
    rst.mutable_rotation()->set_qz(domain.q3());
114
}
115

  
116 118
}
117 119
}
118 120
}
cpp/src/rst/converters/rci/PoseConverter.h
31 31

  
32 32
#include <rsb/converter/Converter.h>
33 33

  
34
#include <rci/dto/CartesianPose.h>
35

  
36 34
#include <rst/geometry/Pose.pb.h>
37 35

  
38 36
#include "rst/rstconvertersexports.h"
......
58 56
    rsb::AnnotatedData deserialize(const std::string &wireType,
59 57
            const std::string &wire);
60 58

  
61
    static void rstToDomain(const rst::geometry::Pose& rst,
62
                            ::rci::Pose&               domain);
63

  
64
    static void domainToRST(const ::rci::Pose&   domain,
65
                            rst::geometry::Pose& rst);
66

  
67 59
private:
68 60

  
69 61
    boost::shared_ptr<rsb::converter::Converter<std::string> > converter;
cpp/src/rst/converters/rci/PressureConverter.cpp
31 31

  
32 32
#include <rst/dynamics/Pressure.pb.h>
33 33

  
34
#include <rci/dto/Pressure.h>
35

  
34 36
using namespace std;
35 37
using namespace nemo;
36 38
using namespace rci;
cpp/src/rst/converters/rci/PressureConverter.h
31 31

  
32 32
#include <rsb/converter/Converter.h>
33 33

  
34
#include <rci/dto/Pressure.h>
35

  
36 34
#include "rst/rstconvertersexports.h"
37 35

  
38 36
namespace rst {
cpp/src/rst/converters/rci/TranslationConverter.cpp
31 31

  
32 32
#include <rst/geometry/Translation.pb.h>
33 33

  
34
#include <rci/dto/CartesianPose.h>
35

  
34 36
using namespace std;
35 37
using namespace nemo;
36 38

  
cpp/src/rst/converters/rci/TranslationConverter.h
31 31

  
32 32
#include <rsb/converter/Converter.h>
33 33

  
34
#include <rci/dto/CartesianPose.h>
35

  
36 34
#include "rst/rstconvertersexports.h"
37 35

  
38 36
namespace rst {
39
-