mirror of
https://gitlab.com/obbart/universal_robots_ros_driver.git
synced 2026-04-10 18:10:47 +02:00
added shell consumer
This commit is contained in:
@@ -68,6 +68,7 @@ include_directories(
|
|||||||
|
|
||||||
add_library(ur_rtde_driver
|
add_library(ur_rtde_driver
|
||||||
src/comm/tcp_socket.cpp
|
src/comm/tcp_socket.cpp
|
||||||
|
src/comm/shell_consumer.cpp
|
||||||
#src/ros/service_stopper.cpp
|
#src/ros/service_stopper.cpp
|
||||||
#src/ur/commander.cpp
|
#src/ur/commander.cpp
|
||||||
#src/ur/master_board.cpp
|
#src/ur/master_board.cpp
|
||||||
|
|||||||
52
include/ur_rtde_driver/comm/shell_consumer.h
Normal file
52
include/ur_rtde_driver/comm/shell_consumer.h
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
// this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
|
// -- BEGIN LICENSE BLOCK ----------------------------------------------
|
||||||
|
// -- END LICENSE BLOCK ------------------------------------------------
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
/*!\file
|
||||||
|
*
|
||||||
|
* \author Felix Mauch mauch@fzi.de
|
||||||
|
* \date 2019-04-09
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
#ifndef UR_RTDE_DRIVER_SHELL_CONSUMER_H_INCLUDED
|
||||||
|
#define UR_RTDE_DRIVER_SHELL_CONSUMER_H_INCLUDED
|
||||||
|
|
||||||
|
#include "ur_rtde_driver/comm/pipeline.h"
|
||||||
|
#include "ur_rtde_driver/comm/package.h"
|
||||||
|
|
||||||
|
namespace ur_driver
|
||||||
|
{
|
||||||
|
namespace comm
|
||||||
|
{
|
||||||
|
template <typename HeaderT>
|
||||||
|
class ShellConsumer : public IConsumer<URPackage<HeaderT>>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ShellConsumer() = default;
|
||||||
|
virtual ~ShellConsumer() = default;
|
||||||
|
|
||||||
|
virtual void setupConsumer()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
virtual void teardownConsumer()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
virtual void stopConsumer()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
virtual void onTimeout()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual bool consume(std::shared_ptr<URPackage<HeaderT>> product);
|
||||||
|
|
||||||
|
private:
|
||||||
|
/* data */
|
||||||
|
};
|
||||||
|
} // namespace comm
|
||||||
|
} // namespace ur_driver
|
||||||
|
#endif // ifndef UR_RTDE_DRIVER_SHELL_CONSUMER_H_INCLUDED
|
||||||
29
src/comm/shell_consumer.cpp
Normal file
29
src/comm/shell_consumer.cpp
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
// this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
|
// -- BEGIN LICENSE BLOCK ----------------------------------------------
|
||||||
|
// -- END LICENSE BLOCK ------------------------------------------------
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
/*!\file
|
||||||
|
*
|
||||||
|
* \author Felix Mauch mauch@fzi.de
|
||||||
|
* \date 2019-04-09
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
#include "ur_rtde_driver/comm/shell_consumer.h"
|
||||||
|
|
||||||
|
namespace ur_driver
|
||||||
|
{
|
||||||
|
namespace comm
|
||||||
|
{
|
||||||
|
template <typename HeaderT>
|
||||||
|
bool ShellConsumer<HeaderT>::consume(std::shared_ptr<URPackage<HeaderT>> pkg)
|
||||||
|
{
|
||||||
|
LOG_INFO("%s", pkg->toString());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} // namespace comm
|
||||||
|
|
||||||
|
} // namespace ur_driver
|
||||||
Reference in New Issue
Block a user