Change max velocity of gimbal

Hi,

I’m would like to change gimbal max velocity ? I want to send gimbal position but I don’t want gimbal to go too fast. I would like to know if we can configure CamController with something like DEFAULT, SOFT, AGGRESIVE, DYNAMIC, etc.

Best,
Clément

Hi,

You could directly set the desired position and velocity by selecting POSITION_VELOCITY as ControlMode for AxesCamController.

https://developer.parrot.com/docs/airsdk/messages/messages_list.html?highlight=axisreference#_CPPv4N13CamController8Messages13AxisReference9ctrl_modeE

Best regards,

Matthieu

Thank you for your quick answer @MattMgnParrot.

I didn’t undersand POSITION_VELOCITY was a position command with max_velocity.

Is TrajectoryPoint works the same (Messages list - 7.2) ? x is the position you want to reach, and dx and ddx are the max acceleration and the max velocity ? I thought it was a target point where we want the drone to reach it with the state [x, dx, ddx].

I tryied your suggestion @MattMgnParrot and it seems like it doesn’t work.

Here is the code I use :

            self.output.has_front_cam_reference = True
            fcam_ref = self.output.front_cam_reference
            fcam_ref.yaw.ctrl_mode = cam_cm_pb2.VELOCITY
            fcam_ref.yaw.frame_of_ref = cam_for_pb2.NED
            fcam_ref.yaw.velocity = 0.0
            fcam_ref.pitch.ctrl_mode = cam_cm_pb2.POSITION_VELOCITY
            fcam_ref.pitch.frame_of_ref = cam_for_pb2.NED
            fcam_ref.pitch.position = - math.pi/2
            fcam_ref.pitch.velocity = 0.01
            fcam_ref.roll.ctrl_mode = cam_cm_pb2.POSITION
            fcam_ref.roll.frame_of_ref = cam_for_pb2.NED
            fcam_ref.roll.position = 0.0

Unfortunately, with 0.01 rad/s in pitch.velocity, gimbal reach -90° in few ms …

Any ideas ?

Best,
Clément

Hi,

Did you filter the axis? It is required to take velocity into account. If not, it could be done with:

 def configure(self, msg, disable_oa, override_fcam, override_stereo):
        ...
        self.output.front_cam_config.pitch.filtered = True

Matthieu

An other point: the filtering process takes into account position and velocity but it does not involve to accurately match the given velocity. To precisely reach a velocity value, VELOCITY ctrl_mode should be used.

Hi @MattMgnParrot,

Where can I find the doc about filtered and locked boolean meaning ?

Anyway, I set the filtered to True and the gimbal seems to go more slowly.
Unfortunately, I still don’t understand how the POSITION_VELOCITY works.

I tried 2 different code (starting from -90 and target is pitch = 0°) :

            fcam_ref.pitch.ctrl_mode = cam_cm_pb2.POSITION_VELOCITY
            fcam_ref.pitch.frame_of_ref = cam_for_pb2.NED
            fcam_ref.pitch.position = 0
            fcam_ref.pitch.velocity = 0.0001

Here is the result
0.001

            fcam_ref.pitch.ctrl_mode = cam_cm_pb2.POSITION_VELOCITY
            fcam_ref.pitch.frame_of_ref = cam_for_pb2.NED
            fcam_ref.pitch.position = 0
            fcam_ref.pitch.velocity = 1.0

Here is the result
1

When I set velocity to 1, the gimbal move the same velocity as when I put to 0.001, but now final position isn’t 0° …

I tryied an impossible configuration (from -90° to 0° with a negative velocity) :

            fcam_ref.pitch.ctrl_mode = cam_cm_pb2.POSITION_VELOCITY
            fcam_ref.pitch.frame_of_ref = cam_for_pb2.NED
            fcam_ref.pitch.position = 0
            fcam_ref.pitch.velocity = -1.0

and here is the result :
_1

Do you have an example where POSITION_VELOCITY works ?

Best,
Clément

The position velocity relies on an internal dynamic model that realize state integration (such as drone TrajectoryPoint), so position and velocity must be consistent. Also the given velocity in POSITION_VELOCITY doesn’t represent the maximal value.
If you want to set a maximal velocity, you could set the following parameter while sending a POSITION reference:

def configure(self, msg, disable_oa, override_fcam, override_stereo):
	self.output.has_front_cam_config = True
	...
	self.output.front_cam_config.pitch.max_vel = math.radians(10.0)

Matthieu

Thank you for this max_vel argument. Where is the doc of this argument ?

Moreover, I understand POSITION_VELOCITY doesn’t represent the maximal value, but do you know why in the three examples I sent just above, the position target is 0° and regarding the velocity value, the end position of gimbal is different in the three examples …

Also, where can I find the doc about filtered and locked boolean meaning ?

Best,
Clément

Hello,

The doc is here:

https://developer.parrot.com/docs/airsdk/messages/messages_list.html#_CPPv4N13CamController8Messages10AxisConfigE

(but the generation of the documentation was not handling the comments correctly. It will be fixed in the next release).

Here is the source of the AxisConfig message:

// Axis configuration.
message AxisConfig {
    // Specify if axis reference will be used or discarded.
    oneof optional_locked {
        bool locked = 1;
    }
    // Enable filtering to have a smoother movement.
    oneof optional_filtered {
        bool filtered = 2;
    }
    // The filtering magnitude applied to the axis.
    oneof optional_smoothness {
        float smoothness = 3;
    }
    // The maximum velocity of the axis.
    oneof optional_max_vel {
        float max_vel = 4;
    }
}

Thanks,

1 Like

Thank you @Ronan for the doc of AxisConfig !

I still don’t understand why the three examples of POSITION_VELOCITY don’t reach same 0° target, but at least I know the max_vel parameter, and it was the main question on this issue :slight_smile:

Best,
Clément

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.