Public Member Functions | Public Attributes | Static Private Member Functions | Private Attributes | List of all members
ds4_driver.controller_ros.ControllerRos Class Reference
Inheritance diagram for ds4_driver.controller_ros.ControllerRos:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self)
 
def cb_feedback (self, msg)
 
def cb_joy_feedback (self, msg)
 
def cb_joy_pub_timer (self, _)
 
def cb_report (self, report)
 
def cb_stop_rumble (self, event)
 
- Public Member Functions inherited from ds4_driver.controller.Controller
def __init__ (self)
 
def cleanup_device (self)
 
def control (self, led_red=None, led_green=None, led_blue=None, rumble_small=None, rumble_big=None, flash_on=None, flash_off=None)
 
def exit (self)
 
def fire_event (self, event, args)
 
def read_report (self)
 
def run (self)
 
def setup_device (self, device)
 

Public Attributes

 deadzone
 
 frame_id
 
 imu_frame_id
 
 pub_battery
 
 pub_imu
 
 pub_joy
 
 pub_report
 
 pub_status
 
 sub_feedback
 
 use_standard_msgs
 
- Public Attributes inherited from ds4_driver.controller.Controller
 device
 
 loop
 

Static Private Member Functions

def _normalize_axis_ (val, deadzone=0.0)
 
def _report_to_status_ (report_msg, deadzone=0.05)
 
def _status_to_battery_ (status)
 
def _status_to_imu_ (status)
 
def _status_to_joy_ (status)
 

Private Attributes

 _autorepeat_rate
 
 _prev_joy
 

Additional Inherited Members

- Static Public Member Functions inherited from ds4_driver.controller.Controller
def get_imu_data (report)
 
- Static Public Attributes inherited from ds4_driver.controller.Controller
int BATTERY_FULL_CHARGING = 11
 
int BATTERY_MAX = 8
 
float MAX_VOLTAGE = 3.65
 
int TOUCHPAD_MAX_X = 1919
 
int TOUCHPAD_MAX_Y = 942
 

Detailed Description

Definition at line 17 of file controller_ros.py.

Constructor & Destructor Documentation

◆ __init__()

def ds4_driver.controller_ros.ControllerRos.__init__ (   self)

Definition at line 18 of file controller_ros.py.

Member Function Documentation

◆ _normalize_axis_()

def ds4_driver.controller_ros.ControllerRos._normalize_axis_ (   val,
  deadzone = 0.0 
)
staticprivate
Convert a value of [0, 255] to [-1.0, 1.0]
:param val:
:param deadzone:
:return:

Definition at line 228 of file controller_ros.py.

◆ _report_to_status_()

def ds4_driver.controller_ros.ControllerRos._report_to_status_ (   report_msg,
  deadzone = 0.05 
)
staticprivate

Definition at line 161 of file controller_ros.py.

◆ _status_to_battery_()

def ds4_driver.controller_ros.ControllerRos._status_to_battery_ (   status)
staticprivate
Converts a ds4_driver/Status to sensor_msgs/BatteryState
Reference: https://www.psdevwiki.com/ps4/DualShock_4#Specifications
:param status:
:type status: Status
:return:

Definition at line 282 of file controller_ros.py.

◆ _status_to_imu_()

def ds4_driver.controller_ros.ControllerRos._status_to_imu_ (   status)
staticprivate
Converts a ds4_driver/Status to sensor_msgs/Imu
:param status:
:type status: Status
:return:

Definition at line 308 of file controller_ros.py.

◆ _status_to_joy_()

def ds4_driver.controller_ros.ControllerRos._status_to_joy_ (   status)
staticprivate
Converts a ds4_driver/Status message to sensor_msgs/Joy
:param status:
:type status: Status
:return:

Definition at line 242 of file controller_ros.py.

◆ cb_feedback()

def ds4_driver.controller_ros.ControllerRos.cb_feedback (   self,
  msg 
)
Callback method for ds4_driver/Feedback
:param msg:
:type msg: Feedback
:return:

Definition at line 87 of file controller_ros.py.

◆ cb_joy_feedback()

def ds4_driver.controller_ros.ControllerRos.cb_joy_feedback (   self,
  msg 
)
Callback method for sensor_msgs/JoyFeedbackArray
The message contains the following feedback:
LED0: red
LED1: green
LED2: blue
RUMBLE0: rumble small
RUMBLE1: rumble big
:param msg:
:type msg: JoyFeedbackArray
:return:

Definition at line 124 of file controller_ros.py.

◆ cb_joy_pub_timer()

def ds4_driver.controller_ros.ControllerRos.cb_joy_pub_timer (   self,
  _ 
)

Definition at line 156 of file controller_ros.py.

◆ cb_report()

def ds4_driver.controller_ros.ControllerRos.cb_report (   self,
  report 
)
Callback method for ds4drv event loop
:param report:
:return:

Definition at line 44 of file controller_ros.py.

◆ cb_stop_rumble()

def ds4_driver.controller_ros.ControllerRos.cb_stop_rumble (   self,
  event 
)

Definition at line 117 of file controller_ros.py.

Member Data Documentation

◆ _autorepeat_rate

ds4_driver.controller_ros.ControllerRos._autorepeat_rate
private

Definition at line 26 of file controller_ros.py.

◆ _prev_joy

ds4_driver.controller_ros.ControllerRos._prev_joy
private

Definition at line 27 of file controller_ros.py.

◆ deadzone

ds4_driver.controller_ros.ControllerRos.deadzone

Definition at line 22 of file controller_ros.py.

◆ frame_id

ds4_driver.controller_ros.ControllerRos.frame_id

Definition at line 23 of file controller_ros.py.

◆ imu_frame_id

ds4_driver.controller_ros.ControllerRos.imu_frame_id

Definition at line 24 of file controller_ros.py.

◆ pub_battery

ds4_driver.controller_ros.ControllerRos.pub_battery

Definition at line 32 of file controller_ros.py.

◆ pub_imu

ds4_driver.controller_ros.ControllerRos.pub_imu

Definition at line 34 of file controller_ros.py.

◆ pub_joy

ds4_driver.controller_ros.ControllerRos.pub_joy

Definition at line 33 of file controller_ros.py.

◆ pub_report

ds4_driver.controller_ros.ControllerRos.pub_report

Definition at line 31 of file controller_ros.py.

◆ pub_status

ds4_driver.controller_ros.ControllerRos.pub_status

Definition at line 41 of file controller_ros.py.

◆ sub_feedback

ds4_driver.controller_ros.ControllerRos.sub_feedback

Definition at line 35 of file controller_ros.py.

◆ use_standard_msgs

ds4_driver.controller_ros.ControllerRos.use_standard_msgs

Definition at line 21 of file controller_ros.py.


The documentation for this class was generated from the following file:


ds4_driver
Author(s): Naoki Mizuno
autogenerated on Fri May 1 2020 03:59:34