Hi guys,
How do we trace code for beginners? I tried to print messages on system console. But I don’t see anything for mixer.
For example, I added a warnx() or a printf() at the beginning of commander_thread_main() of commander.cpp. I can see the print out on system console during run time.
But the printf() that I added in mix() of mixer_multirotor.cpp doesn’t output anything on console. I am running a quad_x mixer. I guess the mix() function in mixer_multirotor.cpp should be called during run time. Why I don’t see the message I print out? Does mixer code output the debug message to the same console? Please help.
Hi
You can use PX4_WARN()/PX4_ERR() from pretty much everywhere in the code and it will output to the console. It seems that your code in mix() is not called.
bkueng, I didn’t change code other than adding the print out. The code is still the one released.
If I armed the quadcopter and used RC to change throttle (I can see the console displayed take-off detected), the mix() function should be called, right?
I will try PX4_WARN() or PX4_ERR(). But printf() should also work. I really don’t see why it doesn’t work.
I updated mix() function of mixer_multirotor.cpp for a quadcopter I am building. But it does not behave as I expected. I want to debug. How do you guys debug when you develop IO code?
Hopefully one of the devs who has actually done that will answer. One thing you could do is debug on PixRacer, where the mixer runs in the FMU instead of a coprocessor.