joy_rviz_view_controller.py
Go to the documentation of this file.
1 # joy_rviz_view_controller
2 
3 from jsk_teleop_joy.plugin.rviz_view_controller_singleton import RVizViewControllerManagerSingleton
4 from jsk_teleop_joy.joy_plugin import JSKJoyPlugin
5 
6 import rospy
7 
9  '''
10 Usage:
11 Right Analog x/y: yaw/pitch of camera position
12 
13 R3(Right Analog button): while holding down L3 button, buttons/sticks listed below work for RVizViewController
14  L3: reset camera pose
15  L1: set focus point to target pose of Pose6D
16  Up/Down/Left/Right : move focus point x/y
17  Left Analog y: move camera for eye direction (near/far)
18  Left Analog x: move focus point for eye direction (near/far)
19  R3 + L2 + R2: enable follow view mode
20 
21 Args:
22 control_view [Boolean, default: True]: Use or not control rviz camera (this is for child class)
23 
24 Note: code of joyCB is implemented in rviz_view_controller_singleton.py
25  Use TabletViewController(jsk_rviz_plugin) in rviz (selected at 'Views' Panel)
26  '''
27  def __init__(self, name, args):
28  JSKJoyPlugin.__init__(self, name, args)
29  self.control_view = self.getArg('control_view', True)
30  if not self.control_view:
31  rospy.loginfo("Not using rviz view control")
32  RVizViewControllerManagerSingleton.camera_pub.unregister()
33  RVizViewControllerManagerSingleton.camera_sub.unregister()
34  def joyCB(self, status, history):
35  RVizViewControllerManagerSingleton.joyCB(status, history, self.pre_pose)
36  def supportFollowView(self, val):
37  RVizViewControllerManagerSingleton.support_follow_view = val
38  def followView(self, val=None):
39  if val != None:
40  RVizViewControllerManagerSingleton.follow_view = val
41  return RVizViewControllerManagerSingleton.follow_view
def getArg(self, key, default=None)
Definition: joy_plugin.py:19


jsk_teleop_joy
Author(s): Ryohei Ueda
autogenerated on Sun May 28 2023 03:03:37