-
Notifications
You must be signed in to change notification settings - Fork 3
Steps to Control a robot in Gazebo
In order to be able to run the nodes, it is necessary, at first, clone or install some packages:
- apt-get install libbluetooth-dev
- pip install pyserial
- pip install pybluez
- If you use python 2.7 install : pip install enum34
$ mkdir catkin_ws
$ cd catkin_ws
$ mkdir src
$ cd src
$ catkin_init_workspace
$ git clone https://github.com/osrf/gsoc-ros-neural.git
$ cd ~/catkin_ws
$ catkin_make
$ source dev/setup.bash
I have created a little demo.
The EEG headset I am using to analyze my brainwaves is the Neurosky Mindwave Mobile.
Run the launch file and be sure pair your bluetooth usb dongle with your Ubunto before run and change by your mac address of Mindwave Mobile headset:
$ roslaunch mindwave_driver bluetooth_start.launch addr:=20:68:9D:70:CA:96
I am working with virtual robots you need to install Gazebo simulator. Open other terminal
$ sudo apt-get install ros-indigo-turtlebot-simulator
run a world into Gazebo
$ source /opt/ros/indigo/setup.bash
$ roslaunch turtlebot_gazebo turtlebot_world.launch
To move a robot If I Concentrate the robot goes fordward, If I meditate the robot turn to left.
You need to trigger the right signals in your mind to control a robot.
- Meditation produces alpha waves (frequency range: 7.5-12.5 Hz)
- attention produces beta waves (frequency range: 12.5-30 Hz)
Now you need to turn headset it and run launch file in other terminal:
$ roslaunch mindwave_driver bluetooth_start.launch addr:=20:68:9D:70:CA:96
It will launch and run nodes with a topic called /mindwave
.
Then you need to start the teleoperation package to traduce your medittation and concentration values to angular and lineal velocities.
$ roslaunch mindwave_teleop turtle_teleop.launch
If you want to adjust threshold levels you can change it in turtle_teleop.launch
file. These values are important to move any robot, for example when you raise meditation_threshold values more higher than 70 the robot turns to left with a angular velocity of 1.5.
<launch>
<arg name="addr" />
<node name="mindwave" pkg="mindwave_driver" type="mindwave_node.py" output="screen">
<param name="addr" value="$(arg addr)" />
</node>
<node pkg="mindwave_teleop" type="turtlebot_teleop_mindwave.py" name="turtle_teleop_mindwave" output="screen">
<param name="scale_linear" value="0.5" type="double"/>
<param name="scale_angular" value="1.5" type="double"/>
<param name="meditation_threshold" value="70" type="int"/>
<param name="attention_threshold" value="30" type="int"/>
<remap from="turtle_teleop_mindwave/cmd_vel" to="cmd_vel_mux/input/teleop"/>
</node>
</launch>