git remote set-url origin https:// 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 @github.com/https://github.com/LWL0857/ubuntu_uav_ass.gitLWL0857/ubuntu_uav_ass.git fzp_p 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 scasc
Ubuntu20.04 ros2 foxy
下载这个ros 2 serial库
https://github.com/ZhaoXiangBox/serial
Adapt to ROS2 foxy.
Get the code:
# open a new terminal
cd serial
mkdir build
Build:
cd build
cmake ..
make
Install:
sudo make install
也可以不用 make install ,直接和你想要调用本API的ROS2 节点放在同一个 src 下编译即可。有关于本串口操作包的 API 在线文档如下:
ros的vrpn_mocap库位置
https://github.com/LWL0857/T_vrpn_mocap-release.git
ROS2 VRPN client built pirmarily to interface with motion capture devices such as VICON and OptiTrack. A detailed list of supported hardware can be found on vrpn wiki.
安装依赖
sudo apt-get install ros-foxy-vrpn
首先clone源码到ros2工作空间的src文件夹下,
将clone的文件夹改名成vrpn_mocap功能包名
在src文件夹同级目录进行
colcon build
然后
source install/setup.bash
ros2 launch client.launch.yaml server:=<server ip> port:=<port>
- Clone this repo into your ROS2 workspace
- Run
rosdep install --from-paths src -y --ignore-srcto install dependencies - Run
colcon build - Your usual ROS2 routines:
source install/setup.zsh, etc.
Run the following command,
ros2 launch client.launch.yaml server:=<server ip> port:=<port>replacing <server ip> and <port> with your VRPN server ip and port, e.g.
ros2 launch client.launch.yaml server:=192.168.0.4 port:=3883Then with ros2 topic list, you should be able to see the following topics
/vrpn_mocap/client_node/<tracker_name>/pose
/vrpn_mocap/client_node/<tracker_name>/twist # optional when mocap reports velocity data
/vrpn_mocap/client_node/<tracker_name>/accel # optional when mocap reports acceleration datawhere <tracker_name> is usually the name of your tracked objects.
Check out the default parameter file and launch file. You can then write your own launch file with custom configurations.
server (string)-- server name, either ip address or domain name (default:"localhost")port (int)-- VRPN server port (default:3883)frame_id (string)-- frame name of the fixed world frame (default:"world")update_freq (double)-- frequency of the motion capture data publisher (default:100.)refresh_freq (double)-- frequency of dynamic adding new tracked objects (default:1.)multi_sensor (bool)-- set to true if there are more than one sensor (frame) reporting on the same object (default:false)
首先clone源码到工作空间下,并将文件夹改名为src,
即src下有源码中的四个功能包 uav_base uav_msg等
在src同级文件目录下
colcon build
ros2 launch uav_base uav.launch.py use_mocap:=true port_name:="ttyUSB0"