def callback(data):
    """
    If there's a request for an individual thruster to be moved (handy for debug), we receive it and
    handle it.
    """
    if data.executor.lower() == "individual_thruster_control":
        msg = arbitrary_pca_commands()

        msg.set_thruster = True
        msg.set_channel_pwm = False
        msg.set_channel_pwm_send_count = False

        msg.thruster = data.string
        msg.pwm = data.float
        publisher.publish(msg)

    if data.executor.lower() == "kill_thruster":
        msg = arbitrary_pca_commands()

        msg.kill_thruster = True
        msg.thruster = data.string
        publisher.publish(msg)

    if data.executor.lower() == "unkill_thruster":
        msg = arbitrary_pca_commands()

        msg.unkill_thruster = True
        msg.thruster = data.string
        publisher.publish(msg)
Example #2
0
def callback(data):
    """
    Is this the stepper we've been told to deal with? If so, deal with it here.
    """
    if data.executor.lower() == Name.lower():
        msg = arbitrary_pca_commands()

        msg.set_thruster = False
        msg.set_channel_pwm = False
        msg.set_channel_pwm_send_count = True

        msg.channel = Channel
        msg.count = data.int32
        publisher.publish(msg)
Example #3
0
    You should have received a copy of the GNU General Public License
    along with Enbarr.  If not, see <https://www.gnu.org/licenses/>.

"""

import rospy
import argparse
from auv.msg import arbitrary_pca_commands

publisher = rospy.Publisher('arbitrary_pca_commands',
                            arbitrary_pca_commands,
                            queue_size=3)
rospy.init_node('pca_stepper', anonymous=True)

parser = argparse.ArgumentParser(
    "Send a thruster un-kill command over the /surface_command topic.")
parser.add_argument('channel',
                    type=int,
                    help='The name of the thruster to be used here.')
parser.add_argument('steps',
                    type=int,
                    help='The number of rising edges to spit out here.')
args = parser.parse_args(rospy.myargv()[1:])

command = arbitrary_pca_commands()
command.set_channel_pwm_send_count = True
command.channel = args.channel
command.count = args.steps

publisher.publish(command)