Commit 202f4812 authored by Marco Bartolini's avatar Marco Bartolini
Browse files

minor bugs and improvements in MedicinaMinorServo

parent a1b2b6b9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@

#include "slamac.h" //for DR2D

#include <AntennaBossProxy.h>
#include <AntennaProxy.h>

#include "MedMinorServoStatus.hpp"
#include "MedMinorServoControl.hpp"
+2 −0
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@ class MedMinorServoOffset
        void clearSystemOffset();
        void clearOffset();
        MedMinorServoPosition getOffsetPosition();
        MedMinorServoPosition getSystemOffsetPosition();
        MedMinorServoPosition getUserOffsetPosition();
        void initialize(bool primary_focus);
    private:
        std::vector<double> _user_offset, _system_offset;
+5 −4
Original line number Diff line number Diff line
@@ -514,12 +514,13 @@ private:
	/** This is the pointer to the notification channel */
	nc::SimpleSupplier *m_nchannel;

    //void loadAntennaBoss() throw (ComponentErrors::CouldntGetComponentExImpl);
    //void unloadAntennaBoss();
    bool isParked() throw (MinorServoErrors::ConfigurationErrorEx);
    
    //void clearOffset(const char *servo, string offset_type) throw (MinorServoErrors::OperationNotPermittedEx);

    /**
     * If not tracking elevation, sets the corerct position according to the
     * actual configuration and actual offsets.
     */
    void setCorrectPosition();
   /** 
    * Set the offset (Implementation)
    *
+2 −1
Original line number Diff line number Diff line
@@ -32,7 +32,8 @@ MSBossTracker::MSBossTracker(
            m_status(params.m_status), 
            m_control(params.m_control),
            m_parameters(params.m_parameters),
            m_offset(params.m_offset)
            m_offset(params.m_offset),
            m_services(params.m_services)
{
    AUTO_TRACE("MSBossTracker::MSBossTracker()");
    m_antennaBoss.setContainerServices(m_services);
+42 −0
Original line number Diff line number Diff line
@@ -109,6 +109,48 @@ MedMinorServoOffset::clearOffset()
    clearSystemOffset();
}

MedMinorServoPosition
MedMinorServoOffset::getSystemOffsetPosition()
{
    MedMinorServoPosition position;
    position.mode = MED_MINOR_SERVO_OFFSET;
    if(!_initialized)
        throw MinorServoOffsetError("Offset has not been initialized");
    boost::recursive_mutex::scoped_lock lock(_offset_guard);
    if(_primary_focus){
        position.y = _system_offset[0];
        position.z = _system_offset[1];
    }else{
        position.x = _system_offset[0];
        position.y = _system_offset[1];
        position.z = _system_offset[2];
        position.theta_x = _system_offset[3];
        position.theta_y = _system_offset[4];
    }
    return position;
}

MedMinorServoPosition
MedMinorServoOffset::getUserOffsetPosition()
{
    MedMinorServoPosition position;
    position.mode = MED_MINOR_SERVO_OFFSET;
    if(!_initialized)
        throw MinorServoOffsetError("Offset has not been initialized");
    boost::recursive_mutex::scoped_lock lock(_offset_guard);
    if(_primary_focus){
        position.y = _user_offset[0];
        position.z = _user_offset[1];
    }else{
        position.x = _user_offset[0];
        position.y = _user_offset[1];
        position.z = _user_offset[2];
        position.theta_x = _user_offset[3];
        position.theta_y = _user_offset[4];
    }
    return position;
}

MedMinorServoPosition
MedMinorServoOffset::getOffsetPosition()
{
Loading