赞
踩
- sudo apt install ros-noetic-apriltag # 根据自己的ROS版本来修改
- cp -r ~/XTDrone/sensing/object_detection_and_tracking/apriltag/apriltag_ros/ ~/catkin_ws/src/
- cd ~/catkin_ws/
- catkin build apriltag_ros #或catkin_make
XTDrone团队已经做好了三个AprilTag并排的模型(如何制作见这里),在~/XTDrone/sitl_config/models/apriltag0-2,下面我们将让三个无人机分别降落到对应ID的AprilTag上。
sudo cp ~/XTDrone/sitl_config/launch/px4/* /opt/ros/noetic/share/mavros/launch/
- # GPS used
- #param set EKF2_AID_MASK 1
- # Vision used and GPS denied
- param set EKF2_AID_MASK 24
-
- # Barometer used for hight measurement
- #param set EKF2_HGT_MODE 0
- # Barometer denied and vision used for hight measurement
- param set EKF2_HGT_MODE 3
roslaunch px4 outdoor2_precision_landing.launch
- ... logging to /home/ray/.ros/log/632bf21c-2b0a-11ef-ba9c-37ab60347b3f/roslaunch-ray-pc-391024.log
- Checking log directory for disk usage. This may take a while.
- Press Ctrl-C to interrupt
- Done checking log file disk usage. Usage is <1GB.
-
- RLException: Invalid <param> tag: Cannot load command parameter [robot_description]: no such command [['/opt/ros/noetic/share/xacro/xacro.py', '/home/ray/catkin_ws/src/catvehicle/urdf/catvehicle1-3.xacro', 'roboname:=ugv_0']].
-
- Param xml is <param name="robot_description" command="$(find xacro)/xacro.py '$(find catvehicle)/urdf/catvehicle1-3.xacro' roboname:='ugv_0'"/>
- The traceback for the exception was written to the log file
xacro
命令的路径和参数配置上,官方提供的<param>
标签使用的是旧的命令格式,因此运行时会报错。launch文件中<param>
标签中xacro.py的.py- <launch>
-
- <!-- MAVROS posix SITL environment launch script -->
- <!-- launches Gazebo environment and 2x: MAVROS, PX4 SITL, and spawns vehicle -->
- <!-- vehicle model and world -->
- <arg name="est" default="ekf2"/>
- <arg name="world" default="$(find mavlink_sitl_gazebo)/worlds/outdoor2.world"/>
- <!-- gazebo configs -->
- <arg name="gui" default="true"/>
- <arg name="debug" default="false"/>
- <arg name="verbose" default="false"/>
- <arg name="paused" default="false"/>
- <!-- Gazebo sim -->
- <include file="$(find gazebo_ros)/launch/empty_world.launch">
- <arg name="gui" value="$(arg gui)"/>
- <arg name="world_name" value="$(arg world)"/>
- <arg name="debug" value="$(arg debug)"/>
- <arg name="verbose" value="$(arg verbose)"/>
- <arg name="paused" value="$(arg paused)"/>
- </include>
-
- <arg name="obstaclestopper" default="false"/>
- <group ns="ugv_0">
- <param name="robot_description"
- command="$(find xacro)/xacro '$(find catvehicle)/urdf/catvehicle1-3.xacro' roboname:='ugv_0'" />
- <include file="$(find catvehicle)/launch/catvehicle.launch">
- <arg name="robot_name" value="ugv_0"/>
- <arg name="init_pose" value="-x 0 -y 0 -z 0 -R 0 -P 0 -Y 0"/>
- <arg name="config_file" value="catvehicle_control.yaml"/>
- <arg name="obstaclestopper" value="$(arg obstaclestopper)"/>
- </include>
-
- <!-- Uncomment this to get immediate motion from the car
- <node name="openLoopCircle" pkg="safeopenloopcircle" type="safeopenloopcircle_node"/>
- -->
- </group>
-
- <!-- iris_0 -->
- <group ns="iris_0">
- <!-- MAVROS and vehicle configs -->
- <arg name="ID" value="0"/>
- <arg name="ID_in_group" value="0"/>
- <arg name="fcu_url" default="udp://:24540@localhost:34580"/>
- <!-- PX4 SITL and vehicle spawn -->
- <include file="$(find px4)/launch/single_vehicle_spawn_xtd.launch">
- <arg name="x" value="-3"/>
- <arg name="y" value="0"/>
- <arg name="z" value="0"/>
- <arg name="R" value="0"/>
- <arg name="P" value="0"/>
- <arg name="Y" value="0"/>
- <arg name="vehicle" value="iris"/>
- <arg name="sdf" value="iris_downward_camera"/>
- <arg name="mavlink_udp_port" value="18570"/>
- <arg name="mavlink_tcp_port" value="4560"/>
- <arg name="ID" value="$(arg ID)"/>
- <arg name="ID_in_group" value="$(arg ID_in_group)"/>
- </include>
- <!-- MAVROS -->
- <include file="$(find mavros)/launch/px4.launch">
- <arg name="fcu_url" value="$(arg fcu_url)"/>
- <arg name="gcs_url" value=""/>
- <arg name="tgt_system" value="$(eval 1 + arg('ID'))"/>
- <arg name="tgt_component" value="1"/>
- <arg name="config_yaml" value="$(find mavros)/launch/px4_config_iris_0.yaml"/>
- </include>
- </group>
-
- <!-- iris_1 -->
- <group ns="iris_1">
- <!-- MAVROS and vehicle configs -->
- <arg name="ID" value="1"/>
- <arg name="ID_in_group" value="1"/>
- <arg name="fcu_url" default="udp://:24541@localhost:34581"/>
- <!-- PX4 SITL and vehicle spawn -->
- <include file="$(find px4)/launch/single_vehicle_spawn_xtd.launch">
- <arg name="x" value="-4.5"/>
- <arg name="y" value="0"/>
- <arg name="z" value="0"/>
- <arg name="R" value="0"/>
- <arg name="P" value="0"/>
- <arg name="Y" value="0"/>
- <arg name="vehicle" value="iris"/>
- <arg name="sdf" value="iris_downward_camera"/>
- <arg name="mavlink_udp_port" value="18571"/>
- <arg name="mavlink_tcp_port" value="4561"/>
- <arg name="ID" value="$(arg ID)"/>
- <arg name="ID_in_group" value="$(arg ID_in_group)"/>
- </include>
- <!-- MAVROS -->
- <include file="$(find mavros)/launch/px4.launch">
- <arg name="fcu_url" value="$(arg fcu_url)"/>
- <arg name="gcs_url" value=""/>
- <arg name="tgt_system" value="$(eval 1 + arg('ID'))"/>
- <arg name="tgt_component" value="1"/>
- <arg name="config_yaml" value="$(find mavros)/launch/px4_config_iris_1.yaml"/>
- </include>
- </group>
-
- <!-- iris_2 -->
- <group ns="iris_2">
- <!-- MAVROS and vehicle configs -->
- <arg name="ID" value="2"/>
- <arg name="ID_in_group" value="2"/>
- <arg name="fcu_url" default="udp://:24542@localhost:34582"/>
- <!-- PX4 SITL and vehicle spawn -->
- <include file="$(find px4)/launch/single_vehicle_spawn_xtd.launch">
- <arg name="x" value="-6"/>
- <arg name="y" value="0"/>
- <arg name="z" value="0"/>
- <arg name="R" value="0"/>
- <arg name="P" value="0"/>
- <arg name="Y" value="0"/>
- <arg name="vehicle" value="iris"/>
- <arg name="sdf" value="iris_downward_camera"/>
- <arg name="mavlink_udp_port" value="18572"/>
- <arg name="mavlink_tcp_port" value="4562"/>
- <arg name="ID" value="$(arg ID)"/>
- <arg name="ID_in_group" value="$(arg ID_in_group)"/>
- </include>
- <!-- MAVROS -->
- <include file="$(find mavros)/launch/px4.launch">
- <arg name="fcu_url" value="$(arg fcu_url)"/>
- <arg name="gcs_url" value=""/>
- <arg name="tgt_system" value="$(eval 1 + arg('ID'))"/>
- <arg name="tgt_component" value="1"/>
- <arg name="config_yaml" value="$(find mavros)/launch/px4_config_iris_2.yaml"/>
- </include>
- </group>
-
- <!-- <node pkg="tf" type="static_transform_publisher" name="0_base_link_to_base_link_frd"
- args="0 0 -0.05 3.1415927 0 0 /base_link_0 /base_link_frd_0 100" />
- <node pkg="tf" type="static_transform_publisher" name="1_base_link_to_base_link_frd"
- args="0 0 -0.05 3.1415927 0 0 /base_link_1 /base_link_frd_1 100" />
- <node pkg="tf" type="static_transform_publisher" name="2_base_link_to_base_link_frd"
- args="0 0 -0.05 3.1415927 0 0 /base_link_2 /base_link_frd_2 100" /> -->
-
- </launch>
which xacro
sudo apt-get install ros-noetic-xacro
roslaunch px4 outdoor2_precision_landing.launch
[ERROR] [1617509823.832162747, 3.666000000]: ODOM: Ex: Could not find a connection between 'iris_0/base_link' and 'base_link_frd' because they are not part of the same tree.Tf has two or more unconnected trees.
- cd ~/XTDrone/communication
- bash multi_vehicle_communication.sh
- cd ~/XTDrone/sensing/pose_ground_truth/
- python3 get_local_pose.py iris 3
- cd ~/XTDrone/control/keyboard
- python3 multirotor_keyboard_control.py iris 3 vel
roslaunch apriltag_ros xtdrone_detection.launch
- cd ~/XTDrone/sensing/object_detection_and_tracking/apriltag/apriltag_ros/config
- rviz -d rviz.rviz
- cd ~/XTDrone/control/
- bash multi_precision_landing.sh
参考: 多无人机精准降落 · 语雀
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。