Open SchaeferB1 opened 5 years ago
@vooon @TSC21 I'd really appreciate your expertise in this matter, if possible. Thank you!
@YCH188 stop spamming the issues list please. Create your own issue of you want to ask questions, but only after you empty the other options, which is asking your questions on the appropriate forums.
I am having a big problem. I have created a new issue. Can somebody help me please? #1248
@SchaeferB1 I'm trying to do something very similar to what you described. However, I can't seem to get the setpoint_position/local message through to the pixhawk. The topic updates correctly, but I'm not seeing the corresponding message in Mavlink Inspector. Did you ever run into any problems like this?
There are a couple things that need to happen when using setpoint position local. some of the things that I struggled with when learning mavros were:
Here are some good tutorials using mavros for local navigation with some example code. https://github.com/Intelligent-Quads/iq_tutorials
these are also some good reads https://github.com/mavlink/mavros/issues/906
Issue details
Hello Everyone, I am attempting to control a quadcopter‘s position using a camera to move to a target using the difference between the current location of the drone and the centroid of a target. To do this, I am using the current position from
~local_position/pose
, and subtracting a value from the current position that would then be published to~setpoint_position/local
.The problem is the position value from
~local_position/pose
resets to approximately (0,0,0) in (x,y,z) when running the script every time, making the~local_position/pose
values reset. After running the script once, the position from~local_position/pose
seems to no longer be in the same frame. When publishing to the~setpoint_position/local
topic, coordinates are published in a coordinate frame with an origin centered at the location of where the flight controller was booted. Although both topics use the ENU coordinate frame, the origin of the~local_position/pose
position is changed every time the script is run. Is there any possible way to get local position data that does not reset every time a new script is run? The posted script replaces the camera data that would be used in lines 146-147 with fixed constant values for testing. When the script is run, the drone moves to (5m,5m,3m) and lands. When the script is run again, it takes off and remains in the same (x,y) position. Other posts suggest changing the apm_config.yaml. Does changing the frame of~setpoint_position/local
in this configuration file change the frame that the input values are converted to?Code
MAVROS version and platform
Mavros: ?0.18.4? Version of Mavros was built into an image for the Navio2 Flight Controller. I believe this is the version of Mavros we are using: https://docs.emlid.com/navio2/common/ardupilot/configuring-raspberry-pi/. ROS: Kinetic Raspbian: GNU/Linux 9
Autopilot type and version
[ X ] ArduPilot [ ] PX4
Version: 3.5
Node logs
Diagnostics
Check ID