ROS
This topic introduces how to use Mech-Eye SDK on the ROS platform on Ubuntu.
Requirements
-
Operating system: Ubuntu.
-
ROS installed according to instructions on Documentation of ROS.
|
Requirements
Install Mech-Eye SDK for Ubuntu
Please refer to Install Mech-Eye SDK on Ubuntu for instructions.
Install ROS API
-
Install libzmq5 and libzmq3-dev.
sudo apt install libzmq5 libzmq3-dev
-
Create directory
~/ros_ws/src
and open it.mkdir -p ~/ros_ws/src && cd ~/ros_ws/src
-
Clone repository mecheye_ros_interface to directory ~/ros_ws/src.
git clone https://github.com/MechMindRobotics/mecheye_ros_interface
-
Open directory ~/ros_ws and build.
cd ~/ros_ws && catkin_make
-
Modify the files.
-
If you need to save the data, please change
false
totrue
in the line<arg name="save_file" default="true"/>
in the file ~/ros_ws/src/mecheye_ros_interface/launch/start_camera.launch. -
The path for saving the data can be modified in the file ~/ros_ws/src/mecheye_ros_interface/src/main.cpp.
-
Run the Service
-
Open a new terminal and run the following command to start the service.
source ~/ros_ws/devel/setup.bash roslaunch mecheye_ros_interface start_camera.launch
The output is as follows:
... logging to /home/mechmind/.ros/log/69ffe3a2-d290-11ec-828a-000c29351753/roslaunch-ubuntu-4349.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. started roslaunch server http://ubuntu:38711/ SUMMARY ======== PARAMETERS * /mechmind_camera_start/camera_ip: 192.168.0.123 * /mechmind_camera_start/fx: 1727.46410256 * /mechmind_camera_start/fy: 1727.45869267 * /mechmind_camera_start/save_file: False * /mechmind_camera_start/u: 655.818082573 * /mechmind_camera_start/use_external_intri: False * /mechmind_camera_start/v: 516.630650061 * /rosdistro: melodic * /rosversion: 1.14.13 NODES / mechmind_camera_start (mecheye_ros_interface/start) auto-starting new master process[master]: started with pid [4359] ROS_MASTER_URI=http://localhost:11311 setting /run_id to 69ffe3a2-d290-11ec-828a-000c29351753 process[rosout-1]: started with pid [4370] started core service [/rosout] process[mechmind_camera_start-2]: started with pid [4377] Find Mech-Eye devices... Mech-Eye device index : 0 ............................ Camera Model Name: Mech-Eye Pro M Enhanced Camera ID: Sample Camera IP Address: 192.168.xx.xx Hardware Version: Vx.x.x Firmware Version: Vx.x.x ............................ Please enter the device index you want to connect: 0 Connected to the Mech-Eye device successfully. ............................ Camera Model Name: Mech-Eye Nano Camera ID: TAM06218A3020706 Camera IP Address: 192.168.xx.xx Hardware Version: Vx.x.x Firmware Version: Vx.x.x ............................
-
Open another new terminal and run the following command to acquire data.
source ~/ros_ws/devel/setup.bash rosservice call /run_mechmind_camera
The output is as follows:
success: True message: ''
At this point, the camera has been connected. Data such as 2D images and depth maps are saved in the folder /tmp by default.
Every time you modify a file under ~/ros_ws/src/mecheye_ros_interface/src, please do cd ~/ros_ws && catkin_make to update the executable. |