mavlink / mavros

MAVLink to ROS gateway with proxy for Ground Control Station
Other
902 stars 993 forks source link

How to use setpoint topics #163

Closed Antgroup-zz closed 9 years ago

Antgroup-zz commented 10 years ago

I have updated my APM2 firmware to ArduCopter 3.2 and now I am able to arm my Copter with "mavsafety arm". But still I don't know how to use the several setpoint topics. For example, I type in: /# rostopic pub /mavros/setpoint/local_position geometry_ms/PoseStamped "header: seq: 0 stamp: secs: 0 nsecs: 0 frame_id: 'fcu' pose: position: x: 0.0 y: 0.0 z: 100.0 orientation: x: 0.0 y: 0.0 z: 0.0 w: 0.0" I can see the topic showing in rostopic echo, but my copter has no respone. I think maybe it is related to the "frame_id" in the header? I've tried "1", "0", and " " but still not work.

Also, I try another one: /# rostopic pub /mavros/setpoint/cmd_vel geometry_msgs/Twist "linear: x: 0.0 y: 0.0 z: 100.0 angular: x: 0.0 y: 0.0 z: 0.0" there is no "header", but then I get the warning massage saying: [WARN] [WallTime: 1415237252.344219] Could not process inbound connection: topic types do not match: [geometry_msgs/TwistStamped] vs. [geometry_msgs/Twist]{'topic': '/mavros/setpoint/cmd_vel', 'tcp_nodelay': '0', 'md5sum': '98d34b0043a2093cf9d9345ab6eef12e', 'type': 'geometry_msgs/TwistStamped', 'callerid': '/mavros'}

Can anybody tell me how to use these setpoint topics :) Thanks a lot!

mhkabir commented 10 years ago

Arducopter doesn't support any setpoint messages as of now. The PX4 native stack on a Pixhawk /PX4 does, and we are pushing more support over time.

You need to add your own code to support these. I think there were people who did it. @tonybaltovski? On Nov 6, 2014 7:23 AM, "Antgroup" notifications@github.com wrote:

I have updated my APM2 firmware to ArduCopter 3.2 and now I am able to arm my Copter with "mavsafety arm". But still I don't know how to use the several setpoint topics. For example, I type in: /# rostopic pub /mavros/setpoint/local_position geometry_ms/PoseStamped "header: seq: 0 stamp: secs: 0 nsecs: 0 frame_id: 'fcu' pose: position: x: 0.0 y: 0.0 z: 100.0 orientation: x: 0.0 y: 0.0 z: 0.0 w: 0.0" I can see the topic showing in rostopic echo, but my copter has no respone. I think maybe it is related to the "frame_id" in the header? I've tried "1", "0", and " " but still not work.

Also, I try another one: /# rostopic pub /mavros/setpoint/cmd_vel geometry_msgs/Twist "linear: x: 0.0 y: 0.0 z: 100.0 angular: x: 0.0 y: 0.0 z: 0.0" there is no "header", but then I get the warning massage saying: [WARN] [WallTime: 1415237252.344219] Could not process inbound connection: topic types do not match: [geometry_msgs/TwistStamped] vs. [geometry_msgs/Twist]{'topic': '/mavros/setpoint/cmd_vel', 'tcp_nodelay': '0', 'md5sum': '98d34b0043a2093cf9d9345ab6eef12e', 'type': 'geometry_msgs/TwistStamped', 'callerid': '/mavros'}

Can anybody tell me how to use these setpoint topics :) Thanks a lot!

— Reply to this email directly or view it on GitHub https://github.com/mavlink/mavros/issues/163.

Antgroup-zz commented 10 years ago

So you mean Pixhawk support the setpoint message? I also have a Pixhawk, but I try it today. Got not any respones yet. So how do I use the setpoint topic with my Pixhawk?

tonybaltovski commented 9 years ago

@mhkabir @Antgroup I use the RC override on the APM. I have tried the setpoints on the Pixhawk and they do work. Unfortunately, I have not got around to testing my Pixhawk with the newer firmware which should of solved my issues.