GUIDED Mode trajectory controller

Hey everyone, I am quite new to the ardupilot community. I have worked on the development of trajectory controllers on multirotor using Arducopter. This time I wanted to build one for fixed-wing UAVs. In Guided mode, I am only able to update waypoints using simple goto command. To make the controller more flexible I wanted to build an attitude controller in which I can feed yaw headings to fixed-wing UAV. If I use the vehicle.message_factory.set_attitude_target_encode function it is showing undesired behaviours. Just wanted to confirm I feed yaw angles to this function is the roll and pitch calculated accordingly?

this autotest should help you understand what can be done with the existing code:

and read this code:

Thanks, Tridge, I was able to use the set attitude function. But I am not able to use the waypoint update function, it is showing error is coordinate frame. I don’t know what error is there while I am sending my command.
def send_waypoint(self,lat,lon,altitude):
0b110111111000,int(lat * 1.0e7),
int(lon* 1.0e7),altitude

Can you please spot the error, I tried looking in various examples but there is not a direct implementation.

you need to use MAV_FRAME_GLOBAL_RELATIVE_ALT_INT instead of MAV_FRAME_GLOBAL_RELATIVE_ALT. The altitude then needs to be in centimetres.