Skip to content

Running The Code

Tyler Burnham edited this page Aug 31, 2016 · 2 revisions

The following sections will provide information on running the code once it has been installed correctly.

Launching Ros across Multiple Computers

Login Raspberry Pi

Password is found on the Default Credentials Page

Start the Raspberry Pi Code

After the Raspberry PI has logged in run the following commands

cd ~/MercerSubProject
export ROS_IP=192.168.1.XXX
export ROS_MASTER_URI="http://192.168.1.XXX:11311"
roslaunch sub_message normal_start.launch

Sending Commands to the Pi

On the command computer open a terminal and type

cd ~/MercerSubProject
export ROS_IP=192.168.1.XXX
export ROS_MASTER_URI="http://192.168.1.XXX:11311"
source tests/simpleMotorTestPause.sh

Launching RQT Graph

Open an new console ensure the ROS_IP and ROS_MASTER_URI

rosrun rqt_graph rqt_graph

Here is an example RQT Graph.

Individually Launching ROS Nodes

Use the Rosrun Command:
Talker Node

rosrun sub_message talker.py movt .2 .2 .2 5
rosrun sub_message talker.py rottt -.2 -.2 -.2 5
rosrun sub_message talker.py pause 5
rosrun sub_message talker.py next
rosrun sub_message talker.py clear

Listen Node

rosrun sub_message listener.py  

Commander

rosrun sub_message commander.py  

Rosserial

rosrun rosserial_python serial_node.py /dev/ttyACM0

Note: ROS Nodes must run on individual console instances. Note 2: (Control) + (C) terminates the Node.

Listening to ROS Topics

You can see messages moving through the system by using the rostopic command: rostopic list - Returns a list of the current topics

/arduino_move
/commander
/rosout
/rosout_agg
rostopic echo /arduino_move
xLeft: 0
xRight: 0
yFront: 0
yBack: 0
zTop: 0
zBottom: 0

Clone this wiki locally