Ask Your Question
0

Using sick_scan and rviz

asked 2019-03-04 12:24:39 -0500

Pol gravatar image

updated 2019-04-03 00:45:49 -0500

jayess gravatar image

Hello,

I am trying to use rviz to visualize the data I am receiving from my Sick tim561 which is running from my Raspberry Pi. For this, I am using ros kinetic, sick_scan and attempting to follow the instructions on the wiki. I am however having some trouble. I am able to run the roslaunch command with my launch file (sick_scan sick_tim_5xx.launch), and it seems to be working well. From what I can tell it is publishing pointcloud2 to cloud, but I am not quite sure what that means. However I am unsure as to how to get rviz to read that data.

I would also like to add that I am quite new to ROS and this sort of project in general so feel free to add any clarifying points or let me know if you need more information and I will get that to you as soon as I can.

Thanks.

Edit: Launch file -> sick_tim_5xx.launch

<?xml version="1.0"?>    
<launch>
    <arg name="hostname" default="192.168.0.1" />
    <arg name="cloud_topic" default="cloud" />
    <arg name="frame_id" default="cloud" />
    <node name="sick_tim_5xx" pkg="sick_scan" type="sick_generic_caller"  respawn="false" output="screen">

    <param name="scanner_type" type="string" value="sick_tim_5xx" />

    <!-- -135° -->
    <param name="min_ang" type="double" value="-2.35619449" />

    <!-- 135° -->
    <param name="max_ang" type="double" value="2.35619449" />

    <param name="use_binary_protocol" type="bool" value="true" />
    <param name="range_max" type="double" value="100.0" />
    <param name="intensity" type="bool" value="True" />

    <param name="hostname" type="string" value="$(arg hostname)" />
    <param name="cloud_topic" type="string" value="$(arg cloud_topic)"/>
    <param name="frame_id" type="str" value="$(arg frame_id)" />
    <param name="port" type="string" value="2112" />
    <param name="timelimit" type="int" value="5" />
    </node>
</launch>

Here is what happens when I run this launch file:

ubuntu@ubiquityrobot:~/catkin_ws$ roslaunch sick_scan sick_tim_5xx.launch
... logging to /home/ubuntu/.ros/log/702e9050-d0dc-11e5-9013-b827eb3e657d/roslaunch-ubiquityrobot-2063.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://ubiquityrobot.local:41867/

SUMMARY
========

PARAMETERS
 * /rosdistro: kinetic
 * /rosversion: 1.12.14
 * /sick_tim_5xx/cloud_topic: cloud
 * /sick_tim_5xx/frame_id: cloud
 * /sick_tim_5xx/hostname: 192.168.0.1
 * /sick_tim_5xx/intensity: True
 * /sick_tim_5xx/max_ang: 2.35619449
 * /sick_tim_5xx/min_ang: -2.35619449
 * /sick_tim_5xx/port: 2112
 * /sick_tim_5xx/range_max: 100.0
 * /sick_tim_5xx/scanner_type: sick_tim_5xx
 * /sick_tim_5xx/timelimit: 5
 * /sick_tim_5xx/use_binary_protocol: True

NODES
  /
    sick_tim_5xx (sick_scan/sick_generic_caller)

ROS_MASTER_URI=http://ubiquityrobot.local:11311

process[sick_tim_5xx-1]: started with pid [2081]
[ INFO] [1551880175.138692169]: sick_generic_caller V. 001.003.016
[ INFO] [1551880175.138954563]: Program arguments: /home/ubuntu/catkin_ws/install/lib/sick_scan/sick_generic_caller
[ INFO] [1551880175.139037895]: Program arguments: __name:=sick_tim_5xx
[ INFO] [1551880175.139090395]: Program arguments: __log:=/home/ubuntu/.ros/log/702e9050-d0dc-11e5-9013-b827eb3e657d/sick_tim_5xx-1.log
[ INFO] [1551880175.212545742]: Found sopas_protocol_type param overwriting default protocol:
[ INFO] [1551880175.212803813]: Binary protocol activated
[ INFO] [1551880175.212909385]: Start initialising scanner [Ip: 192.168.0.1] [Port: 2112]
[ INFO] [1551880175.409250725]: Publishing laserscan-pointcloud2 to cloud
1551880308.5115 ERROR: Tcp::open: Failed to open TCP connection to 192.168.0.1, aborting.
[ INFO] [1551880308.531176850]: Parameter setting for <active_echo: 0>
[ INFO] [1551880308.733535743 ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2019-03-22 18:08:17 -0500

Pol gravatar image

I was able to find the solution by contacting SICK support. Apparently the IP address of the port you connect to and the IP address of the LIDAR need to be similar (eg if LIDAR is 10.10.10.10 then port IP needs to be 10.10.10.XXX). The opposite is also true, however I was unable to change the LIDAR's IP so I changed the ports'. I followed this tutorial and set up a temporary IP on my port. This solved my issue and can now run sick_scan successfully.

edit flag offensive delete link more
0

answered 2019-03-05 03:46:03 -0500

EdwardNur gravatar image

It means that the package is publishing point clouds that you can use to create 3D sparse map and 2D occupancy grid map in order to use for the navigation and localization afterwards.

When you launch Rviz, it automatically subscribes to /tf and listens to all tf that you have launched. When openning RViz, simply press button "add source" (on the left box) and add by topic. There you can find /cloud topic and simply add it.

edit flag offensive delete link more

Comments

Hello thank you for your reply. These steps do not seem to be working for me for some reason. The fixed frame gives an error that says "no tf data" even when I add the reference to topic cloud. Are there any steps, as basic as they may seem, that I might be missing? Thanks.

Pol gravatar imagePol ( 2019-03-05 13:50:16 -0500 )edit

I just ran "rostopic echo sick_tim_5xx" and it came back saying that sick_tim_5xx is not published yet, even though when I run the launch file it says "Publishing laserscan-pointcloud2 to cloud". What is the disparity here?

Pol gravatar imagePol ( 2019-03-05 13:59:05 -0500 )edit
1

@Pol you probably have a wrong TF. Can you show me the launch file

EdwardNur gravatar imageEdwardNur ( 2019-03-06 07:06:47 -0500 )edit

Hello, I am not entirely sure what launch file you are referring to, so I have put the sick_tim_5xx.launch file as well as what happens when I run it above in the original post as an edit. Is this what you were looking for?

Thanks.

Pol gravatar imagePol ( 2019-03-06 07:55:32 -0500 )edit
1

@Pol192.168.0.1 is that your IP address? Can you do hostname -I

EdwardNur gravatar imageEdwardNur ( 2019-03-06 08:33:53 -0500 )edit

Hello, I apologize for that I do not believe that is my IP address I was simply trying to do it the quicker way. When I run hostname -I I get 128.46.5.225 10.42.0.1. However that does not match the IP address of my LIDAR that I found through SOPAS (10 . 97 . 0 . 60). Should I try those IPs?

Pol gravatar imagePol ( 2019-03-06 09:43:24 -0500 )edit

I also ran nc -z -v -w5 $SCANNERIPADDRESS 2112 with all three addresses and got varied results. For 128... I got connection refused. For 10.97... I got that it timed out. And for 10.42... I also got connection refused. I hope that's helpful.

Pol gravatar imagePol ( 2019-03-06 12:58:33 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-03-04 12:24:39 -0500

Seen: 126 times

Last updated: Apr 03