-
Notifications
You must be signed in to change notification settings - Fork 986
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
Sending arm, takeoff, or changing mode commands of vehicle for ArduCopter SITL in ROS/Gazebo #436
Comments
After you got running mavros, check |
@vooon Thanks for your reply. I already followed the instructions. And I already tried calling on the /mavros/cmd/arming service and it did nothing. This was after I had the sim_vehicle.sh running ofcourse. I still don't know whether I need to pass the arming command over the socket (utilizing fdm udp) or just call that service (the latter would make more sense). I am calling the service which, like I said, does nothing. The reason I think sending any such command over the socket won't work because as per SITL code from ardupilot, and the ardupilot_sitl_ros code, only a specific set of data is packed into a struct and sent over the socket. So an "arming command" can't manage that. The mavsafety and other scripts you mention also rely on the same services for arming etc., so I don't know why directly trying to call the service from the arducopter_sitl_ros doesn't do anything. I am not, however, relying on teleop for this, I am trying to have the vehicle arm and disarm on it's own after the simulation starts. If you could point to a better explanation of how to achieve this goal I would appreciate that a lot. Otherwise I will look into your suggestion for the scripts and try again. Thanks again! |
What diagnostics says?
|
Also, when I call the service for enabling guided, I get -
|
Looks like connection exists, but lacks most of messages. Seems only HEARTBEAT. I'm not tried sim_vehicle.sh script with ros sitl. Does it show log output? If not then use rqt console to see what FCU reports after arming reqest. I do not see any obvious problem on mavros side, please ask @alexbuyval (author of this work) for support. |
Hi @sahiljuneja
Also try to launch the APM planner at the same time with the simulation. Maybe there are some problem with arming. |
@alexbuyval note: import mavros
from mavros import command
mavros.set_namespace()
command.arming(True) |
Thank you for your replies @vooon and @alexbuyval. Sorry for the delayed reply.
whereas, @vooon doesn't mavros.set_namespace() require an input argument? For example
I guess it would throw me the same error. I am looking into the reason for this error myself at the moment and trying to fix it. If you guys have any feedback I would appreciate that! Thanks again! |
@sahiljuneja Did you added argument to If you look at source: mavros/init.py def set_namespace(ns=DEFAULT_NAMESPACE):
"""
Sets namespace of mavros node
""" So argument is optional. |
That's not how set_namespace is defined for me. I'll update mavros first and update asap. Thanks for pointing that out. Alex's mavros repo is quite behind the original mavros, so need to handle that appropriately. |
[python3] try to compute properly the crc for python3
I am referring to http://dev.ardupilot.com/wiki/using-rosgazebo-simulator-with-sitl/
Based on the code, the following is my understanding of what's happening -
However, I still don't know how I can use Mavros alongside with SITL to be able to send commands to arm, disarm, takeoff, or change the mode over the socket.
Directly trying to call the /cmd/arming service, won't help I believe. I am looking at alternatives or any better way for this.
(Please let me know if any clarification is required)
The text was updated successfully, but these errors were encountered: