Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
28a4165
Update README
dbworth Jan 30, 2016
a56b76e
Forked from http://stack-nxt.foote-ros-pkg.googlecode.com/hg/
dbworth Jan 30, 2016
604ce58
Disable package nxt_rviz_plugin from building
dbworth Jan 30, 2016
79a3eb1
Add package nxt_ros_test with example of using touch sensor and motor…
dbworth Jan 30, 2016
074fc81
Increase the max frequency of callbacks in nxt_ros node
dbworth Jan 30, 2016
467a327
When a motor is initialized, reset the encoder rotation count to zero
dbworth Jan 30, 2016
a3f1667
Change joint position output to be absolute angle from 0 to 2*pi radi…
dbworth Jan 30, 2016
ae29e7a
Update README
dbworth Jan 30, 2016
cc737f3
Forked from http://stack-nxt-apps.foote-ros-pkg.googlecode.com/hg/
dbworth Jan 30, 2016
28515e6
Forked from http://stack-nxt-robots.foote-ros-pkg.googlecode.com/hg/
dbworth Jan 30, 2016
3edbd6b
nxt_teleop needs to link against BOOST Thread library, cleanup CMakeL…
dbworth Jan 30, 2016
ec7a8ed
Joy.h header is now in sensor_msgs package
dbworth Jan 30, 2016
f493fd4
Merge branch 'fuerte' of https://github.com/dbworth/NXT-ROS into fuerte
dbworth Jan 30, 2016
1f3f316
Change new feature use_absolute_position sensing to be disabled by de…
dbworth Jan 30, 2016
35811e6
Update README.md
dbworth Jan 30, 2016
55e967b
Update README
dbworth Jan 30, 2016
bf5f75e
Update README
dbworth Jan 30, 2016
febfba7
Update README
dbworth Jan 30, 2016
3a9abe3
Update README
dbworth Jan 30, 2016
f27029a
Modify CMakeLists in nxt_description so it doesn't download the tarba…
dbworth Jan 30, 2016
09dbb4a
Add individual mesh files to nxt_description so package is easier to …
dbworth Jan 30, 2016
5a66b57
Merge branch 'fuerte' of https://github.com/dbworth/NXT-ROS into fuerte
dbworth Jan 30, 2016
91a7570
Update README
dbworth Jan 30, 2016
9e54cd4
Remove superfluous mainpage.dox files that were created by default
dbworth Jan 30, 2016
1cd8efe
Merge branch 'fuerte' of https://github.com/dbworth/NXT-ROS into fuerte
dbworth Jan 30, 2016
6c59cc8
Update README
dbworth Jan 31, 2016
656df46
Update README
dbworth Jan 31, 2016
72be9e8
Update README
dbworth Jan 31, 2016
d918c71
Modify nxt_python package to download newer version 1.2.0 of NXT-Pyth…
dbworth Jan 31, 2016
bc34ac3
Add patch for sensor.DigitalSensor() so calls to time() are fully-qua…
dbworth Jan 31, 2016
3f49bc4
Move test script test_sensors.py to same directory as other scripts.
dbworth Jan 31, 2016
a55cda2
Modify patch for sensor.py so calls to sleep() are fully-qualified.
dbworth Jan 31, 2016
b0235da
Update README
dbworth Jan 31, 2016
c8b4772
Update README
dbworth Jan 31, 2016
5a1a79d
Add description to test scripts
dbworth Jan 31, 2016
c0f63c7
Switch to newer NXT-Python v2.2.2
dbworth Jan 31, 2016
fd812a2
Remove old patch file
dbworth Jan 31, 2016
7eccb19
Modify touch_sensor_test.py for NXT-Python v2.2.2
dbworth Jan 31, 2016
7a05003
Modify color_sensor_test.py for NXT-Python v2.2.2
dbworth Jan 31, 2016
768e028
Add new test script light_sensor_test.py
dbworth Jan 31, 2016
cee79f0
Add new test script sound_sensor_test.py
dbworth Jan 31, 2016
aff72ab
Add new test script ultrasonic_sensor_test.py
dbworth Jan 31, 2016
0edaa4a
Remove old test script
dbworth Jan 31, 2016
51a4240
Rename 'sensor_tests' directory to 'test_scripts'
dbworth Jan 31, 2016
62484fa
Add new test script motor_test.py
dbworth Jan 31, 2016
c07ab57
Add new test script play_tone_test.py
dbworth Jan 31, 2016
aba14ed
Fix indenting of test scripts
dbworth Jan 31, 2016
1b77800
Update motor_test.py script to demonstrate how get the motor's positi…
dbworth Feb 4, 2016
6440641
Modify motor support in nxt_ros to work with NXT-Python v2.2.2
dbworth Feb 4, 2016
851ff12
Modify touch sensor support in nxt_ros to work with NXT-Python v2.2.2
dbworth Feb 4, 2016
8e080e7
Modify color sensor support in nxt_ros to work with NXT-Python v2.2.2…
dbworth Feb 4, 2016
139795d
Modify intensity sensor support in nxt_ros to work with NXT-Python v2…
dbworth Feb 4, 2016
03c5007
Populate the 'intensity' field with the color number for color sensor…
dbworth Feb 4, 2016
de32415
Add 'Light' msg for light sensor in nxt_msgs
dbworth Feb 4, 2016
9d42ba3
Add light sensor support to nxt_ros
dbworth Feb 4, 2016
ed0eb8a
Modify ultrasonic range sensor support in nxt_ros to work with NXT-Py…
dbworth Feb 4, 2016
c83b162
Add more sensors to example robot config: nxt_robot.yaml
dbworth Feb 4, 2016
9783285
Update README
dbworth Feb 4, 2016
ee3969f
Update README
dbworth Feb 4, 2016
4668870
Update README
dbworth Feb 5, 2016
e401702
Update README
dbworth Feb 5, 2016
1542335
Disable nxt_rviz_plugin export so Rviz doesn't try to load this plugin
dbworth Feb 5, 2016
dba91d2
Merge branch 'fuerte' of https://github.com/dbworth/NXT-ROS into fuerte
dbworth Feb 5, 2016
9ec0b61
Add patches for nxt_python so utilities in /bin directory can be exec…
dbworth Feb 7, 2016
19be40a
Add MotorControl 2.2 binary which can be copied to NXT Brick for bett…
dbworth Feb 7, 2016
e271fc8
Add new script motor_cont_test.py to test the MotorControl program th…
dbworth Feb 7, 2016
aefad4a
Update README
dbworth Feb 7, 2016
b87572b
Update README
dbworth Feb 7, 2016
621db9e
Modify accelerometer sensor support in nxt_ros to work with NXT-Pytho…
dbworth Feb 8, 2016
aa22313
Merge branch 'fuerte' of https://github.com/dbworth/NXT-ROS into fuerte
dbworth Feb 8, 2016
2941309
Modify gyro sensor support in nxt_ros to work with NXT-Python v2.2.2
dbworth Feb 8, 2016
2fb4635
Update README
dbworth Feb 8, 2016
085b25d
Fix red color value in nxt_ros
dbworth Feb 10, 2016
8f434f1
Update README
dbworth Feb 10, 2016
fa91f4c
Set permissions on motor_cont_test.py to executable
dbworth Feb 10, 2016
d19615c
Fix indenting in ultrasonic_sensor_test.py
dbworth Feb 10, 2016
703d54a
Add patches for nxt_python to fix imports
dbworth Feb 10, 2016
f788eaa
Update README
dbworth Feb 10, 2016
56a05d2
Remove old ROS Electric package nxt_rviz_plugin
dbworth Feb 10, 2016
743f5dc
Add new package nxt_rviz_plugin for ROS Groovy
dbworth Feb 10, 2016
9c96cd5
Update README
dbworth Feb 10, 2016
85c4cc0
kdl -> orocos_kdl
Feb 9, 2017
717f29e
Edit readme for ROS Kinetic
Feb 9, 2017
769bdbf
Update README.md
Jun 2, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
226 changes: 219 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,224 @@
NXT-ROS
=======

