当前位置: 首页>>代码示例>>Python>>正文


Python rospy.get_param方法代码示例

本文整理汇总了Python中rospy.get_param方法的典型用法代码示例。如果您正苦于以下问题:Python rospy.get_param方法的具体用法?Python rospy.get_param怎么用?Python rospy.get_param使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rospy的用法示例。


在下文中一共展示了rospy.get_param方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import rospy [as 别名]
# 或者: from rospy import get_param [as 别名]
def __init__(self):
    #############################################################
        rospy.init_node("twist_to_motors")
        nodename = rospy.get_name()
        rospy.loginfo("%s started" % nodename)
    
        self.w = rospy.get_param("~base_width", 0.2)
    
        self.pub_lmotor = rospy.Publisher('lwheel_vtarget', Float32, queue_size=10)
        self.pub_rmotor = rospy.Publisher('rwheel_vtarget', Float32, queue_size=10)
        rospy.Subscriber('twist', Twist, self.twistCallback)
    
    
        self.rate = rospy.get_param("~rate", 50)
        self.timeout_ticks = rospy.get_param("~timeout_ticks", 2)
        self.left = 0
        self.right = 0
        
    ############################################################# 
开发者ID:jfstepha,项目名称:differential-drive,代码行数:21,代码来源:twist_to_motors.py

示例2: main

# 需要导入模块: import rospy [as 别名]
# 或者: from rospy import get_param [as 别名]
def main():
##########################################################################
##########################################################################
    rospy.init_node('virtual_joystick')
    rospy.loginfo('virtual_joystick started')
    global x_min
    global x_max
    global r_min
    global r_max
    
    x_min = rospy.get_param("~x_min", -0.20)
    x_max = rospy.get_param("~x_max", 0.20)
    r_min = rospy.get_param("~r_min", -1.0)
    r_max = rospy.get_param("~r_max", 1.0)
    
    app = QtGui.QApplication(sys.argv)
    ex = MainWindow()
    sys.exit(app.exec_()) 
开发者ID:jfstepha,项目名称:differential-drive,代码行数:20,代码来源:virtual_joystick.py

示例3: scaleWheel

# 需要导入模块: import rospy [as 别名]
# 或者: from rospy import get_param [as 别名]
def scaleWheel():
    rospy.init_node("wheel_scaler")
    rospy.loginfo("wheel_scaler started")
    
    scale = rospy.get_param('distance_scale', 1)
    rospy.loginfo("wheel_scaler scale: %0.2f", scale)
    
    rospy.Subscriber("lwheel", Int16, lwheelCallback)
    rospy.Subscriber("rwheel", Int16, rwheelCallback)
    
    lscaled_pub = rospy.Publisher("lwheel_scaled", Int16, queue_size=10)
    rscaled_pub = rospy.Publisher("rwheel_scaled", Int16, queue_size=10) 
    
    ### testing sleep CPU usage
    r = rospy.Rate(50) 
    while not rospy.is_shutdown:
        r.sleep()
        
    rospy.spin() 
开发者ID:jfstepha,项目名称:differential-drive,代码行数:21,代码来源:wheel_scaler.py

示例4: __init__

# 需要导入模块: import rospy [as 别名]
# 或者: from rospy import get_param [as 别名]
def __init__(self):
        """
        Create HeadLiftJoy object.

        """
        # params
        self._head_axes = rospy.get_param('~head_axes', 3)
        self._lift_axes = rospy.get_param('~lift_axes', 3)
        self._head_button = rospy.get_param('~head_button', 4)
        self._lift_button = rospy.get_param('~lift_button', 5)

        # pubs
        self._head_pub = rospy.Publisher('head_angle', Float64, queue_size=1)
        self._lift_pub = rospy.Publisher('lift_height', Float64, queue_size=1)

        # subs
        self._joy_sub = rospy.Subscriber('joy', Joy, self._joy_cb, queue_size=1) 
开发者ID:OTL,项目名称:cozmo_driver,代码行数:19,代码来源:head_lift_joy.py

示例5: __init__

# 需要导入模块: import rospy [as 别名]
# 或者: from rospy import get_param [as 别名]
def __init__(self):
        # setup
        CozmoTeleop.settings = termios.tcgetattr(sys.stdin)
        atexit.register(self.reset_terminal)

        # vars
        self.head_angle = STD_HEAD_ANGLE
        self.lift_height = STD_LIFT_HEIGHT

        # params
        self.lin_vel = rospy.get_param('~lin_vel', 0.2)
        self.ang_vel = rospy.get_param('~ang_vel', 1.5757)

        # pubs
        self._head_pub = rospy.Publisher('head_angle', Float64, queue_size=1)
        self._lift_pub = rospy.Publisher('lift_height', Float64, queue_size=1)
        self._cmd_vel_pub = rospy.Publisher('cmd_vel', Twist, queue_size=1) 
开发者ID:OTL,项目名称:cozmo_driver,代码行数:19,代码来源:teleop_key.py

示例6: __init__

# 需要导入模块: import rospy [as 别名]
# 或者: from rospy import get_param [as 别名]
def __init__(self):
        rospy.loginfo("Tianbot Racecar JoyTeleop Initializing...")
        self._twist = Twist()
        self._twist.linear.x = 1500
        self._twist.angular.z = 90
        self._deadman_pressed = False
        self._zero_twist_published = False

        self._cmd_vel_pub = rospy.Publisher('~/car/cmd_vel', Twist, queue_size=5)
        self._joy_sub = rospy.Subscriber('/joy', Joy, self.joy_callback)
        self._timer = rospy.Timer(rospy.Duration(0.05), self.joystick_controller)
        self._axis_throttle = 1

        _joy_mode = rospy.get_param("~joy_mode", "D").lower()
        if _joy_mode == "d":
            self._axis_servo = 2
        if _joy_mode == "x":
            self._axis_servo = 3

        self._throttle_scale = rospy.get_param("~throttle_scale", 0.5)
        self._servo_scale = rospy.get_param("~servo_scale", 1) 
开发者ID:tianbot,项目名称:tianbot_racecar,代码行数:23,代码来源:racecar_joy.py

示例7: get_parameters

# 需要导入模块: import rospy [as 别名]
# 或者: from rospy import get_param [as 别名]
def get_parameters(self):
        """
        Gets the necessary parameters from parameter server

        Args:

        Returns:
        (tuple) (camera_topic,  output_topic, recognition_interval,
        buffer_size)

        """

        camera_topic = rospy.get_param("~camera_topic")
        output_topic = rospy.get_param("~output_topic")
        recognition_interval = rospy.get_param("~recognition_interval")
        buffer_size = rospy.get_param("~buffer_size")

        return (camera_topic, output_topic,
            recognition_interval, buffer_size) 
开发者ID:cagbal,项目名称:ros_people_object_detection_tensorflow,代码行数:21,代码来源:action_recognition.py

示例8: get_parameters

# 需要导入模块: import rospy [as 别名]
# 或者: from rospy import get_param [as 别名]
def get_parameters(self):
        """
        Gets the necessary parameters from parameter server

        Args:

        Returns:
        (tuple) (model name, num_of_classes, label_file)

        """

        model_name  = rospy.get_param("~model_name")
        num_of_classes  = rospy.get_param("~num_of_classes")
        label_file  = rospy.get_param("~label_file")
        camera_namespace  = rospy.get_param("~camera_namespace")
        video_name = rospy.get_param("~video_name")
        num_workers = rospy.get_param("~num_workers")

        return (model_name, num_of_classes, label_file, \
                camera_namespace, video_name, num_workers) 
开发者ID:cagbal,项目名称:ros_people_object_detection_tensorflow,代码行数:22,代码来源:cob_people_object_detection_tensorflow.py

示例9: get_parameters

# 需要导入模块: import rospy [as 别名]
# 或者: from rospy import get_param [as 别名]
def get_parameters(self):
        """
        Gets the necessary parameters from parameter server

        Args:

        Returns:
        (tuple) (camera_topic, detection_topic, output_topic)

        """

        camera_topic = rospy.get_param("~camera_topic")
        detection_topic = rospy.get_param("~detection_topic")
        output_topic = rospy.get_param("~output_topic")
        output_topic_rgb = rospy.get_param("~output_topic_rgb")

        return (camera_topic, detection_topic, output_topic, output_topic_rgb) 
开发者ID:cagbal,项目名称:ros_people_object_detection_tensorflow,代码行数:19,代码来源:face_recognizer.py

示例10: get_parameters

# 需要导入模块: import rospy [as 别名]
# 或者: from rospy import get_param [as 别名]
def get_parameters(self):
        """
        Gets the necessary parameters from parameter server

        Args:

        Returns:
        (tuple) (camera_topic, detection_topic, tracker_topic, cost_threhold)

        """

        detection_topic = rospy.get_param("~detection_topic")
        tracker_topic = rospy.get_param('~tracker_topic')
        cost_threhold = rospy.get_param('~cost_threhold')
        min_hits = rospy.get_param('~min_hits')
        max_age = rospy.get_param('~max_age')

        return (detection_topic, tracker_topic, cost_threhold, \
            max_age, min_hits) 
开发者ID:cagbal,项目名称:ros_people_object_detection_tensorflow,代码行数:21,代码来源:tracker.py

示例11: get_parameters

