Commit 833b087c authored by Giuseppe Carboni's avatar Giuseppe Carboni
Browse files

Commented new SRT minor servo files.

Commented pretty much every file. I will perform some more tests with the simulators before tweaking the system to be used with the current Leonardo minor servo system status.
parent 4cbe905d
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -94,27 +94,28 @@ module MinorServo

        /**
         * This method asks the PLC the status for the corresponding servo
         * @throw MinorServoErrors::MinorServoErrorsEx when trying to reset the offsets when they don't match the ones loaded into the hardware
         * @return true if the servo is not in an error state, false otherwise
         */
        boolean status();
        boolean status() raises (MinorServoErrors::MinorServoErrorsEx);

        /**
         * This method commands a STOW operation to the servo
         * @param stow_position the index of the position we want the servo to stow to
         * @throw MinorServo::MinorServoErrorsEx if there has been a communication error or if the command was not accepted
         * @throw MinorServoErrors::MinorServoErrorsEx if there has been a communication error or if the command was not accepted
         */
        void stow(in long stow_position) raises (MinorServoErrors::MinorServoErrorsEx);

        /**
         * This method commands a STOP operation to the servo
         * @throw MinorServo::MinorServoErrorsEx if there has been a communication error or if the command was not accepted
         * @throw MinorServoErrors::MinorServoErrorsEx if there has been a communication error or if the command was not accepted
         */
        void stop() raises (MinorServoErrors::MinorServoErrorsEx);

        /**
         * This method commands a PRESET operation to the servo
         * @param coordinates, a sequence of double
         * @throw MinorServo::MinorServoErrorsEx if the length of the coordinates sequence doesn't match the number of virtual axes of the servo,
         * @throw MinorServoErrors::MinorServoErrorsEx if the length of the coordinates sequence doesn't match the number of virtual axes of the servo,
         *        if the resulting position summing the offsets would go outside the accepted range of the servo,
         *        if there has been a communication error or if the command was not accepted
         */
@@ -130,7 +131,7 @@ module MinorServo
        /**
         * This method calculates the servo coordinates for a given elevation
         * @param elevation the elevation to use for the coordinates calculation, expressed in degrees
         * @throw MinorServoErrors::MinorServoErrorsEx when the servo has not been configured yet and has not loaded any coefficient for the position calculalation
         * @throw MinorServoErrors::MinorServoErrorsEx when the servo has not been configured yet and has not loaded any coefficient for the position calculation
         * @return the calculated coordinates as a sequence of doubles
         */
        ACS::doubleSeq calcCoordinates(in double elevation) raises (MinorServoErrors::MinorServoErrorsEx);
+0 −73
Original line number Diff line number Diff line
#ifndef __SRTMINORSERVOCOMMON_H__
#define __SRTMINORSERVOCOMMON_H__

#include "SuppressWarnings.h"
#include <SRTMinorServoCommonS.h>
#include <boost/bimap.hpp>
#include <boost/assign.hpp>


namespace MinorServo
{
    // The second value of the pair indicates whether the configuration has a ASACTIVE double configuration
    using DiscosConfigurationNameTableType = std::map<std::string, std::pair<MinorServo::SRTMinorServoFocalConfiguration, bool> >;
    const DiscosConfigurationNameTableType DiscosConfigurationNameTable =
    {
        {"LLP",     std::make_pair(MinorServo::CONFIGURATION_PRIMARY,    false)},
        {"PPP",     std::make_pair(MinorServo::CONFIGURATION_PRIMARY,    false)},
        {"PLP",     std::make_pair(MinorServo::CONFIGURATION_PRIMARY,    false)},
        {"HHP",     std::make_pair(MinorServo::CONFIGURATION_PRIMARY,    false)},
        {"XKP",     std::make_pair(MinorServo::CONFIGURATION_PRIMARY,    false)},
        {"CCG",     std::make_pair(MinorServo::CONFIGURATION_GREGORIAN1, true )},
        {"KKG",     std::make_pair(MinorServo::CONFIGURATION_GREGORIAN2, true )},
        {"WWG",     std::make_pair(MinorServo::CONFIGURATION_GREGORIAN3, true )},
        {"QQG",     std::make_pair(MinorServo::CONFIGURATION_GREGORIAN4, true )},
        {"TRI",     std::make_pair(MinorServo::CONFIGURATION_GREGORIAN5, true )},
        {"MISTRAL", std::make_pair(MinorServo::CONFIGURATION_GREGORIAN6, true )},
        {"CCB",     std::make_pair(MinorServo::CONFIGURATION_BWG1,       true )},
        {"XB",      std::make_pair(MinorServo::CONFIGURATION_BWG3,       true )},
    };

