Open Cristian-wp opened 1 month ago
Hi @Cristian-wp,
The service is called /drone0/get_origin
and it appears in your list.
You can follow these steps:
ros2 run rqt_tf_tree rqt_tf_tree
and check that earth
and map
are connected.python3 mission_gps.py
instead of the behavior_tree.Just to check if all works without behavior tree
Hi Rafael, this is the output of your suggested steps: 1) I have try to launch it manually but I get the same result: TMUX MISSION WINDOW:
[as2_behavior_tree_node-1] [DEBUG] [1728480572.312826162] [rcl_action]: Taking action result response
[as2_behavior_tree_node-1] [DEBUG] [1728480572.312866834] [rcl]: Client taking service response
[as2_behavior_tree_node-1] [DEBUG] [1728480572.312914475] [rcl]: Client take response succeeded: true
[as2_behavior_tree_node-1] [DEBUG] [1728480572.312934839] [rcl_action]: Action result response taken
[as2_behavior_tree_node-1] [INFO] [1728480572.312961193] [drone0.bt_manager]: result
[as2_behavior_tree_node-1] [1728480572.813]: TakeOff RUNNING -> SUCCESS
[as2_behavior_tree_node-1] [DEBUG] [1728480572.813172127] [rcl]: Client sending service request
[as2_behavior_tree_node-1] [DEBUG] [1728480572.813608052] [rcl]: Client taking service response
[as2_behavior_tree_node-1] [DEBUG] [1728480572.813650232] [rcl]: Client take response succeeded: true
[as2_behavior_tree_node-1] [DEBUG] [1728480572.813697586] [rcl]: Client sending service request
[as2_behavior_tree_node-1] [1728480572.814]: SetOrigin IDLE -> SUCCESS
[as2_behavior_tree_node-1] [DEBUG] [1728480572.813912813] [rcl]: Client taking service response
[as2_behavior_tree_node-1] [DEBUG] [1728480572.813955752] [rcl]: Client take response succeeded: true
[as2_behavior_tree_node-1] [1728480572.814]: GetOrigin IDLE -> SUCCESS
[as2_behavior_tree_node-1] [1728480572.814]: GoToGps IDLE -> RUNNING
[as2_behavior_tree_node-1] [INFO] [1728480573.814220578] [drone0.bt_manager]: GoToGps - service: not available, waiting again...
[as2_behavior_tree_node-1] [INFO] [1728480574.814499704] [drone0.bt_manager]: GoToGps - service: not available, waiting again...
[as2_behavior_tree_node-1] [INFO] [1728480575.814762940] [drone0.bt_manager]: GoToGps - service: not available, waiting again...
[as2_behavior_tree_node-1] [INFO] [1728480576.815043099] [drone0.bt_manager]: GoToGps - service: not available, waiting again...
[as2_behavior_tree_node-1] [INFO] [1728480577.815280030] [drone0.bt_manager]: GoToGps - service: not available, waiting again...
[as2_behavior_tree_node-1] [INFO] [1728480578.815547584] [drone0.bt_manager]: GoToGps - service: not available, waiting again...
[as2_behavior_tree_node-1] [INFO] [1728480579.815802711] [drone0.bt_manager]: GoToGps - service: not available, waiting again...
[as2_behavior_tree_node-1] [INFO] [1728480580.816066141] [drone0.bt_manager]: GoToGps - service: not available, waiting again...
Service manually called:
ros2 service call /drone0/geopath_to_path as2_msgs/srv/GeopathToPath
waiting for service to become available...
and it stay stuck there...
2) This is my rqt_tf_tree and looks ok for what I can see:
2.5) This is my rqt_graph:
3) I have already done the mission_gps using the same coordinates(since the default ones are to far away) and it works without any problem.
Looking in the code I have found that the service geopath_to_path is called inside GpsToCartesian Action . It means that I have to get convert the gps coordinates to cartesian in order to use GPS points?
Hi @Cristian-wp,
You can call the service /drone0/get_origin
using the following command:
ros2 service call /drone0/get_origin as2_msgs/srv/GetOrigin "{}"
This will return the GPS origin. It seems to be working, as the TF tree looks good, with earth
, drone0/map
, and drone0/odom
connected.
The issue you are encountering is that the behavior tree is trying to perform the conversion by calling the service /drone0/geopath_to_path
, which is no longer used in Aerostack2. This service was used to convert a GPS path to a cartesian path. Currently, we use pymap3d
python library and as2::gps::GpsHandler
(in as2_core) C++ library based on GeographicLib.
You can open an issue directly on Aerostack2 regarding this. I believe @pariaspe could assist you with using the behavior tree with GPS coordinates.
@RPS98 I had try with your command and set origin works:
ros2 service call /drone0/get_origin as2_msgs/srv/GetOrigin "{}"
waiting for service to become available...
requester: making request: as2_msgs.srv.GetOrigin_Request()
response:
as2_msgs.srv.GetOrigin_Response(success=True, origin=geographic_msgs.msg.GeoPoint(latitude=47.3979711, longitude=8.546163, altitude=47.45522931593992))
Hi, I am trying to modify your square.xml example using GoToGps Action instead of GoTo Action. This is how I modify the tree:
From PX4 simulation I have no errors or warning, but after the drone perform TakeOff Action, the tree stops to work because it can not find GotToGps service (as I understand). I had try to figure out how to start that service, but I can not find the way.
This is my modified aerostack2.yaml:
This files are the logs: takeoff_behavior_node_85006_1728468248411.log
as2_behavior_tree_node_84985_1728468248099.log
go_to_behavior_node_85001_1728468248399.log
This is the behavior TMUX TOP window when I launch the mission:
This is the behavior TMUX BOTTOM window when I launch the mission:
This is my service list, and
/drone0/geopath_to_path
call in go_to_gps_action.cpp is present:I have modify the output of ROSINFO to check were the service problem comes out, and is in this [line]:(https://github.com/aerostack2/aerostack2/blob/15333f4b343844f7847365da5caa30972236b0ed/as2_behavior_tree/plugins/action/go_to_gps_action.cpp#L71), it can not find the service and can not even print the name...
Plus I have not understand if this implementation of "set origin" is correct:
SetOrigin Action is mandatory only when you need to specify some custom coordinates or is needed when you want to use GoToGps Action? I ask this because in basic_robotic_function TMUX window I see this output before
and after the action are performed: