-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rover hold/loiter #13767
Rover hold/loiter #13767
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,10 +99,11 @@ class RoverPositionControl : public ModuleBase<RoverPositionControl>, public Mod | |
void run() override; | ||
|
||
private: | ||
uORB::Publication<position_controller_status_s> _pos_ctrl_status_pub{ORB_ID(position_controller_status)}; | ||
uORB::Publication<actuator_controls_s> _actuator_controls_pub{ORB_ID(actuator_controls_0)}; | ||
|
||
int _control_mode_sub{-1}; /**< control mode subscription */ | ||
uORB::Publication<position_controller_status_s> _pos_ctrl_status_pub{ORB_ID(position_controller_status)}; /**< navigation capabilities publication */ | ||
uORB::Publication<actuator_controls_s> _actuator_controls_pub{ORB_ID(actuator_controls_0)}; /**< actuator controls publication */ | ||
|
||
int _control_mode_sub{-1}; /**< control mode subscription */ | ||
int _global_pos_sub{-1}; | ||
int _local_pos_sub{-1}; | ||
int _manual_control_sub{-1}; /**< notification of manual control updates */ | ||
|
@@ -113,15 +114,15 @@ class RoverPositionControl : public ModuleBase<RoverPositionControl>, public Mod | |
|
||
uORB::Subscription _parameter_update_sub{ORB_ID(parameter_update)}; | ||
|
||
manual_control_setpoint_s _manual{}; /**< r/c channel data */ | ||
manual_control_setpoint_s _manual{}; /**< r/c channel data */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unnecessary indentation changes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. White spaces are still not addressed |
||
position_setpoint_triplet_s _pos_sp_triplet{}; /**< triplet of mission items */ | ||
vehicle_attitude_setpoint_s _att_sp{}; /**< attitude setpoint > */ | ||
vehicle_control_mode_s _control_mode{}; /**< control mode */ | ||
vehicle_global_position_s _global_pos{}; /**< global vehicle position */ | ||
vehicle_local_position_s _local_pos{}; /**< global vehicle position */ | ||
actuator_controls_s _act_controls{}; /**< direct control of actuators */ | ||
vehicle_attitude_s _vehicle_att{}; | ||
sensor_combined_s _sensor_combined{}; | ||
actuator_controls_s _act_controls{}; /**< direct control of actuators */ | ||
vehicle_attitude_s _vehicle_att{}; | ||
sensor_combined_s _sensor_combined{}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. White spaces are still not addressed |
||
|
||
SubscriptionData<vehicle_acceleration_s> _vehicle_acceleration_sub{ORB_ID(vehicle_acceleration)}; | ||
|
||
|
@@ -138,13 +139,20 @@ class RoverPositionControl : public ModuleBase<RoverPositionControl>, public Mod | |
|
||
ECL_L1_Pos_Controller _gnd_control; | ||
|
||
bool _waypoint_reached{false}; | ||
|
||
enum UGV_POSCTRL_MODE { | ||
UGV_POSCTRL_MODE_AUTO, | ||
UGV_POSCTRL_MODE_OTHER | ||
} _control_mode_current{UGV_POSCTRL_MODE_OTHER}; ///< used to check the mode in the last control loop iteration. Use to check if the last iteration was in the same mode. | ||
|
||
|
||
enum POS_CTRLSTATES { | ||
GOTO_WAYPOINT, | ||
STOPPING | ||
} _pos_ctrl_state {STOPPING}; /// Position control state machine | ||
|
||
/* previous waypoint */ | ||
matrix::Vector2f _prev_wp{0.0f, 0.0f}; | ||
|
||
DEFINE_PARAMETERS( | ||
(ParamFloat<px4::params::GND_L1_PERIOD>) _param_l1_period, | ||
(ParamFloat<px4::params::GND_L1_DAMPING>) _param_l1_damping, | ||
|
@@ -165,7 +173,8 @@ class RoverPositionControl : public ModuleBase<RoverPositionControl>, public Mod | |
(ParamFloat<px4::params::GND_THR_CRUISE>) _param_throttle_cruise, | ||
|
||
(ParamFloat<px4::params::GND_WHEEL_BASE>) _param_wheel_base, | ||
(ParamFloat<px4::params::GND_MAX_ANG>) _param_max_turn_angle | ||
(ParamFloat<px4::params::GND_MAX_ANG>) _param_max_turn_angle, | ||
(ParamFloat<px4::params::NAV_LOITER_RAD>) _param_nav_loiter_rad /**< loiter radius for Rover */ | ||
) | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can use just local_position (
fds[4]
) and removefds[0]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is local position also available if only using GPS?