Hi, I have a problem using the mavros2 to control the ardupilot. I can only see the values coming from the ardupilot but cannot change flight mode (guided). Arming/disarming doesn’t work too.
I found some suggestions and updated them in the mission planner.
- update SR2_**
- set SYSID_THISMAV as the same as target system_id
Could anybody help me out?
I uploaded my param file here copter_.param (17.4 KB)
xx@xx-desktop:~/mavros_ws$ ros2 service call /mavros/set_mode mavros_msgs/srv/SetMode "{base_mode: 0, custom_mode: 4}"
/opt/ros/foxy/bin/ros2:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import load_entry_point
requester: making request: mavros_msgs.srv.SetMode_Request(base_mode=0, custom_mode='4')
response:
mavros_msgs.srv.SetMode_Response(mode_sent=True)
xx@xx-desktop:~/mavros_ws$ ros2 service call /mavros/cmd/arming mavros_msgs/srv/CommandBool "value: False"
/opt/ros/foxy/bin/ros2:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import load_entry_point
requester: making request: mavros_msgs.srv.CommandBool_Request(value=False)
response:
mavros_msgs.srv.CommandBool_Response(success=False, result=0)
xx@xx-desktop:~/ardupilot$ ros2 topic echo /diagnostics
/opt/ros/foxy/bin/ros2:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import load_entry_point
header:
stamp:
sec: 1722931245
nanosec: 463626517
frame_id: ''
status:
- level: "\0"
name: 'mavros_router: MAVROS Router'
message: ok
hardware_id: none
values:
- key: Endpoints
value: '2'
- key: Messages routed
value: '13477'
- key: Messages sent
value: '13477'
- key: Messages dropped
value: '0'
- level: "\0"
name: 'mavros_router: endpoint 1000: /dev/ttyTHS0:115200'
message: ok
hardware_id: none
values:
- key: Received packets
value: '13301'
- key: Dropped packets
value: '0'
- key: Buffer overruns
value: '0'
- key: Parse errors
value: '0'
- key: Rx sequence number
value: '92'
- key: Tx sequence number
value: '0'
- key: Rx total bytes
value: '399323'
- key: Tx total bytes
value: '3945'
- key: Rx speed
value: '3873.000000'
- key: Tx speed
value: '21.000000'
- key: Remotes count
value: '3'
- key: Remote [0]
value: '0.0'
- key: Remote [1]
value: '1.0'
- key: Remote [2]
value: '1.1'
- level: "\0"
name: 'mavros_router: endpoint 1001: /uas1'
message: ok
hardware_id: none
values:
- key: Remotes count
value: '3'
- key: Remote [0]
value: '0.0'
- key: Remote [1]
value: '1.0'
- key: Remote [2]
value: '1.191'