    using LDOConfigurationNameTableType = boost::bimap<MinorServo::SRTMinorServoFocalConfiguration, std::string>;
    const LDOConfigurationNameTableType LDOConfigurationNameTable = boost::assign::list_of< LDOConfigurationNameTableType::relation >
        (MinorServo::CONFIGURATION_PRIMARY,     "Primario")
        (MinorServo::CONFIGURATION_GREGORIAN1,  "Gregoriano 1")
        (MinorServo::CONFIGURATION_GREGORIAN2,  "Gregoriano 2")
        (MinorServo::CONFIGURATION_GREGORIAN3,  "Gregoriano 3")
        (MinorServo::CONFIGURATION_GREGORIAN4,  "Gregoriano 4")
        (MinorServo::CONFIGURATION_GREGORIAN5,  "Gregoriano 5")
        (MinorServo::CONFIGURATION_GREGORIAN6,  "Gregoriano 6")
        (MinorServo::CONFIGURATION_GREGORIAN7,  "Gregoriano 7")
        (MinorServo::CONFIGURATION_GREGORIAN8,  "Gregoriano 8")
        (MinorServo::CONFIGURATION_BWG1,        "BWG1")
        (MinorServo::CONFIGURATION_BWG2,        "BWG2")
        (MinorServo::CONFIGURATION_BWG3,        "BWG3")
        (MinorServo::CONFIGURATION_BWG4,        "BWG4");

    using LDOConfigurationIDTableType = boost::bimap<MinorServo::SRTMinorServoFocalConfiguration, unsigned int>;
    const LDOConfigurationIDTableType LDOConfigurationIDTable = boost::assign::list_of< LDOConfigurationIDTableType::relation >
        (MinorServo::CONFIGURATION_UNKNOWN,     0)
        (MinorServo::CONFIGURATION_PRIMARY,     1)
        (MinorServo::CONFIGURATION_GREGORIAN1,  11)
        (MinorServo::CONFIGURATION_GREGORIAN2,  12)
        (MinorServo::CONFIGURATION_GREGORIAN3,  13)
        (MinorServo::CONFIGURATION_GREGORIAN4,  14)
        (MinorServo::CONFIGURATION_GREGORIAN5,  15)
        (MinorServo::CONFIGURATION_GREGORIAN6,  16)
        (MinorServo::CONFIGURATION_GREGORIAN7,  17)
        (MinorServo::CONFIGURATION_GREGORIAN8,  18)
        (MinorServo::CONFIGURATION_BWG1,        21)
        (MinorServo::CONFIGURATION_BWG2,        22)
        (MinorServo::CONFIGURATION_BWG3,        23)
        (MinorServo::CONFIGURATION_BWG4,        24);

    const std::vector<std::string> ServoOrder = 
    {
        "PFP",
        "SRP",
        "GFR",
        "M3R",
    };
}

#endif
+446 −297

File changed.

Preview size limit exceeded, changes collapsed.

+347 −27

File changed.

Preview size limit exceeded, changes collapsed.

+460 −50

File changed.

Preview size limit exceeded, changes collapsed.

Loading