merge conflict fix
This commit is contained in:
parent
5196f7048c
commit
a55662ff3e
|
@ -53,32 +53,19 @@ include_directories(
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
add_executable(xbee_mav src/Xbee.cpp src/XBeeFrame.cpp src/SerialDevice.cpp src/CommunicationManager.cpp)
|
|
||||||
target_link_libraries(xbee_mav ${catkin_LIBRARIES})
|
|
||||||
|
|
||||||
add_executable(config src/main.cpp src/XBeeModule.cpp src/XMLConfigParser.cpp)
|
|
||||||
target_link_libraries(config ${catkin_LIBRARIES})
|
|
||||||
=======
|
|
||||||
add_executable(xbee_mav src/Xbee.cpp src/XBeeFrame.cpp src/SerialDevice.cpp src/CommunicationManager.cpp src/PacketsHandler)
|
add_executable(xbee_mav src/Xbee.cpp src/XBeeFrame.cpp src/SerialDevice.cpp src/CommunicationManager.cpp src/PacketsHandler)
|
||||||
target_link_libraries(xbee_mav ${catkin_LIBRARIES})
|
target_link_libraries(xbee_mav ${catkin_LIBRARIES})
|
||||||
|
|
||||||
#add_executable(config src/main.cpp src/XBeeModule.cpp src/XMLConfigParser.cpp)
|
#add_executable(config src/main.cpp src/XBeeModule.cpp src/XMLConfigParser.cpp)
|
||||||
#target_link_libraries(config ${catkin_LIBRARIES})
|
#target_link_libraries(config ${catkin_LIBRARIES})
|
||||||
>>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1
|
|
||||||
|
|
||||||
#add_executable(test_controller src/TestController.cpp)
|
#add_executable(test_controller src/TestController.cpp)
|
||||||
#target_link_libraries(test_controller ${catkin_LIBRARIES})
|
#target_link_libraries(test_controller ${catkin_LIBRARIES})
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
#add_executable(test_buzz src/TestBuzz.cpp)
|
|
||||||
#target_link_libraries(test_buzz ${catkin_LIBRARIES})
|
|
||||||
=======
|
|
||||||
add_executable(test_buzz src/TestBuzz.cpp)
|
add_executable(test_buzz src/TestBuzz.cpp)
|
||||||
target_link_libraries(test_buzz ${catkin_LIBRARIES})
|
target_link_libraries(test_buzz ${catkin_LIBRARIES})
|
||||||
>>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#############
|
#############
|
||||||
## Install ##
|
## Install ##
|
||||||
|
@ -89,9 +76,4 @@ target_link_libraries(test_buzz ${catkin_LIBRARIES})
|
||||||
#############
|
#############
|
||||||
## Testing ##
|
## Testing ##
|
||||||
#############
|
#############
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1
|
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
/* CommunicationManager.h -- Communication Manager class for XBee:
|
/* CommunicationManager.h -- Communication Manager class for XBee:
|
||||||
Handles all communications with other ROS nodes
|
Handles all communications with other ROS nodes
|
||||||
<<<<<<< HEAD
|
|
||||||
and the serial port -- */
|
|
||||||
=======
|
|
||||||
and the serial port -- */
|
and the serial port -- */
|
||||||
>>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1
|
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
/* September 20, 2016 -- @Copyright Aymen Soussia. All rights reserved. */
|
/* September 20, 2016 -- @Copyright Aymen Soussia. All rights reserved. */
|
||||||
/* (aymen.soussia@gmail.com) */
|
/* (aymen.soussia@gmail.com) */
|
||||||
|
@ -20,18 +16,9 @@
|
||||||
#include<mavros_msgs/Mavlink.h>
|
#include<mavros_msgs/Mavlink.h>
|
||||||
#include <ros/ros.h>
|
#include <ros/ros.h>
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
#include"SerialDevice.h"
|
|
||||||
|
|
||||||
#define MESSAGE_CONSTANT 238
|
|
||||||
#define ACK_MESSAGE_CONSTANT 911
|
|
||||||
#define XBEE_MESSAGE_CONSTANT 586782343
|
|
||||||
#define XBEE_STOP_TRANSMISSION 4355356352
|
|
||||||
=======
|
|
||||||
#include"PacketsHandler.h"
|
#include"PacketsHandler.h"
|
||||||
#include"SerialDevice.h"
|
#include"SerialDevice.h"
|
||||||
|
|
||||||
>>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1
|
|
||||||
|
|
||||||
namespace Mist
|
namespace Mist
|
||||||
{
|
{
|
||||||
|
@ -72,30 +59,14 @@ private:
|
||||||
|
|
||||||
void Run_In_Solo_Mode(DRONE_TYPE drone_type);
|
void Run_In_Solo_Mode(DRONE_TYPE drone_type);
|
||||||
void Run_In_Swarm_Mode();
|
void Run_In_Swarm_Mode();
|
||||||
<<<<<<< HEAD
|
|
||||||
void Generate_Transmit_Request_Frame(
|
|
||||||
const char* const message,
|
|
||||||
std::string* frame,
|
|
||||||
int tot,
|
|
||||||
=======
|
|
||||||
/*void Generate_Transmit_Request_Frame(
|
/*void Generate_Transmit_Request_Frame(
|
||||||
const char* const message,
|
const char* const message,
|
||||||
std::string* frame,
|
std::string* frame,
|
||||||
>>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1
|
|
||||||
const unsigned char frame_ID =
|
const unsigned char frame_ID =
|
||||||
static_cast<unsigned char>(0x01),
|
static_cast<unsigned char>(0x01),
|
||||||
const std::string& destination_adssress = "000000000000FFFF",
|
const std::string& destination_adssress = "000000000000FFFF",
|
||||||
const std::string& short_destination_adress = "FFFF",
|
const std::string& short_destination_adress = "FFFF",
|
||||||
const std::string& broadcast_radius = "00",
|
const std::string& broadcast_radius = "00",
|
||||||
<<<<<<< HEAD
|
|
||||||
const std::string& options = "00");
|
|
||||||
void Check_In_Messages_and_Transfer_To_Topics();
|
|
||||||
void Display_Init_Communication_Failure();
|
|
||||||
void Convert_HEX_To_Bytes(const std::string& HEX_data,
|
|
||||||
std::string* converted_data);
|
|
||||||
void Calculate_and_Append_Checksum(std::string* frame);
|
|
||||||
void Add_Length_and_Start_Delimiter(std::string* frame);
|
|
||||||
=======
|
|
||||||
const std::string& options = "00");*/
|
const std::string& options = "00");*/
|
||||||
//void Check_In_Messages_and_Transfer_To_Topics();
|
//void Check_In_Messages_and_Transfer_To_Topics();
|
||||||
void Display_Init_Communication_Failure();
|
void Display_Init_Communication_Failure();
|
||||||
|
@ -103,7 +74,6 @@ private:
|
||||||
//std::string* converted_data);
|
//std::string* converted_data);
|
||||||
//void Calculate_and_Append_Checksum(std::string* frame);
|
//void Calculate_and_Append_Checksum(std::string* frame);
|
||||||
//void Add_Length_and_Start_Delimiter(std::string* frame);
|
//void Add_Length_and_Start_Delimiter(std::string* frame);
|
||||||
>>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1
|
|
||||||
void Send_Mavlink_Message_Callback(
|
void Send_Mavlink_Message_Callback(
|
||||||
const mavros_msgs::Mavlink::ConstPtr& mavlink_msg);
|
const mavros_msgs::Mavlink::ConstPtr& mavlink_msg);
|
||||||
void Display_Drone_Type_and_Running_Mode(DRONE_TYPE drone_type,
|
void Display_Drone_Type_and_Running_Mode(DRONE_TYPE drone_type,
|
||||||
|
@ -111,12 +81,6 @@ private:
|
||||||
bool Serve_Flight_Controller(mavros_msgs::CommandInt::
|
bool Serve_Flight_Controller(mavros_msgs::CommandInt::
|
||||||
Request& request, mavros_msgs::CommandInt::Response& response);
|
Request& request, mavros_msgs::CommandInt::Response& response);
|
||||||
void Check_In_Messages_and_Transfer_To_Server();
|
void Check_In_Messages_and_Transfer_To_Server();
|
||||||
<<<<<<< HEAD
|
|
||||||
unsigned short Caculate_Checksum(std::string* frame);
|
|
||||||
void Send_multi_msg();
|
|
||||||
Mist::Xbee::SerialDevice serial_device_;
|
|
||||||
Thread_Safe_Deque* in_messages_;
|
|
||||||
=======
|
|
||||||
void Process_In_Standard_Messages();
|
void Process_In_Standard_Messages();
|
||||||
void Process_In_Acks_and_Pings();
|
void Process_In_Acks_and_Pings();
|
||||||
void Process_In_Fragments();
|
void Process_In_Fragments();
|
||||||
|
@ -130,36 +94,12 @@ private:
|
||||||
Thread_Safe_Deque in_Acks_and_Pings_;
|
Thread_Safe_Deque in_Acks_and_Pings_;
|
||||||
Thread_Safe_Deque command_responses_;
|
Thread_Safe_Deque command_responses_;
|
||||||
Thread_Safe_Deque in_packets_;
|
Thread_Safe_Deque in_packets_;
|
||||||
>>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1
|
|
||||||
ros::NodeHandle node_handle_;
|
ros::NodeHandle node_handle_;
|
||||||
ros::Subscriber mavlink_subscriber_;
|
ros::Subscriber mavlink_subscriber_;
|
||||||
ros::Publisher mavlink_publisher_;
|
ros::Publisher mavlink_publisher_;
|
||||||
ros::ServiceClient mav_dji_client_;
|
ros::ServiceClient mav_dji_client_;
|
||||||
ros::ServiceServer mav_dji_server_;
|
ros::ServiceServer mav_dji_server_;
|
||||||
<<<<<<< HEAD
|
|
||||||
/*No of robots*/
|
|
||||||
int no_of_dev;
|
|
||||||
int device_id;
|
|
||||||
/*Vector msgs*/
|
|
||||||
std::map< std::size_t, std::shared_ptr<std::string> > multi_msgs_receive;
|
|
||||||
std::vector<std::string> multi_msgs_send_dict;
|
|
||||||
/*Sending param*/
|
|
||||||
uint16_t sending_chunk_no, Sender_cur_checksum;
|
|
||||||
std::map< uint16_t, uint16_t > ack_received_dict;
|
|
||||||
//std::vector<uint16_t> multi_msgs_send_counter;
|
|
||||||
//std::vector<uint16_t> multi_msgs_sender;
|
|
||||||
/*Receiving param*/
|
|
||||||
uint16_t receiver_cur_checksum;
|
|
||||||
uint16_t counter; //After implementation change this to vector.size()
|
|
||||||
uint16_t receiveing_cur_totalsize;
|
|
||||||
uint16_t steps;
|
|
||||||
//uint16_t multi_msg_size;
|
|
||||||
uint64_t message_obtmulti[600];
|
|
||||||
//int test_1;
|
|
||||||
//struct timeval t1, t2;
|
|
||||||
=======
|
|
||||||
std::shared_ptr<std::thread> service_thread_; // TO DO delete !?
|
std::shared_ptr<std::thread> service_thread_; // TO DO delete !?
|
||||||
>>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -36,11 +36,7 @@ public:
|
||||||
|
|
||||||
|
|
||||||
//****************************************************************************
|
//****************************************************************************
|
||||||
<<<<<<< HEAD
|
|
||||||
void Push_Pack(const _T& new_data)
|
|
||||||
=======
|
|
||||||
void Push_Back(const _T& new_data)
|
void Push_Back(const _T& new_data)
|
||||||
>>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1
|
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> guard(mutex_);
|
std::lock_guard<std::mutex> guard(mutex_);
|
||||||
deque_.push_back(new_data);
|
deque_.push_back(new_data);
|
||||||
|
|
|
@ -25,9 +25,6 @@ namespace Xbee
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
typedef MultithreadingDeque<std::shared_ptr<std::string>> Thread_Safe_Deque;
|
|
||||||
=======
|
|
||||||
struct Out_Packet_S
|
struct Out_Packet_S
|
||||||
{
|
{
|
||||||
uint8_t packet_ID_;
|
uint8_t packet_ID_;
|
||||||
|
@ -36,7 +33,6 @@ struct Out_Packet_S
|
||||||
|
|
||||||
typedef MultithreadingDeque<std::shared_ptr<std::string>> Thread_Safe_Deque;
|
typedef MultithreadingDeque<std::shared_ptr<std::string>> Thread_Safe_Deque;
|
||||||
typedef MultithreadingDeque<Out_Packet_S> Thread_Safe_Deque_Of_Vectors;
|
typedef MultithreadingDeque<Out_Packet_S> Thread_Safe_Deque_Of_Vectors;
|
||||||
>>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1
|
|
||||||
|
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
|
@ -50,9 +46,6 @@ public:
|
||||||
void Send_Frame(const std::string& frame);
|
void Send_Frame(const std::string& frame);
|
||||||
void Run_Service();
|
void Run_Service();
|
||||||
void Stop_Service();
|
void Stop_Service();
|
||||||
<<<<<<< HEAD
|
|
||||||
Thread_Safe_Deque* Get_In_Messages_Pointer();
|
|
||||||
=======
|
|
||||||
void Set_In_Messages_Pointers(Thread_Safe_Deque* in_std_messages,
|
void Set_In_Messages_Pointers(Thread_Safe_Deque* in_std_messages,
|
||||||
Thread_Safe_Deque* in_fragments,
|
Thread_Safe_Deque* in_fragments,
|
||||||
Thread_Safe_Deque* in_Acks_and_Pings,
|
Thread_Safe_Deque* in_Acks_and_Pings,
|
||||||
|
@ -60,7 +53,6 @@ public:
|
||||||
bool Is_IO_Service_Stopped(); // TO DO delete this function
|
bool Is_IO_Service_Stopped(); // TO DO delete this function
|
||||||
void Reset_IO_Service(); // TO DO delete this function
|
void Reset_IO_Service(); // TO DO delete this function
|
||||||
void Close_Serial_Port();
|
void Close_Serial_Port();
|
||||||
>>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -92,14 +84,10 @@ private:
|
||||||
boost::asio::io_service io_service_;
|
boost::asio::io_service io_service_;
|
||||||
boost::asio::serial_port serial_port_;
|
boost::asio::serial_port serial_port_;
|
||||||
std::deque<std::string> out_messages_;
|
std::deque<std::string> out_messages_;
|
||||||
<<<<<<< HEAD
|
|
||||||
Thread_Safe_Deque in_messages_;
|
|
||||||
=======
|
|
||||||
Thread_Safe_Deque* in_std_messages_;
|
Thread_Safe_Deque* in_std_messages_;
|
||||||
Thread_Safe_Deque* in_fragments_;
|
Thread_Safe_Deque* in_fragments_;
|
||||||
Thread_Safe_Deque* in_Acks_and_Pings_;
|
Thread_Safe_Deque* in_Acks_and_Pings_;
|
||||||
Thread_Safe_Deque* command_responses_;
|
Thread_Safe_Deque* command_responses_;
|
||||||
>>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1
|
|
||||||
Mist::Xbee::Frame current_frame_;
|
Mist::Xbee::Frame current_frame_;
|
||||||
unsigned int FRAME_TYPE_KEYS[REMOTE_AT_COMMAND_RESPONSE + 1];
|
unsigned int FRAME_TYPE_KEYS[REMOTE_AT_COMMAND_RESPONSE + 1];
|
||||||
};
|
};
|
||||||
|
|
|
@ -27,11 +27,7 @@ public:
|
||||||
~Frame();
|
~Frame();
|
||||||
|
|
||||||
enum {FRAME_HEADER_LENGTH = 4};
|
enum {FRAME_HEADER_LENGTH = 4};
|
||||||
<<<<<<< HEAD
|
|
||||||
enum {MAX_FRAME_BODY_LENGTH = 280}; // TO DO check value
|
|
||||||
=======
|
|
||||||
enum {MAX_FRAME_BODY_LENGTH = 270}; // TO DO check value
|
enum {MAX_FRAME_BODY_LENGTH = 270}; // TO DO check value
|
||||||
>>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1
|
|
||||||
|
|
||||||
const char* Get_Frame_Data() const;
|
const char* Get_Frame_Data() const;
|
||||||
char* Get_Frame_Data();
|
char* Get_Frame_Data();
|
||||||
|
@ -43,10 +39,7 @@ public:
|
||||||
std::size_t Get_Frame_Type() const;
|
std::size_t Get_Frame_Type() const;
|
||||||
int Get_Start_Delimiter_Position();
|
int Get_Start_Delimiter_Position();
|
||||||
void Rearrange_Corrupted_Header();
|
void Rearrange_Corrupted_Header();
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
char Get_Message_Type(); // TO DO const !?
|
char Get_Message_Type(); // TO DO const !?
|
||||||
>>>>>>> a16cf8b196cb6b63ef52ea26b8cb9a8e861d84d1
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Reference in New Issue