Thank you for your help.
I’ve already seen this post and it states that’s a C,C++ portability issue. But I don’t exactly see how the problem can be solved. Would you mind to help me?
Thank you for your fast answer. I’m sorry but I don’t understand what you mean.
In the comment you referenced there is a solution proposed but it results in another compiliation error:
error: incompatible types in assignment of 'int' to 'int8_t [10] {aka signed char [10]}'
dbg.key= 'test';
^
compilation terminated due to -Wfatal-errors.
Thus, at the end the author stribuda asked if anyone might help and nobody replied since then.
Thank your for your help, but it didn’t solve the problem. It ended up in another compilation error:
error: incompatible types in assignment of 'const char [5]' to 'char [10] by using the double quotes.
Although, I found the solution in the px4_mavlink_debug.cpp file. (I think it was intented to link this file in following tutorial, but the link is broken).
So the solution to correctly implement is:
/* advertise named debug value */
struct debug_key_value_s dbg_key;
strncpy(dbg_key.key, "velx", 10);
dbg_key.value = 0.0f;
orb_advert_t pub_dbg_key = orb_advertise(ORB_ID(debug_key_value), &dbg_key);
Like this it works perfectly fine.
It would be nice if someone could update the tutorial (I don’t know how to do that)