...
Contents
Table of Contents | ||
---|---|---|
|
...
Environment Setup
software platform
- Ubuntu 20.04 X86
- ROS Noetic
hardware platform
Choose any one below:
- Slamware Kit (User Robot System based on Slamware Solution)
- robot base systems like Apollo/Ares/Athena
...
Sample Code Download
...
Compile and Run
- Download the Slamware ROS SDK along with ROS examples.
- Place the 'src' folder from the ROS SDK into an empty working directory, such as 'catkin_ws'. Also, put the 'slamware_ros_sample' folder from the ROS examples into the 'src' folder.
Code Block language bash mkdir -p catkin_ws/src cd catkin_ws/src
- Initialize the workspace using the Catkin tool.
Code Block language bash catkin_init_workspace
- Compile.
Code Block language bash cd .. catkin_make
- Set up workspace environment.
Code Block language bash source devel/setup.bash
- Launch the slamware_ros_sdk_server_node node. Select the corresponding IP according to the mode.
Code Block language cpp roslaunch slamware_ros_sdk slamware_ros_sdk_server_node.launch ip_address:=10.6.128.141 // Station mode // If in AP mode, the IP address is 192.168.11.1
- Open another terminal, repeat step 5, and start the view_slamware_ros_sdk_server_node node.
Code Block language bash roslaunch slamware_ros_sdk view_slamware_ros_sdk_server_node.launch
- Open another terminal, repeat step 5, and start the display_virtual_lines_node node.
Code Block language bash roslaunch slamware_ros_sample display_virtual_lines.launch
- Configure and add the display of Marker information in Rviz. Click 'Add' in the bottom-left corner of Rviz, then in the pop-up window, select 'Marker' and click 'OK'. Upon success, as shown in the image below, a Marker is added to Displays, and the virtual walls are also displayed in the interface.
...
Code Description
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
ros::init(argc, argv, "display_virtual_lines_node"); ros::NodeHandle n; ros::Publisher pub = n.advertise<visualization_msgs::Marker>("visualization_marker", 10); ros::Subscriber sub = n.subscribe<slamware_ros_sdk::Line2DFlt32Array>("/slamware_ros_sdk_server_node/virtual_walls", 30, virtualWallCallback); |
...