Skip to content

Commit

Permalink
do not pass executor id if not in charge yet
Browse files Browse the repository at this point in the history
  • Loading branch information
bdilman committed Jun 18, 2024
1 parent cc78c85 commit 524354c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion px4_ros2_cpp/src/components/mode_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ Result ModeExecutorBase::sendCommandSync(
cmd.param5 = param5;
cmd.param6 = param6;
cmd.param7 = param7;
cmd.source_component = px4_msgs::msg::VehicleCommand::COMPONENT_MODE_EXECUTOR_START + id();
if(!_is_in_charge){
cmd.source_component = px4_msgs::msg::VehicleCommand::COMPONENT_MODE_EXECUTOR_START;
}else{
cmd.source_component = px4_msgs::msg::VehicleCommand::COMPONENT_MODE_EXECUTOR_START + id();
}
cmd.timestamp = _node.get_clock()->now().nanoseconds() / 1000;


Expand Down

0 comments on commit 524354c

Please sign in to comment.