Code Monkey home page Code Monkey logo

Comments (5)

Ryanf55 avatar Ryanf55 commented on June 16, 2024

Can you supply which version or commit hash you were running of ArduPilot to reproduce this? "Rover" is not a version.

from ardupilot.

jvzacchi avatar jvzacchi commented on June 16, 2024

@Ryanf55 0736106

from ardupilot.

Ryanf55 avatar Ryanf55 commented on June 16, 2024

@arshPratap Do you have a chance to look at this bug?

from ardupilot.

jvzacchi avatar jvzacchi commented on June 16, 2024

Just an update. I moved to HW and the error is not present when using serial there.

from ardupilot.

Ryanf55 avatar Ryanf55 commented on June 16, 2024

Running the agent

ros2 run micro_ros_agent micro_ros_agent udp4 -p 2019 -r dds_xrce_profile.xml

Plane

 ./Tools/autotest/sim_vehicle.py -v Plane --map --console --enable-dds

If you call arming right away, before the vehicle is booted, it properly reports a failure.

 ros2 service call /ap/arm_motors ardupilot_msgs/srv/ArmMotors "{arm: true}"

If you call it later once it's properly initialized, it reports a success.

For plane, you can set the mode to 4, and it switches mode correctly.

ros2 service call /ap/mode_switch ardupilot_msgs/srv/ModeSwitch "{mode: 4}"

I tested modes 1-9. All work. 9 gets rejected, with the current mode reported as 8, and the logs show "AP: No such mode 9"

Copter

 ./Tools/autotest/sim_vehicle.py -v Plane --map --console --enable-dds

Requesting all the mode changes works as expected.

ryan@B650-970:~/Dev/ardu_ws$ ros2 service call /ap/mode_switch ardupilot_msgs/srv/ModeSwitch "{mode: 0}"
waiting for service to become available...
requester: making request: ardupilot_msgs.srv.ModeSwitch_Request(mode=0)

response:
ardupilot_msgs.srv.ModeSwitch_Response(status=True, curr_mode=0)

ryan@B650-970:~/Dev/ardu_ws$ ros2 service call /ap/mode_switch ardupilot_msgs/srv/ModeSwitch "{mode: 1}"
requester: making request: ardupilot_msgs.srv.ModeSwitch_Request(mode=1)

response:
ardupilot_msgs.srv.ModeSwitch_Response(status=True, curr_mode=1)

ryan@B650-970:~/Dev/ardu_ws$ ros2 service call /ap/mode_switch ardupilot_msgs/srv/ModeSwitch "{mode: 2}"
requester: making request: ardupilot_msgs.srv.ModeSwitch_Request(mode=2)

response:
ardupilot_msgs.srv.ModeSwitch_Response(status=True, curr_mode=2)

ryan@B650-970:~/Dev/ardu_ws$ ros2 service call /ap/mode_switch ardupilot_msgs/srv/ModeSwitch "{mode: 3}"
requester: making request: ardupilot_msgs.srv.ModeSwitch_Request(mode=3)

response:
ardupilot_msgs.srv.ModeSwitch_Response(status=True, curr_mode=3)

ryan@B650-970:~/Dev/ardu_ws$ ros2 service call /ap/mode_switch ardupilot_msgs/srv/ModeSwitch "{mode: 4}"
requester: making request: ardupilot_msgs.srv.ModeSwitch_Request(mode=4)

response:
ardupilot_msgs.srv.ModeSwitch_Response(status=True, curr_mode=4)

ryan@B650-970:~/Dev/ardu_ws$ ros2 service call /ap/mode_switch ardupilot_msgs/srv/ModeSwitch "{mode: 5}"
requester: making request: ardupilot_msgs.srv.ModeSwitch_Request(mode=5)

response:
ardupilot_msgs.srv.ModeSwitch_Response(status=True, curr_mode=5)

ryan@B650-970:~/Dev/ardu_ws$ ros2 service call /ap/mode_switch ardupilot_msgs/srv/ModeSwitch "{mode: 6}"
requester: making request: ardupilot_msgs.srv.ModeSwitch_Request(mode=6)

response:
ardupilot_msgs.srv.ModeSwitch_Response(status=True, curr_mode=6)

