Closed gawebb-dstl closed 7 years ago
It is firmware side. As i remember only AUTO.MISSION is allowed to set from telemetry.
The same problem exists with trying to change into AUTO.MISSION mode. I can see that I've sent way-points but I'm unable to get it to move to them. The only way I've managed this, is by using QGroundControl to change the mode to AUTO.MISSION after I've sent the waypoints with mavros. It will then goto to the waypoints.
same problem here,i run in gazebo,then i use fallsafe code this
void modeLOITER(ros::NodeHandle& nh)
{
if (current_state.mode != "AUTO.LOITER") {
ros::ServiceClient set_mode_client = nh.serviceClient<mavros_msgs::SetMode>("mavros/set_mode");
mavros_msgs::SetMode offb_set_mode;
offb_set_mode.request.custom_mode = "AUTO.LOITER";
if (set_mode_client.call(offb_set_mode) && offb_set_mode.response.success) {
ROS_INFO("LOITER enabled");
}
}
}
void armAndModeOffboard(ros::NodeHandle& nh)
{
// turn board into offboard mode
if (current_state.mode != "OFFBOARD") {
modeOffBoard(nh);
// last_request = ros::Time::now();
} else {
// check system armd
if (!current_state.armed) {
arm(nh);
// last_request = ros::Time::now();
}
}
}
void fallSafe(ros::NodeHandle& nh)
{
//0.05
if (ros::Time::now() - msg.Data.t > ros::Duration(1.0)) {
modeLOITER(nh);
//msg.sendStatusUseSerial(eular, current_state, pos_status, dis_status);
} else {
armAndModeOffboard(nh);
}
}
all code in https://github.com/feilongfl/Ros-Px4/blob/fallsafebug/src/mavpi/src/offb_node.cpp
but when plan in air,it show me no warning like "no rc ctrl or offboard",but it in auto.rtl mode.
this picture is before change mode,work in offboard
than i change it to AUTO.LOITER,it turn in auto.rtl with no warning!!!and it show me offboard mode,but in gazebo simluator i see it clearly in auto rtl mode
then only landed it turn to auto.loiter
system
ubuntu 16.04
gazebo is in docker use dockerfile https://github.com/feilongfl/px4-dev-simulation
ros Kinetic
I'm closing this since this is Firmware related.
Issue details
I'm unable to switch into the any of the AUTO modes. This is how I'm currently trying:
However when using any of the AUTO modes it will switch to AUTO.RTL. I can successfully change to OFFBOARD using the same code by replacing "AUTO.LOITER" with "OFFBOARD" and after the if statement sending a position with:
I feel like this may just be poor implementation rather than a issue as such. If you need any additional information please let me know. I haven't included the full code as it is over 500 lines long (I can launch, land, etc) Thank you in advance for any feedback or advice
MAVROS version and platform
Mavros: 0.18.5 ROS: Kinetic Ubuntu: 16.04
Autopilot type and version
[ ] ArduPilot [ X ] PX4
Version: ?
Node logs
Diagnostics
Check ID