NMAI-lab / saviRoomba

Integration of BDI with the iRobot Create (Roomba) robot.
1 stars 0 forks source link

Bluetooth Beacons #11

Closed Simon-Yacoub closed 3 years ago

Simon-Yacoub commented 3 years ago

1.Clone https://github.com/Carleton-Autonomous-Mail-Robot/distance-from-rssi

  1. Place Beacon exactly 1m away from the device that will be doing the measurements (1m from the measuring devices bluetooth antenna is preferred)
  2. Install bluepy: sudo pip3 install bluepy 4.Run RSSI_tools.py: python3 RSSI_tools.py
  3. Follow on screen instructions
  4. Create a new line entry in beacons which matches the information shown on screen.

Issue @ 4. Syntax error with "raw_input(...)" changed to "input()" and it ran. After running I get the following run time error:

Input: Enter MAC Address: fc:e2:2e:62:9b How much space do you have in meters?: 1 Calculate measured value? y or n : y Place at 1m then press enter

Out: Traceback (most recent call last): File "RSSI_tools.py", line 107, in tools.calculate_measured(mac) File "RSSI_tools.py", line 71, in calculate_measured RSSI = self.read_RSSI(MAC) File "RSSI_tools.py", line 17, in read_RSSI ble_list = Scanner().scan(0.5) File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 852, in scan self.start(passive=passive) File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 790, in start self._mgmtCmd("le on") File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 312, in _mgmtCmd raise BTLEManagementError("Failed to execute management command '%s'" % (cmd), rsp) bluepy.btle.BTLEManagementError: Failed to execute management command 'le on' (code: 20, error: Permission Denied)

Simon-Yacoub commented 3 years ago

Solution:

  1. In a terminal: $ sudo su
  2. source devel_isolated/setup.bash
  3. rosrun roomba driverBluetooth.py