Skip to content
This repository was archived by the owner on Feb 21, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,30 @@ macro(list_subdirectories2 retval curdir return_relative)
set(${retval} ${list_of_dirs})
endmacro()

# MACRO to add the list of subdirectories to another list
macro(list_subdirectories3 retval curdir return_relative)
file(GLOB sub-dir RELATIVE ${curdir} *)
set(list_of_dirs ${${retval}})
foreach(dir ${sub-dir})
if(IS_DIRECTORY ${curdir}/${dir})
if (${return_relative})
list (FIND list_of_dirs "${dir}" _index)
if (NOT ${_index} GREATER -1)
if (NOT ${dir} MATCHES "CMakeFiles" AND NOT ${dir} MATCHES ".svn")
set(list_of_dirs ${list_of_dirs} ${dir})
endif()
endif()
else()
list (FIND list_of_dirs "${curdir}/${dir}" _index)
if (NOT ${_index} GREATER -1)
set(list_of_dirs ${list_of_dirs} ${curdir}/${dir})
endif()
endif()
endif()
endforeach()
set(${retval} ${list_of_dirs})
endmacro()



###################
Expand Down
12 changes: 12 additions & 0 deletions Deps/python/Modules/yaml/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set(module "yaml")

usePython(2)
find_python_module(${module} REQUIRED)

string(TOUPPER ${module} module_upper)

if(PY_${module_upper})
SET (yaml_PY_MODULES PY_${module_upper})
list(APPEND DEPS python-yaml)
list(APPEND DEPS_DEV python-yaml)
endif(PY_${module_upper})
9 changes: 9 additions & 0 deletions Deps/yaml-cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
find_package(yaml-cpp)

