|
14 | 14 |
|
15 | 15 | int main(int argc, char** argv) |
16 | 16 | { |
17 | | - ros::init(argc, argv, "slave_count_check"); |
18 | | - ros::NodeHandle nh; |
| 17 | + ros::init(argc, argv, "slave_count_check"); |
| 18 | + ros::NodeHandle nh; |
19 | 19 |
|
20 | | - ROS_INFO("Trying to start EtherCAT"); |
21 | | - std::string ifname = "enp2s0"; |
| 20 | + ROS_INFO("Trying to start EtherCAT"); |
| 21 | + std::string ifname = "enp2s0"; |
22 | 22 |
|
23 | | - // Initialise SOEM, bind socket to ifname |
24 | | - if (!ec_init(&ifname[0])) |
25 | | - { |
26 | | - ROS_FATAL("No socket connection on %s. Confirm that you have selected the right ifname", ifname.c_str()); |
27 | | - nh.setParam("/check/slave_count", 0); |
28 | | - return 1; |
29 | | - } |
30 | | - ROS_INFO("ec_init on %s succeeded", ifname.c_str()); |
| 23 | + // Initialise SOEM, bind socket to ifname |
| 24 | + if (!ec_init(&ifname[0])) |
| 25 | + { |
| 26 | + ROS_FATAL("No socket connection on %s. Confirm that you have selected the right ifname", ifname.c_str()); |
| 27 | + nh.setParam("/check/slave_count", 0); |
| 28 | + return 1; |
| 29 | + } |
| 30 | + ROS_INFO("ec_init on %s succeeded", ifname.c_str()); |
31 | 31 |
|
32 | | - // Find and auto-config slaves |
33 | | - if (ec_config_init(FALSE) <= 0) |
34 | | - { |
35 | | - ROS_FATAL("No slaves found, shutting down. Confirm that you have selected the right ifname."); |
36 | | - ROS_FATAL("Check that the first slave is connected properly"); |
37 | | - nh.setParam("/check/slave_count", 0); |
38 | | - return 1; |
39 | | - } |
40 | | - ROS_INFO("%d slave(s) found and initialized.", ec_slavecount); |
| 32 | + // Find and auto-config slaves |
| 33 | + if (ec_config_init(FALSE) <= 0) |
| 34 | + { |
| 35 | + ROS_FATAL("No slaves found, shutting down. Confirm that you have selected the right ifname."); |
| 36 | + ROS_FATAL("Check that the first slave is connected properly"); |
| 37 | + nh.setParam("/check/slave_count", 0); |
| 38 | + return 1; |
| 39 | + } |
| 40 | + ROS_INFO("%d slave(s) found and initialized.", ec_slavecount); |
41 | 41 |
|
42 | | - nh.setParam("/check/slave_count", ec_slavecount); |
43 | | - return 0; |
| 42 | + nh.setParam("/check/slave_count", ec_slavecount); |
| 43 | + return 0; |
44 | 44 | } |
0 commit comments