Sorry, maybe my English is not very well…
The situation is as follows :
At first, variable pitch multicoptor needs more parameters to adjust the pitch. In addition, we should add parameters about the thrust. It’s like that
The first question is where should I add the function for changing parameters ? I don’t think the way we change the code is very well.
The test is as follows, could you help to find the problem ? It must be wrong somewhere.
- We add the sentences in the function cycle() in file 'fmu.cpp’
It works well. Then we think the function is running in a thread
2.Then we add functions about changing the parameters, while the parameters have been registered.
However, it works not very well.
We make a summary about it :
When we read the parameters from qground, we can sure, the function ‘update_pwm_param_eno()’ is excuted. In this function, It works like the follow sentences:
However, when we change the parameters from the qground, the pwm output can’t changed by the parameters.
3.We test the function mixer_tick() in file ‘mixer.cpp’ which is associated with px4io, find that the pwm output is controlled in this function. Why the function ‘up_pwm_servo_set()’ in ‘fmu.cpp’ CAN’T WORK? It seems running at the same time.
What makes me coufused is that, when we change the Parameter USE_SYS_IO to 0 and restart, it works, because when I changed the parameters, the output changed. At the same time, the qground CAN’T RECEIVE the mavlink message…
I fall into disorder …