THIS REPO IS NOT FUNCTIONAL, PLEASE REFER TO THIS REPOSITORY INSTEAD
An app that can teleoperate a racecar or serve as a joy controller for ROS purposes. It publishes joy messages and string messages and also recieves Int32 messages. The joy messages published are based off the Logitech Wireless Gamepad F710 (DirectInput Mode).
- Swift 4
- iOS 8+
- ROSbridge
- Clone the repository
- Go to the project's directory and type:
pod install
- Get rosbridge on your robot by cloning the rosbridge repository
- Open a command terminal and type:
roslaunch rosbridge_server rosbridge_websocket.launch
- Make sure your phone and your robot are connected to the same wifi
- Open the app
- Click on the host button. Input the IP Adress of your wifi followed by a colon and the port rosbridge is connected to. The default port rosbridge connects to is 9090, which you can edit in the launch file. Below is an example: 123.45.67.89:9090
- If the connect button turns red, then you've successfully established connection. Otherwise, something is wrong with the connection. If it fails with the following error:
Problem of md5sum warning when web is refreshed
Comment out lines 321-325 in rosbridge_library/pulibhser.py:
def _unregister_impl(self, topic):
if not self._publishers[topic].has_clients():
self._publishers[topic].unregister()
del self._publishers[topic]
del self.unregister_timers[topic]
More info can be found here: RobotWebTools/rosbridge_suite#138 7. To actually use the app, you will have to launch the file you use for your robot
The app publishes joy messages and string messages and also recieves Int32 messages. The app has three publishers total, each having a different function.
-
Racecar publisher
- It publishes joy messages to your robot. The joy messages published can be accessed via viewController.swift
- The direction pad will be upgraded to a joystick
-
Debug publisher
- If your robot doesn't move after being connected, this publisher publishes strings indicating what directional buttons were pressed:
- Up button: "Up button pressed"
- Down button: "Down button pressed"
- Left button: "Left button pressed"
- Right button: "Right button pressed"
-
April Tag publisher
- Sends string messages to the april tag topic. It can be used for any purpose. It publishes messages when the publish message is clicked on the controller screen.
This app subscribes to a topic with the Int32 message type. It is used to generate a log of april tags, which can be viewed in the april tags tab. More information on April Tags here: https://april.eecs.umich.edu/software/apriltag.html
You can change topics to publish from the 'Publishers and Subscribers' tab. However, this can only be done when you are disconnected from your robot. As of now, you will have to manually input the topics you want every time you quit and reopen the app.
On the robot controller screen, you can toggle between 'Off', 'Teleop' and 'Auto'. They publish the following joy.button messages:
- Off: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
- Teleop: [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]
- Auto: [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0]
Brandon Man, [email protected] Research intern at MIT CSAIL, student at Cate School, CA
I used RBS Manager for this project. Thanks goes to @wesgood for creating RBS Manager.
The MRG Racecar App is available under the MIT license. See the LICENSE file for more info.