Manual control over mavlink implementation question

Hi,

Perhaps one of the PX4 developers can respond to this. In
MavlinkReceiver::handle_message_manual_control(mavlink_message_t *msg), the throttle position is calculated as rc.values[3] = fminf(fmaxf(man.z / 0.9f + 800, 1000.0f), 2000.0f);

What’s the purpose of the magic numbers to scale and offset the input throttle. Full throttle ends up as 1911 pwm - which would normally be 2000 from a real RC transmitter/receiver? Any reason this can’t be simply mapped 1-2-1 from the mavlink message?

There are 2 ways to use Mavlink MANUAL_CONTROL.
The first is Mavlink MANUAL_CONTROL -> uORB manual_control_setpoint. (PX4 param COM_RC_IN_MODE 1 or 0)
The second is Mavlink MANUAL_CONTROL -> uORB input_rc (fake PWM) -> uORB manual_control_setpoint (PX4 param COM_RC_IN_MODE 2)

Most use the first option which takes gamepad/joystick input and almost directly republishes it as the manual input the controllers use. The other path is like fake RC and goes through the RC calibration path. I’m not sure if we should even keep the 2nd option.

tl;dr - use it this way https://github.com/PX4/Firmware/blob/master/src/modules/mavlink/mavlink_receiver.cpp#L1666

Hi @dagar ,
I would like to publish the manual_control_setpoint msg from FC to Companion Computer via MAVLink. My joystick and FC are connected properly because I can control the flight manually. Joystick messages are transmitted to FC via ESP8266 wifi module connected to TELEM1 port. Telem2 port is used to communicate with Campanion Computer and works properly because I can listen to mavros messages. I have enabled mavlink forwarding for both ports. mavlink_message.cpp shows that FC will post manual_control_setpoint msg to /mavros/manual_control_setpoint/control via MAVLink protocol. but I can’t listen to joystick actually.
The original question is posted here.
Do you have any idea? Could you pleasse give me some suggestions?
Thx a lot.
Ze