What do you mean by this? 65535 is the “ignore” value, which means that channel doesn’t get updated. Channels set to 65535 in an rc_channels_override message will maintain whatever value was already stored, which can potentially cause issues with other controls.
Thanks for your response and sorry for the delayed answer.
I forgot to mention that when i run the bellow code with 65535 value at line73 all the motors work at full speed. If I use it with 1500 the motions are performed correctly.
All the tests are performed at manual flight mode.
Also, I use the wait commands for arm, disarom, hearbeat (eg. master.motors_armed_wait()).
At one of the posts I saw that when its armed it uses the motions of last commands. Yes that is happening for the first 1 second but after that, it gets the new commands. (when I don’t use 65535)
def set_rc_channel_pwm(channel_id, pwm=1500):
if channel_id < 1 or channel_id > 18:
print("Channel does not exist.")
rc_channel_values = [1500 for _ in range(18)] # 0xffff # 65535
rc_channel_values[channel_id - 1] = pwm
init.master.target_system, # target_system
init.master.target_component, # target_component
*rc_channel_values) # RC channel list, in microseconds.
With this test code, the four horizontal oriented thrusters should work at low speed but all thrusters work at maximum speed.
I didn’t check the beta version solution for the pressure sensor yet. I prefer to try and solve this in stable and in worst case senario I will use the beta one. For now I use this code with 1500 instead of the ignore value 65535.
Your code doesn’t seem to include the explicit stop I mentioned (send 1500 to the 6 movement channels, and 65535 to the rest of the channels) before arming - I would suggest trying that to see if it helps.
You’re also welcome to try the full program example I linked you to, which was definitely working for me when I created it.
That’s not particularly recommended, because (if you have them) it forces connected lights and the camera tilt servo to be set to the middle, and also makes it impossible to command two motion axes concurrently (e.g. if you want to go forwards and sideways, sending a forwards signal tells sideways motion to stop, and sending a sideways signal tells forward motion to stop). The whole idea with the ‘ignore’ value is that it maintains the other commands while you change one of them.
If you don’t have lights or a camera tilt servo, and it’s not important for your vehicle to be able to move in more than one direction at a time, then your proposed workaround should work (i.e. it shouldn’t have any other problematic side-effects), it’s just an odd way of going about things.
I missed the code you sent me so I tried it out and it worked!
So the problem was that I was defining the rc_channel_values as List and not as tuple.
In your example code at send_rc() function you send a tuple with master.mav.rc_channels_override_send . So I changed my code and it works fine (with 65535)
That’s not actually relevant, and can’t be the cause of the issues you were having. The values get unpacked directly into the rc_channels_override_send function call, so whether it’s a list or tuple before the unpacking doesn’t matter (*rc_channel_values means the function gets the values passed in as positional arguments).
Glad you managed to get something working, even if the cause of the original problem still isn’t clear