Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Subtree port remapping using Groot#922

Unanswered
Bmoradi93 asked this question inQ&A
Discussion options

I'm trying to do port remapping using Groot. I was not able to find instructions and documentation for that.
I have a sub-tree that is used in a main tree. The nema of the mapped ports in the sub-tree and main tree are identical.
I followed the BT general port remapping instructions in the documentation but did not help.

Here is my example tree designed by Groot:

<?xml version="1.0"?><rootmain_tree_to_execute="BehaviorTree"><!-- //////////-->    <BehaviorTreeID="BehaviorTree">        <Sequence>            <SubTreeID="ScanSubTree"__shared_blackboard="true"drone_id="drone_1"/>            <ActionID="ReturnToLaunch"drone_id="drone_1"flight_speed="1.0"obstacle_avoidance_required="false"rtk_fixed_required="false"smooth_path_required="true"use_global_planner="false"use_px4_rtl="false"/>        </Sequence>    </BehaviorTree><!-- //////////-->    <BehaviorTreeID="ScanSubTree">        <Sequence>            <ActionID="Takeoff"drone_id="drone_0"target_altitude="4"/>            <ActionID="ScanGPSPoints"drone_id="drone_0"flight_env_id="field_1"flight_speed="1.0"mission_id="test.json"obstacle_avoidance_required="false"rtk_fixed_required="false"smooth_path_required="false"use_global_planner="false"/>        </Sequence>    </BehaviorTree><!-- //////////-->    <TreeNodesModel>        <ActionID="AbortTakeoffAndLand"/>        <ActionID="AdjustGimbalAngle"/>        <ConditionID="AreAllSensorsOperational"/>        <ConditionID="AreDiagnosticsPassed"/>        <ConditionID="AreMotorsFunctional"/>        <ConditionID="AreSensorsFunctional"/>        <ActionID="ArmDrone"/>        <ActionID="Ascend"/>        <ConditionID="AtDestination"/>        <ActionID="AvoidObstacle"/>        <ConditionID="CanHover"/>        <ConditionID="CanPickupCargo"/>        <ActionID="CaptureImage">            <input_portdefault="F"name="camera_id"/>            <input_portdefault="drone_0"name="drone_id"/>            <input_portdefault="5"name="recording_frequency"/>            <input_portdefault="true"name="recording_status"/>        </Action>        <ConditionID="CargoDetected"/>        <ConditionID="CargoDropPointReached"/>        <ActionID="CheckBattery"/>        <ConditionID="DataTransmissionFailed"/>        <ConditionID="DataTransmissionSuccessful"/>        <ActionID="Descend"/>        <ActionID="DockAtStation"/>        <ActionID="FixateOnDrone">            <input_portdefault="false"name="activate_follow_target"/>            <input_portdefault="drone_0"name="drone_id"/>            <input_portdefault="drone_1"name="target_drone_id"/>        </Action>        <ConditionID="GimbalInPosition"/>        <ActionID="Hold"/>        <ConditionID="IsAMSLAltitudeAvailable"/>        <ConditionID="IsAltitudeIncreasingSteadily"/>        <ConditionID="IsAltitudeStagnantOrDecreasing"/>        <ConditionID="IsAreaClear"/>        <ConditionID="IsBatteryCritical"/>        <ConditionID="IsBatteryLow"/>        <ConditionID="IsBatterySufficient"/>        <ConditionID="IsCameraFunctional"/>        <ConditionID="IsCargoSecured"/>        <ConditionID="IsDockingStationAvailable"/>        <ConditionID="IsGPSLockAvailable"/>        <ConditionID="IsGimbalFunctional"/>        <ConditionID="IsImageCaptured"/>        <ConditionID="IsInAir"/>        <ConditionID="IsLanded"/>        <ConditionID="IsLandingAreaClear"/>        <ConditionID="IsMovingPlatformDetected"/>        <ConditionID="IsPointInsideOperationalBoundary"/>        <ConditionID="IsPointWithinSafeBoundary"/>        <ConditionID="IsRecording"/>        <ConditionID="IsSignalStrong"/>        <ConditionID="IsTakeoffAreaClear"/>        <ConditionID="IsTargetInSight"/>        <ConditionID="IsTerrainFollowable"/>        <ConditionID="IsZoomLimitReached"/>        <ActionID="Land">            <input_portdefault="drone_0"name="drone_id"/>        </Action>        <ActionID="LandOnMovingPlatform"/>        <ActionID="LockGimbal">            <input_portdefault="0.0"name="altitude"/>            <input_portdefault="drone_0"name="drone_id"/>            <input_portdefault="F"name="gimbal_id"/>            <input_portdefault="false"name="gimbal_locker_status"/>            <input_portdefault="0.0"name="latitude"/>            <input_portdefault="0.0"name="longitude"/>        </Action>        <ConditionID="LostTarget"/>        <ActionID="MoveBackward"/>        <ActionID="MoveForward"/>        <ActionID="MoveLeft"/>        <ActionID="MoveRight"/>        <ActionID="NavigateToPoint"/>        <ConditionID="ObstacleDetected"/>        <ConditionID="PathClear"/>        <ConditionID="PathObstructed"/>        <ConditionID="ReachedMaxAltitude"/>        <ConditionID="ReachedMinAltitude"/>        <ConditionID="ReachedTargetAltitude"/>        <ConditionID="ReceivedDataFromBase"/>        <ActionID="RecordBag">            <input_portdefault="rosbag"name="bag_name">the name of the recorded rosbag</input_port>            <input_portdefault="false"name="bag_recording_status">start or stop recording the roasbag</input_port>            <input_portdefault="300"name="duration_s">duration of record</input_port>            <input_portdefault="false"name="image_recording_status">includes or excludes image topics</input_port>        </Action>        <ActionID="RetreatFromThreat"/>        <ActionID="ReturnToLaunch">            <input_portdefault="drone_0"name="drone_id">drone namespace in ROS</input_port>            <input_portdefault="1.0"name="flight_speed">maximum horizontal flight speed.</input_port>            <input_portdefault="false"name="obstacle_avoidance_required"/>            <input_portdefault="false"name="rtk_fixed_required">Won't execute the RTL Action unless the gps status is rtk_fixed. Signinficant effect on the flight stability.</input_port>            <input_portdefault="true"name="smooth_path_required"/>            <input_portdefault="false"name="use_global_planner"/>            <input_portdefault="false"name="use_px4_rtl">if true, the U-shape PX4 RTL will be used to return the drone to its home position</input_port>        </Action>        <ActionID="SIYICaptureImages">            <input_portdefault="drone_0"name="drone_id"/>            <input_portdefault="10"name="number_of_photos"/>        </Action>        <ActionID="SIYIRecordVideo">            <input_portdefault="drone_0"name="drone_id"/>            <input_portdefault="false"name="recording_status"/>        </Action>        <ActionID="ScanComplete"/>        <ActionID="ScanGPSPoints">            <input_portdefault="drone_0"name="drone_id"/>            <input_portdefault="warren-field"name="flight_env_id"/>            <input_portdefault="1.0"name="flight_speed"/>            <input_portdefault="test.json"name="mission_id"/>            <input_portdefault="false"name="obstacle_avoidance_required"/>            <input_portdefault="false"name="rtk_fixed_required"/>            <input_portdefault="false"name="smooth_path_required"/>            <input_portdefault="false"name="use_global_planner"/>        </Action>        <ActionID="ScanOrbit">            <input_portdefault="drone_0"name="drone_id">this drone will perform the orbit scan</input_port>            <input_portdefault="1.0"name="flight_speed"/>            <input_portdefault="2.0"name="orbit_radius"/>            <input_portdefault="false"name="orbit_scan_state">if set to true, OrbitScan will be activated.</input_port>            <input_portdefault="0.0"name="target_gps_altitude"/>            <input_portdefault="0.0"name="target_gps_latitide"/>            <input_portdefault="0.0"name="target_gps_longitude"/>        </Action>        <SubTreeID="ScanSubTree">            <input_portdefault="true"name="__shared_blackboard">If false (default), the Subtree has an isolated blackboard and needs port remapping</input_port>            <input_portdefault="drone_0"name="drone_id">namespace of the drone in ROS</input_port>        </SubTree>        <ActionID="SendAlertToGroundControl"/>        <ActionID="SetGimbalAngles">            <input_portdefault="0.0"name="angle_pitch">from -90 to 20</input_port>            <input_portdefault="0.0"name="angle_roll"> No active</input_port>            <input_portdefault="0.0"name="angle_yaw">from -120 to 120</input_port>            <input_portdefault="drone_0"name="drone_id"/>            <input_portdefault="AirSim"name="gimbal_id">Real Drone: A8  || Simulation: AirSim</input_port>        </Action>        <ActionID="StartRecordingVideo"/>        <ActionID="StartScanning"/>        <ActionID="StopRecordingVideo"/>        <ActionID="StopScanning"/>        <ActionID="Takeoff">            <input_portdefault="drone_0"name="drone_id"/>            <input_portdefault="4"name="target_altitude"/>        </Action>        <ConditionID="ThreatDetected"/>        <ActionID="UpdateMap">            <input_portdefault="v.0"name="map_version">Changes the OBJ map version</input_port>        </Action>        <ActionID="YawLeft"/>        <ActionID="YawRight"/>        <ActionID="ZoomInCamera"/>        <ActionID="ZoomOutCamera"/>        <ActionID="start_recording_img">            <input_portdefault="F"name="camera_id">F: Front, D: Down, B: Back, T: ThermalCam, N: NightCam</input_port>            <input_portdefault="drone_0"name="drone_id"/>            <input_portdefault="2"name="recording_frequency"/>        </Action>        <ActionID="stop_recording_img">            <input_portdefault="F"name="camera_id"/>            <input_portdefault="drone_0"name="drone_id"/>            <input_portname="recording_frequency"/>        </Action>    </TreeNodesModel><!-- //////////--></root>

drone_id is the port that I want to remap. in the main tree, If I set the drone_id=drone_1, it is not reflected in the sub-tree when executing the tree.

I'm using the latest version of BT.CPP in my docker container.

You must be logged in to vote

Replies: 1 comment

Comment options

https://www.behaviortree.dev/docs/tutorial-advanced/tutorial_14_subtree_model

When the names of the entries in the SubTree and the parent tree are the same, you can use the attribute _autoremap.
For instance:

<SubTree  frame="{frame}" result="{result}" />

Can be replaced by:

<SubTree _autoremap="true" />
You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@Bmoradi93@Aglargil
Converted from issue

This discussion was converted from issue #889 on January 31, 2025 15:55.


[8]ページ先頭

©2009-2025 Movatter.jp