ryan@B650-970:~/Dev/ardu_ws$ ros2 service call /ap/mode_switch ardupilot_msgs/srv/ModeSwitch "{mode: 7}"
requester: making request: ardupilot_msgs.srv.ModeSwitch_Request(mode=7)

response:
ardupilot_msgs.srv.ModeSwitch_Response(status=True, curr_mode=7)

ryan@B650-970:~/Dev/ardu_ws$ ros2 service call /ap/mode_switch ardupilot_msgs/srv/ModeSwitch "{mode: 8}"
requester: making request: ardupilot_msgs.srv.ModeSwitch_Request(mode=8)

response:
ardupilot_msgs.srv.ModeSwitch_Response(status=False, curr_mode=7)

Rover logs

ryan@B650-970:~/Dev/ardu_ws$ ros2 service call /ap/arm_motors ardupilot_msgs/srv/ArmMotors "{arm: true}"
requester: making request: ardupilot_msgs.srv.ArmMotors_Request(arm=True)

response:
ardupilot_msgs.srv.ArmMotors_Response(result=True)

ryan@B650-970:~/Dev/ardu_ws$ ros2 service call /ap/mode_switch ardupilot_msgs/srv/ModeSwitch "{mode: 1}"
requester: making request: ardupilot_msgs.srv.ModeSwitch_Request(mode=1)

response:
ardupilot_msgs.srv.ModeSwitch_Response(status=True, curr_mode=1)

ryan@B650-970:~/Dev/ardu_ws$ ros2 service call /ap/mode_switch ardupilot_msgs/srv/ModeSwitch "{mode: 2}"
requester: making request: ardupilot_msgs.srv.ModeSwitch_Request(mode=2)

response:
ardupilot_msgs.srv.ModeSwitch_Response(status=False, curr_mode=1)

ryan@B650-970:~/Dev/ardu_ws$ ros2 service call /ap/mode_switch ardupilot_msgs/srv/ModeSwitch "{mode: 3}"
requester: making request: ardupilot_msgs.srv.ModeSwitch_Request(mode=3)

response:
ardupilot_msgs.srv.ModeSwitch_Response(status=True, curr_mode=3)

ryan@B650-970:~/Dev/ardu_ws$ ros2 service call /ap/mode_switch ardupilot_msgs/srv/ModeSwitch "{mode: 4}"
requester: making request: ardupilot_msgs.srv.ModeSwitch_Request(mode=4)

response:
ardupilot_msgs.srv.ModeSwitch_Response(status=True, curr_mode=4)

ryan@B650-970:~/Dev/ardu_ws$ ros2 service call /ap/mode_switch ardupilot_msgs/srv/ModeSwitch "{mode: 5}"
waiting for service to become available...
requester: making request: ardupilot_msgs.srv.ModeSwitch_Request(mode=5)

response:
ardupilot_msgs.srv.ModeSwitch_Response(status=True, curr_mode=5)

ryan@B650-970:~/Dev/ardu_ws$ ros2 service call /ap/mode_switch ardupilot_msgs/srv/ModeSwitch "{mode: 6}"
waiting for service to become available...
requester: making request: ardupilot_msgs.srv.ModeSwitch_Request(mode=6)

response:
ardupilot_msgs.srv.ModeSwitch_Response(status=False, curr_mode=5)

ryan@B650-970:~/Dev/ardu_ws$ ros2 service call /ap/mode_switch ardupilot_msgs/srv/ModeSwitch "{mode: 7}"
waiting for service to become available...
requester: making request: ardupilot_msgs.srv.ModeSwitch_Request(mode=7)

response:
ardupilot_msgs.srv.ModeSwitch_Response(status=True, curr_mode=7)

ryan@B650-970:~/Dev/ardu_ws$ ros2 service call /ap/mode_switch ardupilot_msgs/srv/ModeSwitch "{mode: 8}"
requester: making request: ardupilot_msgs.srv.ModeSwitch_Request(mode=8)

response:
ardupilot_msgs.srv.ModeSwitch_Response(status=False, curr_mode=7)

Conclusion

I can't reproduce on SITL. Please re-open if you can provide some steps like this to reproduce, otherwise I suspect it's an issue in your code.

from ardupilot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.