Hardware Reference
In-Depth Information
port: PORT_1
desired_frequency: 20.0
This configuration says that you have a touch sensor connected on Port 1 (named
my_touch_sensor ) that you wish to check the status of 20 times per second (or 20 Hz).
The NXT brick is not capable of handling high check frequencies, so you probably
don't want to set this value any larger (smaller is fine, though). Go ahead and recon-
nect the touch sensor to Port 1 (and make sure your NXT brick is powered on).
Each device connected to the brick should be specified in this file, starting with a -
before the type definition. For this example, we're keeping it simple, but when you want
to build a more complicated robot, you'll need more than one item in this file.
To get ROS to run the robot, you need to create a ROS launch file named ro
bot.launch . Using a text editor, create a new file with that name and add the following
inside it:
<launch>
<node pkg="nxt_ros" type="nxt_ros.py" name="nxt_ros" output="screen" re
spawn="true">
<rosparam command="load" file="$(find my_nxt_robot)/robot.yaml" />
</node>
</launch>
Now you can test your simple, one-sensor robot. You must be root, so switch to a root
session first, change back into the my_nxt_robot package directory, and then use ro
slaunch to launch the ROS robot:
$ sudo su -
$ roscd my_nxt_robot
$ roslaunch robot.launch
... logging to /root/.ros/log/bffc809a-1957-11e3-b0b1-b827eb545e36/
roslaunch-raspberrypi-20985.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://raspberrypi:43572/
SUMMARY
========
PARAMETERS
* /nxt_ros/nxt_robot
* /rosdistro
Search WWH ::




Custom Search