I am a beginner in ardupilot projects
I have a question which is about Guided mode(Offboard mode in px4)
this is part of my code that is wroking well with px4 but when I use it with ardupilot it is not working and it remains at its place
I tried to change cordinate frame and type_mask but I didn’t get any resualts.
mavros node is working well cuz I can get data from mavros topics
part of my code:
def construct_target(x, y, z, yaw, yaw_rate = 1): target_raw_pose = PositionTarget() target_raw_pose.header.stamp = rospy.Time.now() target_raw_pose.coordinate_frame = 1 target_raw_pose.position.x = x target_raw_pose.position.y = y target_raw_pose.position.z = z target_raw_pose.type_mask = PositionTarget.IGNORE_VX + PositionTarget.IGNORE_VY + PositionTarget.IGNORE_VZ \ + PositionTarget.IGNORE_AFX + PositionTarget.IGNORE_AFY + PositionTarget.IGNORE_AFZ \ + PositionTarget.FORCE print(target_raw_pose.type_mask) target_raw_pose.yaw = yaw target_raw_pose.yaw_rate = yaw_rate return target_raw_pose local_target_pub = rospy.Publisher('mavros/setpoint_raw/local', PositionTarget, queue_size=10) cur_target_pose = construct_target(0, 0, 3.2, current_heading) while(True): local_target_pub.publish(cur_target_pose) time.sleep(0.1)
and data is published well too:
I publish mavrs.msgs.PositionTarget data to mavros/setpoint_raw/local and this is output of “rostopic echo mavros/setpoint_raw/local” command
keep in your mind same code is working perfectly with px4 in offboard mode but with ardupilot in Guided mode is not working
I’m working with a simulator and not a real copter.
OS : Ubuntu20.4
I hope you guys can help me to solve this weird problem