MCPcopy Create free account
hub / github.com/Robotics-STAR-Lab/SOAR / Interface

Method Interface

src/simulator/test_interface/src/test_interface_node.cpp:22–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20};
21
22Interface::Interface() {
23 pub =
24 nh.advertise<quadrotor_msgs::PositionCommand>("/planning/pos_cmd_1", 10);
25 pub2 =
26 nh.advertise<quadrotor_msgs::PositionCommand>("/planning/pos_cmd_2", 10);
27 sub = nh.subscribe<geometry_msgs::PoseStamped>(
28 "/quadrotor_1_pos_cmd", 10, &Interface::messageCallback, this);
29 /// move_base_simple/goal
30 sub2 = nh.subscribe<geometry_msgs::PoseStamped>(
31 "/quadrotor_2_pos_cmd", 10, &Interface::messageCallback2, this);
32
33 _n_seq = 0;
34
35 /* kP */
36 // double pos_gain[3] = { 5.7, 5.7, 6.2 };
37 // double vel_gain[3] = { 3.4, 3.4, 4.0 };
38
39 double pos_gain[3] = {7, 7, 6.2};
40 double vel_gain[3] = {4, 4, 4.0};
41
42 /* control parameter */
43 cmd.kx[0] = pos_gain[0];
44 cmd.kx[1] = pos_gain[1];
45 cmd.kx[2] = pos_gain[2];
46
47 cmd.kv[0] = vel_gain[0];
48 cmd.kv[1] = vel_gain[1];
49 cmd.kv[2] = vel_gain[2];
50
51 /* control parameter */
52 cmd2.kx[0] = pos_gain[0];
53 cmd2.kx[1] = pos_gain[1];
54 cmd2.kx[2] = pos_gain[2];
55
56 cmd2.kv[0] = vel_gain[0];
57 cmd2.kv[1] = vel_gain[1];
58 cmd2.kv[2] = vel_gain[2];
59
60 ros::spin();
61}
62
63void Interface::messageCallback(const geometry_msgs::PoseStampedConstPtr &msg) {
64 // header

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected