Skip to content

Manual control of camera servo gimbal #19

@GoogleCodeExporter

Description

@GoogleCodeExporter
For controlling the tilt/roll (or tilt/pan) of a servo gimbal via RC channel(s)

ot sure if this is already handled in the beta versions/forks, but I have found 
this works well, with or with out cam stabiisation:

In config.h
    #define SERVO_TILT   // Existing code
    #define CAM_TILT_CHAN AUX4  // Select RC channel to control gimbal tilt
    #define CAM_ROLL_CHAN YAW  // Select RC channel to control gimbal roll

In Output.cpp
  #if defined(SERVO_TILT)  // Existing code
    servo[0] = get_middle(0);  
    servo[1] = get_middle(1);
    if (rcOptions[BOXCAMSTAB]) {
      servo[0] += ((int32_t)conf.servoConf[0].rate * att.angle[PITCH]) /50L;
      servo[1] += ((int32_t)conf.servoConf[1].rate * att.angle[ROLL])  /50L;
    }
    // Direct camera tilt/pan, additive - new code
#ifdef CAM_PITCH_CHAN
    servo[0] += constrain(rcData[CAM_PITCH_CHAN],900,2100)-MIDRC;
#endif
#ifdef CAM_ROLL_CHAN
    servo[1] += constrain(rcData[CAM_ROLL_CHAN],900,2100)-MIDRC;
#endif

Original issue reported on code.google.com by [email protected] on 8 Feb 2015 at 8:03

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions