123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #ifndef __PLC_PROCESS__HH__
- #define __PLC_PROCESS__HH__
- #include <tf/tf.h>
- #include "tf2_msgs/TFMessage.h"
- #include <Eigen/Core>
- #include <Eigen/Dense>
- #include <string>
- #include <boost/foreach.hpp>
- #include <boost/thread.hpp>
- #include <vector>
- #include <math.h>
- #include "PLCModbus.h"
- class PLCProcess
- {
- public:
- PLCProcess();
- ~PLCProcess();
- void Update(std::vector<std::vector<tf::Transform>> trajectorys);
- struct TRAJECTORY
- {
- std::vector<std::vector<tf::Transform>> left_trajectorys_;
- std::vector<std::vector<tf::Transform>> right_trajectorys_;
- bool bUpdate;
- };
- protected:
- bool split_trajectorys(std::vector<std::vector<tf::Transform>> trajectorys);
- bool send_trajectory(std::vector<tf::Transform> trajectory_l,std::vector<tf::Transform> trajectory_r);
- std::vector<uint16_t> absolute_convert_to_relative(std::vector<tf::Transform> tf_data);
- unsigned int get_node_index();
- static void thread_func_process(void *process);
- public:
- struct TRAJECTORY trajectory_;
- plc_modbus::CPLCModbus plc_;
- bool exit_;
- boost::thread* plc_process_thread_;
- boost::mutex mutex_trajectorys_;
- };
- #endif
|