# 需要导入模块: import rospy [as 别名]
# 或者: from rospy import get_param [as 别名]
def get_parameters(self):
        """
        Gets the necessary parameters from parameter server

        Returns:
        (tuple) :
            depth_topic (String): Incoming depth topic name
            face_topic (String): Incoming face bounding box topic name
            output_topic (String): Outgoing depth topic name
            f (Float): Focal Length
            cx (Int): Principle Point Horizontal
            cy (Int): Principle Point Vertical
        """

        depth_topic  = rospy.get_param("~depth_topic")
        face_topic = rospy.get_param('~face_topic')
        output_topic = rospy.get_param('~output_topic')
        f = rospy.get_param('~focal_length')
        cx = rospy.get_param('~cx')
        cy = rospy.get_param('~cy')

        return (depth_topic, face_topic, output_topic, f, cx, cy) 
开发者ID:cagbal,项目名称:ros_people_object_detection_tensorflow,代码行数:24,代码来源:projection.py

示例12: __init__

# 需要导入模块: import rospy [as 别名]
# 或者: from rospy import get_param [as 别名]
def __init__(self):
        # Audio stream input setup
        FORMAT = pyaudio.paInt16
        CHANNELS = 1
        RATE = 16000
        self.CHUNK = 4096
        self.audio = pyaudio.PyAudio()
        self.stream = self.audio.open(format=FORMAT, channels=CHANNELS,
                                      rate=RATE, input=True,
                                      frames_per_buffer=self.CHUNK,
                                      stream_callback=self._get_data)
        self._buff = Queue.Queue()  # Buffer to hold audio data
        self.closed = False

        # ROS Text Publisher
        text_topic = rospy.get_param('/text_topic', '/dialogflow_text')
        self.text_pub = rospy.Publisher(text_topic, String, queue_size=10) 
开发者ID:piraka9011,项目名称:dialogflow_ros,代码行数:19,代码来源:mic_client.py

示例13: __init__

# 需要导入模块: import rospy [as 别名]
# 或者: from rospy import get_param [as 别名]
def __init__(self):
        FORMAT = pyaudio.paInt16
        CHANNELS = 1
        RATE = 16000
        CHUNK = 4096
        self.audio = pyaudio.PyAudio()
        self.stream = self.audio.open(format=FORMAT, channels=CHANNELS, rate=RATE,
                                      input=True, frames_per_buffer=CHUNK,
                                      stream_callback=self._callback)
        self.serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.read_list = [self.serversocket]

        self._server_name = rospy.get_param('/dialogflow_client/server_name',
                                            '127.0.0.1')
        self._port = rospy.get_param('/dialogflow_client/port', 4444)

        rospy.loginfo("DF_CLIENT: Audio Server Started!") 
开发者ID:piraka9011,项目名称:dialogflow_ros,代码行数:19,代码来源:audio_server.py

示例14: __init__

# 需要导入模块: import rospy [as 别名]
# 或者: from rospy import get_param [as 别名]
def __init__(self):
    #############################################################
        rospy.init_node("twist_to_motors")
        nodename = rospy.get_name()
        rospy.loginfo("%s started" % nodename)
    
        self.w = rospy.get_param("~base_width", 0.2)
    
        self.pub_lmotor = rospy.Publisher('lwheel_vtarget', Float32,queue_size=10)
        self.pub_rmotor = rospy.Publisher('rwheel_vtarget', Float32,queue_size=10)
        rospy.Subscriber('cmd_vel_mux/input/teleop', Twist, self.twistCallback)
    
    
        self.rate = rospy.get_param("~rate", 50)
        self.timeout_ticks = rospy.get_param("~timeout_ticks", 2)
        self.left = 0
        self.right = 0
        
    ############################################################# 
开发者ID:PacktPublishing,项目名称:ROS-Programming-Building-Powerful-Robots,代码行数:21,代码来源:twist_to_motors.py

示例15: _InitializeDriveGeometry

# 需要导入模块: import rospy [as 别名]
# 或者: from rospy import get_param [as 别名]
def _InitializeDriveGeometry(self):
		wheelDiameter = rospy.get_param("~driveGeometry/wheelDiameter", "0.9")
		trackWidth = rospy.get_param("~driveGeometry/trackWidth", "0.1")
		countsPerRevolution = rospy.get_param("~driveGeometry/countsPerRevolution", "2000")
		

		wheelDiameter= wheelDiameter * 1000
		trackWidth=trackWidth * 1000


		#countsPerRevolution=countsperRevolution*1000;
		#wheelDiameterParts = self._GetBaseAndExponent(wheelDiameter)
		#trackWidthParts = self._GetBaseAndExponent(trackWidth)

		message = 'dg %d %d %d\r' % (int(wheelDiameter), int(trackWidth), int(countsPerRevolution))
		rospy.logdebug("Sending drive geometry params message: " + message)
		self._WriteSerial(message) 
开发者ID:PacktPublishing,项目名称:ROS-Programming-Building-Powerful-Robots,代码行数:19,代码来源:arduino.py


注:本文中的rospy.get_param方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。