Jupyter Notebook [Melodic]
Last updated
Last updated
Run the below code in terminal to install
Remember the robot's password is the single digit number "1".
After installing, upgrade pip by running the below command in the terminal shell.
Next, we install jupyter, matplotib, pandas, and numpy by running the below command in the terminal shell. This may take a while.
In the command line, run the below line to open Jupyter Notebook. Jupyter Notebook is a __ that will run on your browser.
Running the command, you should see output like above, before being redirected to a webpage like the image below.
Next, navigate to the Documents folder and press the "New" button like below. Then press "Python 2" to create a new Python 2 script.
Import necessary libaries -- rospy to control all ROS-based functions in Python, and Twist and Point datatypes of geometry_msgs.msg
Initialize necessary variables. Instantiating speed as a variable of the Twist datatype, initializing a rosnode called "test_cmd_vel", setting the rate (how frequently to run the program) to 100, and initialize a publisher to the /cmd_vel topic of Twist datatype called pub.
Next, set speed in the x-direction to 0.5
Next, type the below three lines to move the robot.
Press the square to stop the robot.
To check the battery state of the R1mini, run the below code.
The output should look like the image above.
To change the colors of the LED at the front of the robot, enter the below code into the a code block. The below code sets the LEDs to an RGB value of 250, 50, 50. You can change what color you would like by adjusting the RGB values in line 4.
To see a a video demonstration for this page, check out this link: https://www.youtube.com/watch?v=LY0JIf_0XQ4