Control Node - GarethG/ProjectRinzler GitHub Wiki

The control node is a large beast. It is designed to handle the PID for the heading, depth and pitch. In order to do this the node needs to be run with three separate names with the mode declared in the call. The node depends on the heading and pitch from the compass and the depth from the SVP as well as target headings, pitches and depths from high level software. The node has been written with P PD PI and PID software. #Heading Mode ##Services The heading mode depends on the following services.

ros::Subscriber sub1 = pidN.subscribe("compassHeading", 100, headingCallback);
ros::Subscriber sub2 = pidN.subscribe("pilotHeading", 100, targetHeadingCallback);
ros::Publisher leftRateMsg = pidN.advertise<std_msgs::Float32>("leftRate", 100);
ros::Publisher rightRateMsg = pidN.advertise<std_msgs::Float32>("rightRate", 100);
std_msgs::Float32 leftRate;
std_msgs::Float32 rightRate;
rosrun control pid heading __name:heading
ros::Subscriber sub1 = pidN.subscribe("svpDepth", 100, depthCallback);
ros::Subscriber sub2 = pidN.subscribe("pilotDepth", 100, targetDepthCallback););
ros::Publisher frontRateMsg = pidN.advertise<std_msgs::Float32>("frontRate", 100);
ros::Publisher backDRateMsg = pidN.advertise<std_msgs::Float32>("backDRate", 100);
std_msgs::Float32 frontRate;
std_msgs::Float32 backDRate;
rosrun control pid depth __name:depth
ros::Subscriber sub1 = pidN.subscribe("compassPitch", 100, pitchCallback);
ros::Subscriber sub2 = pidN.subscribe("pilotPitch", 100, targetPitchCallback);
ros::Publisher backPRateMsg = pidN.advertise<std_msgs::Float32>("backPRate", 100);
std_msgs::Float32 backPRate;
rosrun control pid pitch __name:pitch

#Issues This software is mostly untested. Also currently heading, depth and pitch share #defines. Not a good idea. Also the correct error code should only really be used for the heading.. #Review Status The control node is pending review. #Further Work Fix bugs.