A software stack containing tools to interface LEGO Mindstorms with ROS.
A software stack containing tools for using LEGO Mindstorms NXT with ROS.

**ROS Electric**
Originally developed in 2011, it is no longer maintained.
Documentation: [wiki.ros.org/nxt](http://wiki.ros.org/nxt)
Code: http://stack-nxt.foote-ros-pkg.googlecode.com/hg
This branch depends on:<br> &#8226; ROS Kinetic<br> &#8226; Python 2.x<br> &#8226; NXT-Python v2.2.2

**ROS Fuerte**
Forked from http://stack-nxt.foote-ros-pkg.googlecode.com/hg
Originally forked from: http://stack-nxt.foote-ros-pkg.googlecode.com/hg

.

###Documentation
Installation instructions are in this README file.

The original documentation has more detailed information:
[wiki.ros.org/nxt](http://wiki.ros.org/nxt)
[wiki.ros.org/nxt_robots](http://wiki.ros.org/nxt_robots)
[wiki.ros.org/nxt_apps](http://wiki.ros.org/nxt_apps)

###Package status
These packages use `rosbuild` and were tested with ROS Kinetic on Ubuntu 16.04.

The following features have been tested:

**nxt** stack:

- **nxt_controllers**
- **nxt_description**
- **nxt_lxf2urdf**
- **nxt_msgs**
- **nxt_python**
- **nxt_ros**
- **nxt_ros_test**
- **nxt_rviz_plugin**

**nxt_robots** stack:
- **nxt_robot_gyro_car**
- **nxt_robot_kit_test**
- **nxt_robot_sensor_car**

**nxt_apps** stack:
- **nxt_assisted_teleop**
- **nxt_teleop**

.


###Installation

Upgrade the firmware on your NXT brick.
The minimum required version is 1.28, but 1.31 is the latest as of Jan 2016.

Clone the Kinetic branch of this repository:
> cd ~/
> git clone https://github.com/dbworth/NXT-ROS.git --branch kinetic

Copy the 3 stacks into your ROS package path.
Note: you only need the `nxt` stack to get started.
> cp NXT-ROS/nxt $ROS_PACKAGE_PATH
> cp NXT-ROS/nxt_robots $ROS_PACKAGE_PATH
> cp NXT-ROS/nxt_apps $ROS_PACKAGE_PATH

**Install dependencies:**

NXT-Python v2.2.2 is automatically installed in the `/src` directory of the `nxt_python` package when we run `rosmake`.

You can install the other dependencies using the Ubuntu Package Manager or ROSdep:
> sudo apt-get install ogre-1.9-tools ros-kinetic-bfl libcppunit-dev libcppunit-1.13-0v5 ros-kinetic-joy ros-kinetic-robot-pose-ekf ros-kinetic-costmap-2d ros-kinetic-navigation
> sudo apt-get install libbluetooth-dev
> sudo pip install PyBluez PyUSB

Compile the stacks of packages:
> rosmake nxt

Than you will get an *error* while compilling *linest_rviz_plugin*. Thats because of parse error at **"BOOST_JOIN"**. This macros are used to define a namespace name.
I don't know what the right way to fix this but I know two ways to solve it:

1. Add to file, where including file with **"BOOST_JOIN"** inside (like **has_binary_operator.hp**)

Example:
```
#ifndef Q_MOC_RUN
#include <boost/type_traits/detail/has_binary_operator.hp>
#endif
```

But it didn't help me. Mb I used it wrong way.

2. Compile **nxt** by parts.

Compile first part of **nxt** with last **libboost**, then downgrade to **1.48** and continue compiling and then go back to last version and end compiling.
> sudo dpkg -P --force-all libboost-all-dev
> sudo dpkg -P --force-all libboost1.58-dev:amd64
> sudo dpkg -P --force-all libboost1.58-tools-dev

> rosmake nxt

> sudo apt-get update
> sudo apt-get -f install

> rosmake nxt


> rosmake nxt_robots
> rosmake nxt_apps

**Set the USB permissions:**

Add a new group:
> sudo groupadd lego

Add yourself to that group:
> sudo usermod -a -G lego USERNAME

For Ubuntu versions before 12.0, create a udev rules file for the lego group that you just created:
> echo "BUS==\"usb\", ATTRS{idVendor}==\"0694\", GROUP=\"lego\", MODE=\"0660\"" > /tmp/70-lego.rules && sudo mv /tmp/70-lego.rules /etc/udev/rules.d/70-lego.rules

Restart udev:
> sudo system

Log-out or restart your computer.


###Test the installation:

Connect your NXT Brick to the computer via USB cable.
You can run this utility to display information about your Brick:
> $ rosrun nxt_python nxt_test

You should see the following output:
```
NXT brick name: MyBrick
Host address: 00:16:00:00:D3:00
Bluetooth signal strength: 0
Free user flash: 25872
Protocol version 1.124
Firmware version 1.31
Battery level 7602 mV
```

**nxt** stack:

Connect a touch sensor to port 1.
> roscore
> rosrun nxt_python touch_sensor_test.py

When you push the touch sensor, the output on the screen will change.
The node automatically exits are 5 seconds.

Now connect a motor to port A.
> roslaunch nxt_ros_test test.launch

Check the status of the touch sensor using ROS:
> rostopic echo /my_touch_sensor

When you push the touch sensor, the boolean value published in the ROS msg will change.

Read the position of the motor using ROS:
> rostopic echo /joint_states

When you rotate the motor shaft by hand, the position and velocity values published in the ROS msg will change.

Make the motor rotate using ROS:
> rostopic pub /joint_command nxt_msgs/JointCommand '{name: 'motor_joint', effort: 0.8}' --once

The 'effort' value can be in the range 0.0 to 1.25, with +/- to specify the direction.

To stop the motor, set the effort to 0.0:
> rostopic pub /joint_command nxt_msgs/JointCommand '{name: 'motor_joint', effort: 0.0}' --once

**nxt_robots** stack:

Connect motors to Port A and Port B of the NXT Brick.
Connect an ultrasonic sensor to Port 2.
Connect the NXT to your computer.

> roscore

In a new terminal:
> roslaunch nxt_robot_sensor_car robot.launch

In a new terminal:
> rosrun rviz rviz

In Rviz you'll need to set the Fixed Frame to '/base_link'.
Add a RobotModel display so you can visualize the robot.

**nxt_apps** stack:

In a new terminal:
> roslaunch nxt_teleop teleop_keyboard.launch

or
> roslaunch nxt_assisted_teleop assisted_teleop.launch


Use the arrow keys to control the motors.

You can also use a joystick.
Configure the joystick using the instructions here:
http://wiki.ros.org/joy/Tutorials/ConfiguringALinuxJoystick

> roslaunch nxt_teleop teleop_joy.launch

With the Microsoft XBox 360 joystick, you need to hold down the top-left button. The left joystick controls turning, the right joystick goes forward.

**MotorControl** firmware:

[MotorControl](http://www.mindstorms.rwth-aachen.de/trac/wiki/MotorControl) is a program that can be optionally installed on your NXT Brick to provide more accurate control of the motors using python. Instead of sending commands directly to the motor, you send commands to the onboard controller which tracks the status of the motors.

Copy the MotorControl program to your NXT Brick.
You must first change to the directory containing the *.rxe file:
> roscd nxt_python/src/MotorControl/

Connect to your Brick via USB cable and transfer the program binary:

> rosrun nxt_python nxt_push MotorControl22.rxe

Test the controller using the provided test script:
> roscore
> rosrun nxt_python motor_cont_test.py


=============
17 changes: 17 additions & 0 deletions nxt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

# Append to CPACK_SOURCE_IGNORE_FILES a semicolon-separated list of
# directories (or patterns, but directories should suffice) that should
# be excluded from the distro. This is not the place to put things that
# should be ignored everywhere, like "build" directories; that happens in
# rosbuild/rosbuild.cmake. Here should be listed packages that aren't
# ready for inclusion in a distro.
#
# This list is combined with the list in rosbuild/rosbuild.cmake. Note
# that CMake 2.6 may be required to ensure that the two lists are combined
# properly. CMake 2.4 seems to have unpredictable scoping rules for such
# variables.
#list(APPEND CPACK_SOURCE_IGNORE_FILES /core/experimental)

rosbuild_make_distribution(0.1.2)
1 change: 1 addition & 0 deletions nxt/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(shell rospack find mk)/cmake_stack.mk
30 changes: 30 additions & 0 deletions nxt/nxt_controllers/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

# Set the build type. Options are:
# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage
# Debug : w/ debug symbols, w/o optimization
# Release : w/o debug symbols, w/ optimization
# RelWithDebInfo : w/ debug symbols, w/ optimization
# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries
#set(ROS_BUILD_TYPE RelWithDebInfo)

rosbuild_init()

#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

#uncomment if you have defined messages
#rosbuild_genmsg()
#uncomment if you have defined services
#rosbuild_gensrv()

#common commands for building c++ executables and libraries
#rosbuild_add_library(${PROJECT_NAME} src/example.cpp)
#target_link_libraries(${PROJECT_NAME} another_library)
#rosbuild_add_boost_directories()
#rosbuild_link_boost(${PROJECT_NAME} thread)
#rosbuild_add_executable(example examples/example.cpp)
#target_link_libraries(example ${PROJECT_NAME})
1 change: 1 addition & 0 deletions nxt/nxt_controllers/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(shell rospack find mk)/cmake.mk
27 changes: 27 additions & 0 deletions nxt/nxt_controllers/manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<package>
<description brief="nxt_controllers">
The nxt_controllers package provides a number of Python-based
controllers for two-wheeled diff drive robots. The base
controllers allows you to send velocity commands to a diff drive
base, while the base odometry tracks the pose of a diff drive
robot. The nxt_controllers package also contains a general
purpose joint position controller that commnads a joint to a
desired position by sending effort commands to the joint and
reading the joint encoders.
</description>
<author>Wim Meeussen</author>
<license>BSD</license>
<review status="unreviewed" notes=""/>
<url>http://ros.org/wiki/nxt_controllers</url>

<depend package="rospy" />
<depend package="sensor_msgs" />
<depend package="tf" />
<depend package="tf_conversions" />
<depend package="nxt_msgs" />
<depend package="nav_msgs" />
<depend package="orocos_kdl" />

</package>


Loading