if (YAML_CPP_INCLUDE_DIR)
message("***YAML-CPP FOUND: ${YAML_CPP_INCLUDE_DIR}")
list(APPEND DEPS libyaml-cpp0.5v5)
list(APPEND DEPS_DEV libyaml-cpp-dev)
else()
message ("*** YAML-CPP NOT FOUND")
endIF()
18 changes: 14 additions & 4 deletions cmake/cpack_metainfo/libs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,24 @@ SET(CPACK_COMPONENT_COLORSPACES_DESCRIPTION
"Library for
Home page https://jderobot.org")

SET(CPACK_DEBIAN_COMM_PACKAGE_DEPENDS "jderobot-types, jderobot-logger, jderobot-interfaces, jderobot-colorspaces, jderobot-setup")
SET(CPACK_DEBIAN_CONFIG_PACKAGE_DEPENDS "jderobot-setup")
SET(CPACK_COMPONENT_CONFIG_DESCRIPTION
"Library for read Yaml config files
Home page https://jderobot.org")

SET(CPACK_DEBIAN_CONFIG-PYTHON_PACKAGE_DEPENDS "jderobot-setup")
SET(CPACK_COMPONENT_CONFIG-PYTHON_DESCRIPTION
"Library for read Yaml config files
Home page https://jderobot.org")

SET(CPACK_DEBIAN_COMM_PACKAGE_DEPENDS "jderobot-types, jderobot-config, jderobot-logger, jderobot-interfaces, jderobot-colorspaces, jderobot-setup")
SET(CPACK_COMPONENT_COMM_DESCRIPTION
"Library for
"Library for communications. You can use ROS or ICE
Home page https://jderobot.org")

SET(CPACK_DEBIAN_COMM-PYTHON_PACKAGE_DEPENDS "jderobot-types-python, jderobot-setup")
SET(CPACK_DEBIAN_COMM-PYTHON_PACKAGE_DEPENDS "jderobot-types-python,jderobot-config-python, jderobot-setup")
SET(CPACK_COMPONENT_COMM-PYTHON_DESCRIPTION
"Library for
"Library for communications. You can use ROS or ICE
Home page https://jderobot.org")
SET(CPACK_DEBIAN_COMM-PYTHON_PACKAGE_CONTROL_EXTRA
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/ice/postinst"
Expand Down
6 changes: 3 additions & 3 deletions cmake/cpack_metainfo/tools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SET(CPACK_COMPONENT_COLORTUNER-PYTHON_DESCRIPTION
Manual page http://jderobot.org/index.php/Tools#ColorTuner_.28Python.29
Home page https://jderobot.org")

SET(CPACK_DEBIAN_CAMERAVIEW_PACKAGE_DEPENDS "jderobot-easyice, jderobot-comm, jderobot-util, jderobot-interfaces, jderobot-resourcelocator, jderobot-colorspaces")
SET(CPACK_DEBIAN_CAMERAVIEW_PACKAGE_DEPENDS "jderobot-config, jderobot-comm, jderobot-util, jderobot-interfaces, jderobot-resourcelocator, jderobot-colorspaces")
SET(CPACK_COMPONENT_CAMERAVIEW_DESCRIPTION
"Generic viewer for cameras
Manual Page http://jderobot.org/index.php/Tools#CameraView
Expand All @@ -34,7 +34,7 @@ SET(CPACK_COMPONENT_GIRAFFECLIENT_DESCRIPTION
Manual Page
Home page https://jderobot.org")

SET(CPACK_DEBIAN_KOBUKIVIEWER_PACKAGE_DEPENDS "jderobot-easyice, jderobot-comm")
SET(CPACK_DEBIAN_KOBUKIVIEWER_PACKAGE_DEPENDS "jderobot-config, jderobot-comm")
SET(CPACK_COMPONENT_KOBUKIVIEWER_DESCRIPTION
"Teleoperator for vehicle-type robots, such as kobuki, pioneer, cars, etc.
Manual page http://jderobot.org/index.php/Tools#KobukiViewer
Expand All @@ -46,7 +46,7 @@ SET(CPACK_COMPONENT_NAMINGSERVICE_DESCRIPTION
Manual Page
Home page https://jderobot.org")

SET(CPACK_DEBIAN_PANTILTTELEOP-PYTHON_PACKAGE_DEPENDS "python-matplotlib, python-pyqt5, python-pip, python-numpy, python-pyqt5.qtsvg, jderobot-parallelice-python, jderobot-easyice-python")
SET(CPACK_DEBIAN_PANTILTTELEOP-PYTHON_PACKAGE_DEPENDS "python-matplotlib, python-pyqt5, python-pip, python-numpy, python-pyqt5.qtsvg, jderobot-comm-python, jderobot-config-python")
SET(CPACK_COMPONENT_PANTILTTELEOP-PYTHON_DESCRIPTION
"Teleoperator for IP cameras that allow movement (i.e. Sony EVI camera)
Manual Page http://jderobot.org/index.php/Tools#NavigatorCamera
Expand Down
3 changes: 2 additions & 1 deletion src/libs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
list_subdirectories( LIST_LIBS ${CMAKE_CURRENT_SOURCE_DIR} 1)
set (LIST_LIBS "config_cpp") #Adding library to be processed first
list_subdirectories3( LIST_LIBS ${CMAKE_CURRENT_SOURCE_DIR} 1)

FOREACH (lib ${LIST_LIBS})
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${lib}/CMakeLists.txt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ELSE()
SET(JDEROBOTCOM_ROS OFF)
endif()

project(jderobotcomm)
project(comm)

usePython(2)

Expand All @@ -28,10 +28,12 @@ include_directories(
${catkin_INCLUDE_DIRS}
${roscpp_INCLUDE_DIRS}
${INTERFACES_CPP_DIR}
${config_INCLUDE_DIRS}
)


set(HEADERS
include/jderobot/comm/communicator.hpp
include/jderobot/comm/laserClient.hpp
include/jderobot/comm/interfaces/laserClient.hpp
include/jderobot/comm/ice/laserIceClient.hpp
Expand All @@ -48,6 +50,7 @@ set(HEADERS
)

set(SOURCES
src/communicator.cpp
src/laserClient.cpp
src/ice/laserIceClient.cpp
src/cameraClient.cpp
Expand Down Expand Up @@ -83,12 +86,15 @@ ENDIF()
## Adding shared library for common usage
add_library(${PROJECT_NAME} SHARED ${SOURCES} ${HEADERS})

add_dependencies(${PROJECT_NAME} ${config_LIBRARIES})

target_link_libraries(${PROJECT_NAME}
${ZeroCIce_LIBRARIES}
logger
${Boost_LIBRARIES}
colorspacesmm
${catkin_LIBRARIES})
${catkin_LIBRARIES}
${config_LIBRARIES})

## Adding static library for single .so configurations
# since target is a shared library, -fPIC must be provided
Expand All @@ -100,7 +106,8 @@ target_link_libraries(${PROJECT_NAME}-embedded
${Boost_LIBRARIES}
colorspacesmm
JderobotInterfaces
${catkin_LIBRARIES})
${catkin_LIBRARIES}
${config_LIBRARIES})
set_property(TARGET ${PROJECT_NAME}-embedded PROPERTY POSITION_INDEPENDENT_CODE 1)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@

#include <jderobot/types/image.h>
#include <Ice/Communicator.h>
#include <Ice/Properties.h>
#include <jderobot/comm/communicator.hpp>
#include <jderobot/comm/interfaces/cameraClient.hpp>





namespace JdeRobotComm {
namespace Comm {

/**
* @brief make a CameraClient using propierties
Expand All @@ -41,7 +41,7 @@ namespace JdeRobotComm {
*
* @return null if propierties are wrong
*/
CameraClient* getCameraClient(Ice::CommunicatorPtr ic, std::string prefix);
CameraClient* getCameraClient(Comm::Communicator* jdrc, std::string prefix);


} //NS
Expand Down
47 changes: 47 additions & 0 deletions src/libs/comm_cpp/include/jderobot/comm/communicator.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright (C) 1997-2017 JDE Developers Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
* Authors :
* Aitor Martinez Fernandez <aitor.martinez.fernandez@gmail.com>
*/

#ifndef JDEROBOTCOMM_COMMUNICATOR_H
#define JDEROBOTCOMM_COMMUNICATOR_H

#include <Ice/Communicator.h>
#include <Ice/Initialize.h>
#include <jderobot/config/properties.hpp>


namespace Comm {

class Communicator {
public:
Communicator(Config::Properties config);
~Communicator();

Config::Properties getConfig();
Ice::CommunicatorPtr getIceComm();


private:
Config::Properties config;
Ice::CommunicatorPtr ic;
};


} //NS

#endif // JDEROBOTCOMM_COMMUNICATOR_H
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@
#include <jderobot/camera.h>
#include <cv.h>
#include <logger/Logger.h>
#include <jderobotutil/utils/CameraUtils.h>
#include <jderobot/types/image.h>
#include <jderobot/comm/communicator.hpp>
#include <jderobot/comm/interfaces/cameraClient.hpp>
#include <zlib.h>

namespace JdeRobotComm {
namespace Comm {

class CameraIceClient: public IceUtil::Thread, public JdeRobotComm::CameraClient {
class CameraIceClient: public IceUtil::Thread, public Comm::CameraClient {
public:
CameraIceClient(Ice::CommunicatorPtr ic, std::string prefix);
CameraIceClient(Comm::Communicator* jdrc, std::string prefix);
virtual ~CameraIceClient();
virtual void run();

Expand Down Expand Up @@ -69,5 +71,5 @@ class CameraIceClient: public IceUtil::Thread, public JdeRobotComm::CameraClient

};

} /* namespace JdeRobotComm */
} /* namespace Comm */
#endif /* JDEROBOTCOMM_CAMERAICECLIENT_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@
#include <fstream>
#include <logger/Logger.h>
#include <jderobot/types/laserData.h>
#include <jderobot/comm/communicator.hpp>
#include <jderobot/comm/interfaces/laserClient.hpp>

namespace JdeRobotComm {
namespace Comm {


class LaserIceClient: public IceUtil::Thread, public JdeRobotComm::LaserClient {
class LaserIceClient: public IceUtil::Thread, public Comm::LaserClient {
public:
LaserIceClient(Ice::CommunicatorPtr ic, std::string prefix);
LaserIceClient(Comm::Communicator* jdrc, std::string prefix);
virtual ~LaserIceClient();
virtual void run();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@
#include <Ice/Ice.h>
#include <jderobot/motors.h>
#include <jderobot/types/cmdvel.h>
#include <jderobot/comm/communicator.hpp>
#include <jderobot/comm/interfaces/motorsClient.hpp>

namespace JdeRobotComm {
namespace Comm {


class MotorsIceClient: public JdeRobotComm::MotorsClient {
class MotorsIceClient: public Comm::MotorsClient {
public:
MotorsIceClient(Ice::CommunicatorPtr ic, std::string prefix);
MotorsIceClient(Comm::Communicator* jdrc, std::string prefix);
virtual ~MotorsIceClient();

virtual void sendVelocities(JdeRobotTypes::CMDVel vel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@
#include <math.h>
#include <vector>
#include <jderobot/types/pose3d.h>
#include <jderobot/comm/communicator.hpp>
#include <jderobot/comm/interfaces/pose3dClient.hpp>

namespace JdeRobotComm {
namespace Comm {


class Pose3dIceClient: public IceUtil::Thread, public JdeRobotComm::Pose3dClient {
class Pose3dIceClient: public IceUtil::Thread, public Comm::Pose3dClient {
public:
Pose3dIceClient(Ice::CommunicatorPtr ic, std::string prefix);
Pose3dIceClient(Comm::Communicator* jdrc, std::string prefix);
virtual ~Pose3dIceClient();
virtual void run();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <jderobot/types/image.h>


namespace JdeRobotComm {
namespace Comm {

/**
* @brief LaserClient class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <jderobot/types/laserData.h>


namespace JdeRobotComm {
namespace Comm {

/**
* @brief LaserClient class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <jderobot/types/cmdvel.h>


namespace JdeRobotComm {
namespace Comm {

/**
* @brief MotorsClient class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <jderobot/types/pose3d.h>


namespace JdeRobotComm {
namespace Comm {

/**
* @brief Pose3dClient class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@

#include <jderobot/types/laserData.h>
#include <Ice/Communicator.h>
#include <Ice/Properties.h>
#include <jderobot/comm/communicator.hpp>
#include <jderobot/comm/interfaces/laserClient.hpp>




namespace JdeRobotComm {
namespace Comm {

/**
* @brief make a LaserClient using propierties
Expand All @@ -40,7 +40,7 @@ namespace JdeRobotComm {
*
* @return null if propierties are wrong
*/
LaserClient* getLaserClient(Ice::CommunicatorPtr ic, std::string prefix);
LaserClient* getLaserClient(Comm::Communicator* jdrc, std::string prefix);


} //NS
Expand Down
Loading