# Activate InputHold using pymavlink

**URL:** <https://discuss.bluerobotics.com/t/activate-inputhold-using-pymavlink/7616>\
**Category:** Blue Robotics Software\
**Tags:** ardusub\
**Created:** [June 23, 2020, 4:13pm UTC](https://discuss.bluerobotics.com/t/activate-inputhold-using-pymavlink/7616 "2020-06-23T16:13:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudheeshk](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@sudheeshk](https://discuss.bluerobotics.com/u/sudheeshk)\
**Post date:** [June 23, 2020, 4:13pm UTC](https://discuss.bluerobotics.com/t/activate-inputhold-using-pymavlink/7616/1 "2020-06-23T16:13:45Z")

</div>

Hi  
I was trying to activate InputHold using pymavlink  
Can anyone help me?

---

<div class="post-metadata">

**Author:** ![patrickelectric](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/patrickelectric/32/2162_2.png) [@patrickelectric](https://discuss.bluerobotics.com/u/patrickelectric)\
**Post date:** [June 23, 2020, 4:24pm UTC](https://discuss.bluerobotics.com/t/activate-inputhold-using-pymavlink/7616/2 "2020-06-23T16:24:17Z")

</div>

Hi @sudheeshk,

Check out [pymavlink examples](https://www.ardusub.com/developers/pymavlink.html#Change%20flight%20mode), there is **Change flight modes** that is exactly what you are looking for.

---

<div class="post-metadata">

**Author:** ![sudheeshk](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@sudheeshk](https://discuss.bluerobotics.com/u/sudheeshk)\
**Post date:** [June 23, 2020, 5:27pm UTC](https://discuss.bluerobotics.com/t/activate-inputhold-using-pymavlink/7616/3 "2020-06-23T17:27:33Z")

</div>

Hi patrick  
I got an error as follows  
_(‘Try:’, [‘STABILIZE’, ‘POSHOLD’, ‘AUTO’, ‘GUIDED’, ‘MANUAL’, ‘SURFACE’, ‘ALT\_HOLD’, ‘CIRCLE’, ‘ACRO’])_ when i give mode as “InputHold”

---

<div class="post-metadata">

**Author:** ![patrickelectric](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/patrickelectric/32/2162_2.png) [@patrickelectric](https://discuss.bluerobotics.com/u/patrickelectric)\
**Post date:** [June 23, 2020, 5:41pm UTC](https://discuss.bluerobotics.com/t/activate-inputhold-using-pymavlink/7616/4 "2020-06-23T17:41:54Z")

</div>

Hi @sudheeshk,

Sorry, I misinterpreted your question!  
Input hold happens when you press the joystick button assigned as _input\_hold\_set_.  
For that, you’ll need to check **Send Manual Control** example and select the correct button for the _input\_hold_ and values for the [X,Y,Z,R fields](https://mavlink.io/en/messages/common.html#MANUAL_CONTROL).  
If you want to control the vehicle attitude, you can use [set\_attitude\_target](https://mavlink.io/en/messages/common.html#SET_ATTITUDE_TARGET) while in altitude hold.

---

<div class="post-metadata">

**Author:** ![sudheeshk](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@sudheeshk](https://discuss.bluerobotics.com/u/sudheeshk)\
**Post date:** [June 23, 2020, 5:47pm UTC](https://discuss.bluerobotics.com/t/activate-inputhold-using-pymavlink/7616/5 "2020-06-23T17:47:48Z")

</div>

Thanks for your response Patrick . I was thinking about a simple method.  
can we set this mode directly by using _named\_value\_float\_send()_ pymavlink function?

---

<div class="post-metadata">

**Author:** ![ggttkl](https://avatars.discourse-cdn.com/v4/letter/g/ce73a5/32.png) [@ggttkl](https://discuss.bluerobotics.com/u/ggttkl)\
**Post date:** [March 20, 2023, 6:21am UTC](https://discuss.bluerobotics.com/t/activate-inputhold-using-pymavlink/7616/6 "2023-03-20T06:21:39Z")

</div>

Hi Patrick  
How can I set a continuous control input by manual control using master.mav.manual\_control\_send()?  
It seems that if I directly set a target value of x,y,z,r, the system only has an impulse response.  
If I use input hold like this  
master.mav.manual\_control\_send(  
master.target\_system,  
0,  
0,  
500,  
200-cnt,  
1\<\<2),  
the change of yaw motion is not continuous, and the input hold is reported set/disabled in turn.  
Looking forward to your response.  
Regards
