In the first part of our Hokuyo UST-10LX installation article, we made a wiring harness and installed the lidar into RACECAR/J. After connecting the Jetson on the RACECAR to an HDMI monitor, keyboard and mouse we are ready to configure the Hokuyo and test it under ROS. Looky here:
Hokuyo Network Configuration
Once the wiring and installation of the Hokuyo is complete it is time to set the Jetson up to recognize the Hokuyo UST-10LX. A stock UST-10LX is set to an IP address of 192.168.0.10.
In order for the Jetson to recognize the UST-10LX, the Jetson must be on the same ethernet subnet. In the video above, we walk through setting up a static IP connection for talking to the Hokuyo. Because there are many ways that you may configure your network and robot for testing and deployment, that approach is just one example. Typically for deployment you will need to get your hands a little bit dirtier and add something like the following to your configuration in /etc/network/interfaces
For example you might add:
auto eth0
iface eth0 inet static
address 192.168.0.15
netmask 255.255.255.0
gateway 192.168.0.1
metric 800
This is standard Linux talk about how to setup a static IP of 192.168.0.15 on a machine. This is a very large subject, and will not be covered in any depth here. Google is your friend on this one.
Once you have your static IP setup, you should be able to ping the Hokuyo:
$ ping 192.168.0.10
You will receive back the bytes that you sent it. If you do not, make sure that the blue light on the Hokuyo is on (indicating that the device has power). If the light is on, you most likely have network configuration issues.
UST-10LX Under ROS
In an earlier article RACECAR/J Software Install we cover installing the software drivers, ROS and MIT RACECAR ROS packages. Included in the installation is the ROS urg_node, which is a ROS wrapper for the Hokuyo urg_c library. The urg_node allows ROS to communicate with the Hokuyo.
You will need to setup your .bashrc file to reflect the new network configuration, i.e.
export ROS_MASTER_URI=http://192.168.0.15:11311
export ROS_IP=http://192.168.0.15
Again, these are just example settings and should be changed to match your network.
We can examine the information that the lidar is producing. First open a terminal and start roscore:
$ roscore
Open another terminal. You can list all of the ROS topics:
$ rostopic list
You should see the ‘/scan’ topic. You can then examine the data stream from the lidar:
$ rostopic echo /scan
The data stream displays.
At this point, the Hokuyo is good to go!
In the rest of the video, there is a quick rviz demo. This is more dependent on how you have your robot setup. For the demo, rviz was installed and the LaserScan displayed. The setup for the demo is not covered in this article as you will probably want to run visualizations from a base station connected to the robot over WiFi.
Conclusion
The Hokuyo UST-10LX is a central part of the MIT RACECAR configuration. Installation is a little more challenging than the rest of the build, but with a little patience there should not be any issues.
25 Responses
Any challenges with keeping the TX2 on both the Ethernet network (with the Hokuyo) and the Wifi network (for remote access)?
The challenges are more about network configuration than anything else.
I have the same question. Could you let me know how to setup the IP?
The InstallRacecarJ scripts don’t actually appear to install the urg node. Am I missing something?
Ah, sorry, it’s showing up under “laer_node”. I was looking in the wrong place.
Now I’m getting the following error when I try to run “roslaunch racecar known_map_localization.launch”:
ERROR: cannot launch node of type [map_server/map_server]: map_server
ROS path [0]=/opt/ros/kinetic/share/ros
ROS path [1]=/home/nvidia/catkin_ws/src
ROS path [2]=/home/nvidia/catkin_ws/src
ROS path [3]=/opt/ros/kinetic/share
ERROR: cannot launch node of type [amcl/amcl]: amcl
ROS path [0]=/opt/ros/kinetic/share/ros
ROS path [1]=/home/nvidia/catkin_ws/src
ROS path [2]=/home/nvidia/catkin_ws/src
ROS path [3]=/opt/ros/kinetic/share
Did I miss something in the installation?
The error says that you do not have the map_server and amcl nodes installed. You can try:
$ sudo apt-get install ros-kinetic-map-server
$ sudo apt-get install ros-kinetic-amcl
The installation scripts intentionally do not install all optional nodes. This also includes the rviz application. Typically you should be able to solve this yourself. If you check to make sure that the catkin workspace is sourced correctly, and you are still missing a node, you can check to see if the node is available using apt search. The nodes in this installation typically have a prefix of “ros-kinetic”, which matches Ubuntu 16.04. If the node does not exist, you will probably need to build it from source.
Thanks Jim! Looks like I’m still missing a model or transform tree, though. No map, and RViz can’t find a connection between ‘map’ and ‘laser’, because they’re not part of the same tree. Guess I’ll need to do some diggingn on my own, but this is a great start, thanks for these articles!
I seem to recall that I set the ‘Global Options->Fixed Frame’ to ‘map’ which set up everything.
I have the same issue. Map and odom->laser are not in the same tree. Could you let me know how to fix it?
Did you set the Global Options to Fixed Frame?
Could you let me know how to set “Global Options to Fixed Frame”?
Did you figure out how to fix the “odom and map are not in the same tree” issue?
Jim, instead of the following:
sudo apt-get install ros-kinetic-map_server
I tried:
sudo apt-get install ros-kinetic-map-server
And then it works!
I’m glad you got it to work! I changed the answer above to reflect that.
Hi Jim. Is there any way could purchase the power wiring from the kit. I bought my parts separately so I don’t have the custom wiring.
I am getting a warning when I try to run “roslaunch racecar known_map_localization.launch”.
[ WARN] [1536518743.100424960]: Request for map failed: trying again…
Is there a solution to this?
nvm, I had to update the Debian packages to resolve some dependency issues.
I’m glad you got it to work.
I am using a Hokuyo UTM-30 Lidar which I was thinking would be the same. Well, since it is through USB, the challenge is much smaller. The only issue is that I cannot mount it into the frame. Do you have an easy solution for me? Laser-cutting the board or
The last part of your comment is cut off. You can mount the Lidar any way that’s easiest for you.
Thanks for reading!
Thanks for quick response. The hole that was designed for UTM-10 is too small for UTM-30 since UTM-30 has a bigger hat on the top. It cannot go through the hole.
And the Lidar plate doesn’t have the screw holes for UTM-30. I guess I can use a sticker to fix it then but does generate a new issue that the heat may not be spread out easily?
I don’t know enough about the UTM-30 to help you. If the aluminum plate fits the UTM-30, you could drill holes at the mounting point. The platforms are relatively simple to machine, you should be able to enlarge the hole in the platform if that would work.
Thank you. I will try some low-cost solution.