13 #include "dsr_robot.h" 34 ROS_INFO(
"________ ROBOT STATUS ________");
35 ROS_INFO(
" robot_state : %d", msg->robot_state);
36 ROS_INFO(
" robot_state_str : %s", msg->robot_state_str.c_str());
37 ROS_INFO(
" current_posj : %7.3f %7.3f %7.3f %7.3f %7.3f %7.3f",msg->current_posj[0] ,msg->current_posj[1] ,msg->current_posj[2]
38 ,msg->current_posj[3] ,msg->current_posj[4] ,msg->current_posj[5] );
39 ROS_INFO(
" current_posx : %7.3f %7.3f %7.3f %7.3f %7.3f %7.3f",msg->current_posx[0] ,msg->current_posx[1] ,msg->current_posx[2]
40 ,msg->current_posx[3] ,msg->current_posx[4] ,msg->current_posx[5] );
42 for(
int i = 0; i < 16; i++){
43 temp_data += (std::to_string(msg->ctrlbox_digital_input[i]) +
" ");
45 ROS_INFO(
" ctrlbox_digital_input : %s",
temp_data.c_str());
48 for(
int i = 0; i < 16; i++){
49 temp_data += (std::to_string(msg->ctrlbox_digital_output[i]) +
" ");
51 ROS_INFO(
" ctrlbox_digital_output : %s", temp_data.c_str());
54 for(
int i = 0; i < 6; i++){
55 temp_data += (std::to_string(msg->flange_digital_input[i]) +
" ");
57 ROS_INFO(
" flange_digital_input : %s", temp_data.c_str());
60 for(
int i = 0; i < 6; i++){
61 temp_data += (std::to_string(msg->flange_digital_output[i]) +
" ");
63 ROS_INFO(
" flange_digital_output : %s", temp_data.c_str());
66 for(
int i = 0; i < msg->modbus_state.size(); i++){
67 temp_data += (
"[" + msg->modbus_state[i].modbus_symbol +
" , " + std::to_string(msg->modbus_state[i].modbus_value) +
"] ");
69 ROS_INFO(
" modbus_state : %s", temp_data.c_str());
70 ROS_INFO(
" access_control : %d", msg->access_control);
71 ROS_INFO(
" homming_completed : %d", msg->homming_completed);
72 ROS_INFO(
" tp_initialized : %d", msg->tp_initialized);
73 ROS_INFO(
" joint_speed : %7.3f %7.3f %7.3f %7.3f %7.3f %7.3f",msg->current_velj[0] ,msg->current_velj[1] ,msg->current_velj[2]
74 ,msg->current_velj[3] ,msg->current_velj[4] ,msg->current_velj[5] );
75 ROS_INFO(
" task_speed : %7.3f %7.3f %7.3f %7.3f %7.3f %7.3f",msg->current_velx[0] ,msg->current_velx[1] ,msg->current_velx[2]
76 ,msg->current_velx[3] ,msg->current_velx[4] ,msg->current_velx[5] );
77 ROS_INFO(
" mastering_need : %d", msg->mastering_need);
78 ROS_INFO(
" drl_stopped : %d", msg->drl_stopped);
79 ROS_INFO(
" disconnected : %d", msg->disconnected);
106 dsr_msgs::RobotStop msg;
108 msg.stop_mode = STOP_TYPE_QUICK;
109 pubRobotStop.publish(msg);
114 int main(
int argc,
char** argv)
117 string my_robot_id =
"dsr01";
118 string my_robot_model =
"m1013";
120 ROS_INFO(
"default arguments: dsr01 m1013");
124 ROS_ERROR(
"invalid arguments: <ns> <model> (ex) dsr01 m1013");
127 for (
int i = 1; i < argc; i++){
128 printf(
"argv[%d] = %s\n", i, argv[i]);
130 my_robot_id = argv[1];
131 my_robot_model = argv[2];
146 CDsrRobot robot(nh, my_robot_id, my_robot_model);
152 robot.set_digital_output(2,
true);
153 if(robot.get_digital_input(2) == 1){
154 robot.set_digital_output(11,
true);
162 ROS_INFO(
"dsr_service_test finished !!!!!!!!!!!!!!!!!!!!!");
int main(int argc, char **argv)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void msgRobotState_cb(const dsr_msgs::RobotState::ConstPtr &msg)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ROSCPP_DECL void shutdown()
void SET_ROBOT(string id, string model)
static void thread_subscriber()