|
From: <j_b...@us...> - 2009-07-16 01:32:15
|
Revision: 18942
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=18942&view=rev
Author: j_bohren
Date: 2009-07-16 01:32:09 +0000 (Thu, 16 Jul 2009)
Log Message:
-----------
Moving writing test and adding trex package for writing executive.
Modified Paths:
--------------
pkg/trunk/stacks/trex/trex_pr2_writing_test/CMakeLists.txt
pkg/trunk/stacks/trex/trex_pr2_writing_test/manifest.xml
Added Paths:
-----------
pkg/trunk/stacks/trex/trex_pr2_writing_core/
pkg/trunk/stacks/trex/trex_pr2_writing_core/CMakeLists.txt
pkg/trunk/stacks/trex/trex_pr2_writing_core/Makefile
pkg/trunk/stacks/trex/trex_pr2_writing_core/cfg/
pkg/trunk/stacks/trex/trex_pr2_writing_core/doc/
pkg/trunk/stacks/trex/trex_pr2_writing_core/doc/writing_master.dia
pkg/trunk/stacks/trex/trex_pr2_writing_core/include/
pkg/trunk/stacks/trex/trex_pr2_writing_core/include/trex_pr2_writing_core/
pkg/trunk/stacks/trex/trex_pr2_writing_core/include/trex_pr2_writing_core/adapter_utilities.h
pkg/trunk/stacks/trex/trex_pr2_writing_core/include/trex_pr2_writing_core/adapters.h
pkg/trunk/stacks/trex/trex_pr2_writing_core/include/trex_pr2_writing_core/master_reactor.h
pkg/trunk/stacks/trex/trex_pr2_writing_core/manifest.xml
pkg/trunk/stacks/trex/trex_pr2_writing_core/nddl/
pkg/trunk/stacks/trex/trex_pr2_writing_core/nddl/master/
pkg/trunk/stacks/trex/trex_pr2_writing_core/nddl/master/imports.nddl
pkg/trunk/stacks/trex/trex_pr2_writing_core/nddl/master/master.nddl
pkg/trunk/stacks/trex/trex_pr2_writing_core/src/
pkg/trunk/stacks/trex/trex_pr2_writing_core/src/adapter_utilities.cpp
pkg/trunk/stacks/trex/trex_pr2_writing_core/src/adapters.cpp
pkg/trunk/stacks/trex/trex_pr2_writing_core/src/components.cpp
pkg/trunk/stacks/trex/trex_pr2_writing_core/src/main.cpp
pkg/trunk/stacks/trex/trex_pr2_writing_core/src/master_reactor.cpp
pkg/trunk/stacks/trex/trex_pr2_writing_core/src/stub_ros_container.cpp
pkg/trunk/stacks/trex/trex_pr2_writing_core/srv/
pkg/trunk/stacks/trex/trex_pr2_writing_core/srv/ExecuteGoals.srv
pkg/trunk/stacks/trex/trex_pr2_writing_test/
pkg/trunk/stacks/trex/trex_pr2_writing_test/launch/controllers.launch
Removed Paths:
-------------
pkg/trunk/highlevel/writing/writing_test/
pkg/trunk/stacks/trex/trex_pr2_writing_test/launch/controllers.launch
Added: pkg/trunk/stacks/trex/trex_pr2_writing_core/CMakeLists.txt
===================================================================
--- pkg/trunk/stacks/trex/trex_pr2_writing_core/CMakeLists.txt (rev 0)
+++ pkg/trunk/stacks/trex/trex_pr2_writing_core/CMakeLists.txt 2009-07-16 01:32:09 UTC (rev 18942)
@@ -0,0 +1,43 @@
+cmake_minimum_required(VERSION 2.4.6)
+include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
+#set(ROS_BUILD_TYPE Release)
+rospack(trex_pr2_writing_core)
+
+genmsg()
+gensrv()
+
+rospack_add_boost_directories()
+
+###############################################################################
+# NDDL Include Macro
+###############################################################################
+
+# This generates the NDDL inclue configuration file
+find_ros_package(trex_ros)
+include(${trex_ros_PACKAGE_PATH}/trex_build.cmake)
+create_nddl_config()
+
+###############################################################################
+# TREX Hooks into Local ROS Code
+###############################################################################
+
+set(TREX_PR2_WRITING_CORE_FILES src/adapter_utilities.cpp
+ src/components.cpp
+ src/adapters.cpp
+ src/master_reactor.cpp)
+
+###############################################################################
+# Source library
+###############################################################################
+
+# build extensions into exported library
+create_trex_lib(trex_pr2_writing_core TREX_PR2_WRITING_CORE_FILES)
+
+###############################################################################
+# Executables & Tests
+###############################################################################
+
+create_trex_executables(bin/trexfast bin/trexdebug)
+
+# stub_ros__container implements stub state publishers and actions to allow easy testing of the ROS adapters for the model
+rospack_add_executable(bin/stub_ros_container src/stub_ros_container.cpp)
Added: pkg/trunk/stacks/trex/trex_pr2_writing_core/Makefile
===================================================================
--- pkg/trunk/stacks/trex/trex_pr2_writing_core/Makefile (rev 0)
+++ pkg/trunk/stacks/trex/trex_pr2_writing_core/Makefile 2009-07-16 01:32:09 UTC (rev 18942)
@@ -0,0 +1 @@
+include $(shell rospack find mk)/cmake.mk
Added: pkg/trunk/stacks/trex/trex_pr2_writing_core/doc/writing_master.dia
===================================================================
(Binary files differ)
Property changes on: pkg/trunk/stacks/trex/trex_pr2_writing_core/doc/writing_master.dia
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: pkg/trunk/stacks/trex/trex_pr2_writing_core/include/trex_pr2_writing_core/adapter_utilities.h
===================================================================
--- pkg/trunk/stacks/trex/trex_pr2_writing_core/include/trex_pr2_writing_core/adapter_utilities.h (rev 0)
+++ pkg/trunk/stacks/trex/trex_pr2_writing_core/include/trex_pr2_writing_core/adapter_utilities.h 2009-07-16 01:32:09 UTC (rev 18942)
@@ -0,0 +1,41 @@
+#ifndef H_PR2_ADAPTER_UTILITIES
+#define H_PR2_ADAPTER_UTILITIES
+
+#include "trex_ros/adapter_utilities.h"
+#include <plugs_msgs/PlugStow.h>
+#include <door_msgs/Door.h>
+
+namespace trex_pr2_writing_core {
+
+ /**
+ * @brief A class to scope a set of ros - TREX conversion utilities
+ *
+ * By convention, we write data from TREX to ROS and read data from ROS to TREX. This is reflected
+ * in the use of read and write method qualifiers.
+ */
+ class TempAdapterUtilities : trex_ros::AdapterUtilities {
+ public:
+ /**
+ * @brief Stuff token data into a door message
+ */
+ static void write(const TREX::TokenId& token, door_msgs::Door& msg);
+
+ /**
+ * @brief Read door message into the observation
+ */
+ static void read(TREX::ObservationByValue& obs, const door_msgs::Door& msg);
+
+ /**
+ * @brief Read plug stow message
+ */
+ static void read(TREX::ObservationByValue& obs, const plugs_msgs::PlugStow& msg);
+
+ /**
+ * @brief Stuff token data into a plug stow message
+ */
+ static void write(const TREX::TokenId& token, plugs_msgs::PlugStow& msg);
+ };
+
+}
+
+#endif
Added: pkg/trunk/stacks/trex/trex_pr2_writing_core/include/trex_pr2_writing_core/adapters.h
===================================================================
--- pkg/trunk/stacks/trex/trex_pr2_writing_core/include/trex_pr2_writing_core/adapters.h (rev 0)
+++ pkg/trunk/stacks/trex/trex_pr2_writing_core/include/trex_pr2_writing_core/adapters.h 2009-07-16 01:32:09 UTC (rev 18942)
@@ -0,0 +1,44 @@
+/*********************************************************************
+ * Software License Agreement (BSD License)
+ *
+ * Copyright (c) 2008, Willow Garage, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of the Willow Garage nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *********************************************************************/
+
+/**
+ * @file This file provides shared includes used for stubs and adapters
+ *
+ * @author Conor McGann
+ */
+
+#include <std_msgs/String.h>
+#include <std_msgs/Float32.h>
+#include <std_msgs/Int32.h>
+#include <std_msgs/Empty.h>
Added: pkg/trunk/stacks/trex/trex_pr2_writing_core/include/trex_pr2_writing_core/master_reactor.h
===================================================================
--- pkg/trunk/stacks/trex/trex_pr2_writing_core/include/trex_pr2_writing_core/master_reactor.h (rev 0)
+++ pkg/trunk/stacks/trex/trex_pr2_writing_core/include/trex_pr2_writing_core/master_reactor.h 2009-07-16 01:32:09 UTC (rev 18942)
@@ -0,0 +1,23 @@
+#ifndef H_MasterReactor
+#define H_MasterReactor
+
+#include "trex_ros/ros_reactor.h"
+#include "trex_pr2_writing_core/ExecuteGoals.h"
+
+namespace trex_pr2_writing_core {
+
+ class MasterReactor : public trex_ros::ROSReactor {
+ public:
+ MasterReactor(const EUROPA::LabelStr& agentName, const TiXmlElement& configData);
+
+ virtual ~MasterReactor();
+
+ bool executeGoals(ExecuteGoals::Request &req, ExecuteGoals::Response &resp);
+
+ private:
+ ros::NodeHandle node_handle_;
+ ros::ServiceServer service_server_;
+ };
+}
+
+#endif // ifndef H_MasterReactor
Added: pkg/trunk/stacks/trex/trex_pr2_writing_core/manifest.xml
===================================================================
--- pkg/trunk/stacks/trex/trex_pr2_writing_core/manifest.xml (rev 0)
+++ pkg/trunk/stacks/trex/trex_pr2_writing_core/manifest.xml 2009-07-16 01:32:09 UTC (rev 18942)
@@ -0,0 +1,15 @@
+<package>
+ <description>A ROS node to encapsulate the TeleoReactive Executive for task level planning and control.</description>
+ <author>TREX User</author>
+ <license>BSD</license>
+ <review status="unreviewed" notes=""/>
+ <depend package="trex_pr2" />
+ <depend package="trex_ros" />
+
+ <export>
+ <nddl iflags="-I${prefix}/nddl -I${prefix}"/>
+ <cpp cflags="-I${prefix}/srv/cpp"/>
+ <trex_libs libs="trex_pr2_writing_core"/>
+ </export>
+
+</package>
Added: pkg/trunk/stacks/trex/trex_pr2_writing_core/nddl/master/imports.nddl
===================================================================
--- pkg/trunk/stacks/trex/trex_pr2_writing_core/nddl/master/imports.nddl (rev 0)
+++ pkg/trunk/stacks/trex/trex_pr2_writing_core/nddl/master/imports.nddl 2009-07-16 01:32:09 UTC (rev 18942)
@@ -0,0 +1,120 @@
+#include "TREX.nddl"
+#include "rcs/exports.nddl"
+#include "rcs/nav/exports.nddl"
+#include "rcs/plugs/exports.nddl"
+#include "nav/exports.nddl"
+#include "plugs/exports.nddl"
+
+/**
+ * Navigation controller will iteratively work towards a goal. It will bite off chunks
+ */
+class Controller extends AgentTimeline {
+ predicate Holds {
+ bool active;
+ }
+
+ NavController(){
+ super(Internal, "Holds");
+ }
+};
+
+/**
+ * The Navigator turns a single navigation goal into something that runs the door controller
+ */
+class Navigator extends Behavior {
+
+ predicate Inactive {}
+
+ /**
+ * When active, we are pursuing a waypoint, although we may be pre-empted
+ */
+ predicate Active{
+ Location w;
+ bool recharging;
+ }
+
+ Navigator(){
+ super(Internal, "Inactive");
+ }
+};
+
+// Internal Timelines
+Navigator navigator = new Navigator();
+NavController nav_controller = new NavController();
+
+// External Timelines
+MoveBehavior driver = new MoveBehavior(External, false);
+MoveBehavior doorman = new MoveBehavior(External, true);
+Recharger recharger = new Recharger(External);
+BaseState base_state = new BaseState(External);
+
+AgentActions actions = new AgentActions();
+
+/**
+ * Planning will generate subgoal so that it is robust to replanning. In real execution we
+ * could rely on subgoaling to a predecessor, and thus not doing it reactively
+ */
+Navigator::Active{
+ contains(NavController.Holds nc);
+ eq(nc.active, true);
+
+ contains(actions.startEvent a);
+ concurrent(a.start, nc.start);
+}
+
+Navigator::Inactive {
+
+}
+
+NavController::Holds {
+
+ if(active == false){
+ contained_by(Navigator.Inactive);
+ }
+
+ met_by(Holds p);
+ defaultOnCommit(active, p.active);
+
+ if(active == true) {
+
+ if(start){
+ // Get the current position: bs(start).
+ any(BaseState.Holds bs);
+ precedes(bs.start, start);
+ temporalDistance(start, [1, +inf], bs.end);
+
+ // Get the target location
+ contained_by(Navigator.Active nav);
+
+ // Are we at the goal?
+ float distance;
+ calcDistance(distance, nav.w.x, nav.w.y, bs.y, bs.y);
+ bool at_goal;
+ testLEQ(at_goal, distance, XY_ERROR);
+
+ // If we are at_goal, terminate
+ if(at_goal == true){
+ eq(duration, 1);
+ meets(Holds s);
+ eq(s.active, false);
+ }
+ else {
+ // Take the next step towards the goal
+ contains(MoveBehavior.Active mb);
+ temporalDistance(mb.end, [-2, 2], end);
+
+ // Determine the next move. if we are doing planar navigation it will simply advance as far
+ // as possible before encountering a door
+ bool thru_doorway;
+ map_get_next_move(mb.x, mb.y, thru_doorway, bs.x, bs.y, nav.w.x, nav.w.y);
+
+ if(thru_doorway == true){
+ eq(mb.object, doorman);
+ }
+ else{
+ eq(mb.object, driver);
+ }
+ }
+ }
+ }
+}
Added: pkg/trunk/stacks/trex/trex_pr2_writing_core/nddl/master/master.nddl
===================================================================
--- pkg/trunk/stacks/trex/trex_pr2_writing_core/nddl/master/master.nddl (rev 0)
+++ pkg/trunk/stacks/trex/trex_pr2_writing_core/nddl/master/master.nddl 2009-07-16 01:32:09 UTC (rev 18942)
@@ -0,0 +1,317 @@
+/*
+ * Copyright (c) 2008, Willow Garage, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the <ORGANIZATION> nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "TREX.nddl"
+#include "world_model/topological_map.nddl"
+#include "rcs/exports.nddl"
+#include "rcs/nav/exports.nddl"
+#include "rcs/plugs/exports.nddl"
+#include "nav/exports.nddl"
+#include "plugs/exports.nddl"
+
+// Priority for goals
+typedef int [0 5] PRIORITY;
+
+// Time Bounds For top level components
+float RECHARGER_DURATION_BOUND = 600.0;
+float DOORMAN_DURATION_BOUND = 600.0;
+float DRIVER_DURATION_BOUND = 600.0;
+
+// Create a behavior timeline class to contain high-level goals
+// Each goal is composed of an Active / Inactive sequence
+class M2Goals extends Behavior {
+
+ // Each goal is composed of an outlet_id, and then a pose in a given frame
+ predicate Active{
+ MAP_KEY outlet_id;
+ string frame_id;
+ float time_stamp;
+ float x;
+ float y;
+ float z;
+ float qx;
+ float qy;
+ float qz;
+ float qw;
+
+ // Constraint must be defined here to allow x and y values to be accessible for planning.
+ map_get_outlet_approach_pose(x, y, z, qx, qy, qz, qw, outlet_id);
+ defaultOnCommit(frame_id, "map");
+ }
+
+ predicate Inactive{}
+
+ M2Goals(){
+ // Call Behavior's constructor
+ // - designating this as an internal timeline
+ super(Internal);
+ }
+};
+
+// Create a timeline class to
+class M2Controller extends AgentTimeline {
+ predicate Holds {
+ bool active;
+ bool recharge_required;
+ bool recharged;
+ bool finished;
+ float x;
+ float y;
+ }
+
+ M2Controller(){
+ // Call AgentTimeline's constructor,
+ // - designating this as an internal timeline
+ // - designating "Holds" as the default predicate
+ super(Internal, "Holds");
+ }
+};
+
+// Instantiate timelines
+
+// Internal Timelines
+M2Goals m2_goals = new M2Goals();
+M2Controller m2_controller = new M2Controller();
+
+// External timelines
+MoveBehavior driver = new MoveBehavior(External, false);
+MoveBehavior doorman = new MoveBehavior(External, true);
+Recharger recharger = new Recharger(External);
+BaseState base_state = new BaseState(External);
+
+M2Goals::Active{
+ // Guard on the built-in variable "start"
+ // This guard will be active when "start" has been closed to a singleton
+ // In other words, it will require nothing until it has been started
+ if(start){
+ // Introduce slave tokens
+ // These temporal constraints allocate new slave tokens:
+ // - m2_controller.Holds "mc"
+ // - base_state.Holds "bs"
+ // "starts" requires that m2_controller.Holds starts at the same time as m2_goals.Active
+ // "starts_during" requires that base_state.Holds starts after m2_goals.Active starts, but before it finishes
+ starts(m2_controller.Holds mc);
+ starts_during(base_state.Holds bs);
+
+ // Impose requirements on mc
+ eq(mc.active, true);
+ // While this goal is active, we should neither be recharged nor finished
+ eq(mc.recharged, false);
+ eq(mc.finished, false);
+
+ // Always synchronize the m2_controler state with basestate
+ eq(mc.x, bs.x);
+ eq(mc.y, bs.y);
+
+ // If the outlet_id for this goal is NO_KEY, then we don't require a recharge
+ if(outlet_id == NO_KEY){
+ eq(mc.recharge_required, false);
+ }
+ else {
+ eq(mc.recharge_required, true);
+ }
+ }
+}
+
+/**
+ * If a goal aborts then we should regenerate it for later
+ */
+M2Goals::Inactive{
+ // Set requirements when the m2_goals.Inactive token is created with status ABORTED
+ if(status == ABORTED){
+ // Allocate slave tokens
+ // An Active token that meets this Inactive token
+ // (the token that has just aborted)
+ met_by(Active p);
+ // An active token that follows this Inactive token
+ // (sometime down the line, not necessary immediately after)
+ before (Active g);
+
+ // Set the token that just failed and the later token to have the same goal
+ eq(g.outlet_id, p.outlet_id);
+ // Set the two slave tokens to have the same pose
+ // This is a hackish thing to account for the lack of struct / user-defined type support in NDDL
+ eq_pose_msg(g.object, p.object);
+ }
+}
+
+/**
+ * The loop for master level control.
+ * It uses the doorman, driver and recharger.
+ */
+M2Controller::Holds{
+ // If the controller is inactive, require that it occurs
+ // at the same time as an Inactive token on the m2_goals timeline
+ if(active == false){
+ equals(m2_goals.Inactive);
+ }
+
+ // Default based on predecessors
+ met_by(Holds p);
+ defaultOnCommit(active, p.active);
+ defaultOnCommit(recharge_required, p.recharge_required);
+ defaultOnCommit(recharged, p.recharged);
+ defaultOnCommit(finished, p.finished);
+ defaultOnCommit(x, p.x);
+ defaultOnCommit(y, p.y);
+
+ // If the controller is active
+ if(active == true){
+ // Allocate a slave token m2_controler.Holds to follow this Holds immediately
+ meets(Holds s);
+ // Allocate a slave token m2_active
+ contained_by(m2_goals.Active m2_active);
+
+ // Test if we are at the goal or not
+ // Declare a local variable distance
+ float distance;
+ // Here x,y are local to m2_controler.Holds, and have been synchronized
+ // with the base_state (the external pose)
+ //
+ // This uses a constraint to close "distance" and calculates the euclidean
+ // distance between the goal m2_active.* and the stored location
+ calcDistance(distance, x, y, m2_active.x, m2_active.y);
+ // Declare a local boolean variable at_goal, and leave it open on [true, false]
+ bool at_goal;
+ // This constrains at_goal to either true or false if distance is less than some proximity
+ testLEQ(at_goal, distance, 0.2);
+
+ // If the controller is active and has finished
+ if(finished == true){
+ // Allocate a slave token m2_inactive to immediately follow this m2_controler.Holds token
+ meets(m2_goals.Inactive m2_inactive);
+ // Require the slave m2_controller.Holds that follows this m2_controller.Holds s.active = false
+ eq(s.active, false);
+ // Require this only lasts for one more tick
+ eq(duration, 1);
+
+ // This sets the following m2_goals slave token to either SUCCESS or ABORTED
+ // Based on whether it achived a required recharge or not
+ if(recharge_required == true){
+ if(recharged == true){
+ eq(m2_inactive.status, SUCCESS);
+ }
+ else {
+ eq(m2_inactive.status, ABORTED);
+ }
+ }
+ else {
+ if(at_goal == true){
+ eq(m2_inactive.status, SUCCESS);
+ }
+ else {
+ eq(m2_inactive.status, ABORTED);
+ }
+ }
+ }
+ // If the controller is active and has not yet finished
+ else {
+ // If we are at the goal pose as estimated above
+ if(at_goal == true){
+ // If a recharge is required
+ if(recharge_required == true){
+ // Allocate a new slave recharger.Active token
+ contains_start(recharger.Active cmd);
+ // Require that this m2_controller.Holds token does not end until recharger.Active has ended
+ concurrent(cmd.end, end);
+ // Require the maximum duration of this delegated action cmd
+ eq(cmd.max_duration, RECHARGER_DURATION_BOUND);
+ // Require the outlet_id of the recharge command is the same as the currently active m2_goals token
+ eq(cmd.outlet_id, m2_active.outlet_id);
+ }
+ // If a recharge is not required
+ else {
+ // Create a new slave token and require that it succeeds like above
+ meets(m2_goals.Inactive m2_inactive);
+ eq(m2_inactive.status, SUCCESS);
+ eq(s.active, false);
+ eq(duration, 1);
+ }
+ }
+ // If we are not at the goal pose as estimated above
+ else{
+ // Take the next step towards the goal. This will either navigate to the goal, or navigate to the
+ // next connector along the way. It would be ideal to be able to specify for the nav stack that
+ // we do not care about orientation, and that we want to get as close as possible to the goal, but the criteria
+ // for success is based on a given error bound. Thus we could get close if possible, but permit a successful termination
+ // when we cannot get any closer but are within that bound. This is desirable since the precise approach is based
+ // on cacluations that deal with position of approach and location of the socket or door and these are encoded internally
+ // in the domains
+ contains_start(MoveBehavior.Active cmd);
+ concurrent(cmd.end, end);
+ eq(cmd.frame_id, m2_active.frame_id);
+
+ // Determine the next map point to go for. It will either be the outlet
+ // or it will be a doorway en-route to the outlet. This function calls a topological planner.
+ bool thru_doorway;
+ map_get_next_move(cmd.x, cmd.y, cmd.z, cmd.qx, cmd.qy, cmd.qz, cmd.qw, thru_doorway, x, y,
+ m2_active.x, m2_active.y, m2_active.z, m2_active.qx, m2_active.qy, m2_active.qz, m2_active.qw);
+
+ map_get_nearest_connector(cmd.start_connector, x, y, m2_active.x, m2_active.y);
+
+ if(thru_doorway == true){
+ // take no more than 10 minutes trying to get thru a doorway
+ eq(cmd.object, doorman);
+ eq(cmd.max_duration, DOORMAN_DURATION_BOUND);
+ }
+ else{
+ eq(cmd.object, driver);
+ eq(cmd.max_duration, DRIVER_DURATION_BOUND);
+ }
+ }
+ }
+ }
+}
+
+/**
+ * The update does not change control states unless it is aborted. Instead, it updates with the new position data
+ */
+MoveBehavior::Inactive{
+ starts(m2_controller.Holds mc);
+ if(status == SUCCESS){
+ eq(mc.x, x);
+ eq(mc.y, y);
+ }
+ else {
+ eq(mc.finished, true);
+ }
+}
+
+Recharger::Inactive{
+ starts(m2_controller.Holds mc);
+ if(status == SUCCESS){
+ eq(mc.finished, true);
+ eq(mc.recharged, true);
+ }
+ else {
+ eq(mc.finished, true);
+ eq(mc.recharged, false);
+ }
+}
+
Added: pkg/trunk/stacks/trex/trex_pr2_writing_core/src/adapter_utilities.cpp
===================================================================
--- pkg/trunk/stacks/trex/trex_pr2_writing_core/src/adapter_utilities.cpp (rev 0)
+++ pkg/trunk/stacks/trex/trex_pr2_writing_core/src/adapter_utilities.cpp 2009-07-16 01:32:09 UTC (rev 18942)
@@ -0,0 +1,8 @@
+#include "trex_pr2/pr2_adapter_utilities.h"
+#include "trex_ros/adapter_utilities.h"
+#include <tf/transform_listener.h>
+
+namespace trex_pr2_writing_core {
+
+
+}
Added: pkg/trunk/stacks/trex/trex_pr2_writing_core/src/adapters.cpp
===================================================================
--- pkg/trunk/stacks/trex/trex_pr2_writing_core/src/adapters.cpp (rev 0)
+++ pkg/trunk/stacks/trex/trex_pr2_writing_core/src/adapters.cpp 2009-07-16 01:32:09 UTC (rev 18942)
@@ -0,0 +1,48 @@
+/*
+ * TREX Process
+ * Copyright (c) 2008, Willow Garage, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the <ORGANIZATION> nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @file This File contains the declaration and definition of action adapters to bind TREX behavior timeline tokens
+ * to ROS message constructs, and to handle appropriate dispatching and observation synchronization
+ *
+ * @author Conor McGann
+ */
+
+#include <trex_ros/adapter_utilities.h>
+#include "trex_ros/ros_action_adapter.h"
+#include "trex_ros/ros_state_adapter.h"
+
+#include <trex_pr2/pr2_adapter_utilities.h>
+#include <trex_pr2/pr2_adapters.h>
+
+
+namespace trex_pr2_writing_core {
+
+}
Added: pkg/trunk/stacks/trex/trex_pr2_writing_core/src/components.cpp
===================================================================
--- pkg/trunk/stacks/trex/trex_pr2_writing_core/src/components.cpp (rev 0)
+++ pkg/trunk/stacks/trex/trex_pr2_writing_core/src/components.cpp 2009-07-16 01:32:09 UTC (rev 18942)
@@ -0,0 +1,24 @@
+#include "TeleoReactor.hh"
+#include "Assembly.hh"
+#include "trex_ros/components.h"
+#include <trex_pr2/topological_map.h>
+#include <trex_pr2/door_domain_constraints.h>
+#include <tf/transform_listener.h>
+
+#include "trex_pr2_writing_core/master_reactor.h"
+
+namespace trex_pr2_writing_core{
+ void registerComponents(bool playback, const Assembly& assembly){
+ ConstraintEngineId constraintEngine = ((ConstraintEngine*) assembly.getComponent("ConstraintEngine"))->getId();
+ // See trex_pr2 for custom constraint/solver binfing
+ }
+
+ REGISTER_SCHEMA(trex_pr2_writing_core::registerComponents);
+
+ void registerFactory(bool playback) {
+ // Register special reactors
+ new TREX::TeleoReactor::ConcreteFactory<trex_pr2_writing_core::MasterReactor>("trex_pr2_writing_core_MasterReactor");
+ }
+
+ REGISTER_FACTORY(trex_pr2_writing_core::registerFactory);
+}
Added: pkg/trunk/stacks/trex/trex_pr2_writing_core/src/main.cpp
====================================...
[truncated message content] |
|
From: <is...@us...> - 2009-07-17 01:15:38
|
Revision: 19078
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19078&view=rev
Author: isucan
Date: 2009-07-17 01:15:35 +0000 (Fri, 17 Jul 2009)
Log Message:
-----------
setting names for ik nodes
Modified Paths:
--------------
pkg/trunk/highlevel/move_arm/launch/move_larm.launch
pkg/trunk/highlevel/move_arm/launch/move_rarm.launch
pkg/trunk/util/pr2_ik/pr2_ik_larm_node.launch
pkg/trunk/util/pr2_ik/pr2_ik_rarm_node.launch
Modified: pkg/trunk/highlevel/move_arm/launch/move_larm.launch
===================================================================
--- pkg/trunk/highlevel/move_arm/launch/move_larm.launch 2009-07-17 01:07:15 UTC (rev 19077)
+++ pkg/trunk/highlevel/move_arm/launch/move_larm.launch 2009-07-17 01:15:35 UTC (rev 19078)
@@ -5,8 +5,8 @@
<remap from="collision_map" to="collision_map_occ" />
<remap from="collision_map_update" to="collision_map_occ_update" />
- <remap from="arm_ik" to="pr2_ik_node/ik_service" />
- <remap from="arm_ik_query" to="pr2_ik_node/ik_query" />
+ <remap from="arm_ik" to="pr2_ik_left_arm/ik_service" />
+ <remap from="arm_ik_query" to="pr2_ik_left_arm/ik_query" />
<remap from="controller_start" to="l_arm_joint_trajectory_controller/TrajectoryStart" />
<remap from="controller_query" to="l_arm_joint_trajectory_controller/TrajectoryQuery" />
Modified: pkg/trunk/highlevel/move_arm/launch/move_rarm.launch
===================================================================
--- pkg/trunk/highlevel/move_arm/launch/move_rarm.launch 2009-07-17 01:07:15 UTC (rev 19077)
+++ pkg/trunk/highlevel/move_arm/launch/move_rarm.launch 2009-07-17 01:15:35 UTC (rev 19078)
@@ -5,8 +5,8 @@
<remap from="collision_map" to="collision_map_occ" />
<remap from="collision_map_update" to="collision_map_occ_update" />
- <remap from="arm_ik" to="pr2_ik_node/ik_service" />
- <remap from="arm_ik_query" to="pr2_ik_node/ik_query" />
+ <remap from="arm_ik" to="pr2_ik_right_arm/ik_service" />
+ <remap from="arm_ik_query" to="pr2_ik_right_arm/ik_query" />
<remap from="controller_start" to="r_arm_joint_trajectory_controller/TrajectoryStart" />
<remap from="controller_query" to="r_arm_joint_trajectory_controller/TrajectoryQuery" />
Modified: pkg/trunk/util/pr2_ik/pr2_ik_larm_node.launch
===================================================================
--- pkg/trunk/util/pr2_ik/pr2_ik_larm_node.launch 2009-07-17 01:07:15 UTC (rev 19077)
+++ pkg/trunk/util/pr2_ik/pr2_ik_larm_node.launch 2009-07-17 01:15:35 UTC (rev 19078)
@@ -1,5 +1,5 @@
<launch>
- <node pkg="pr2_ik" type="pr2_ik_node">
+ <node pkg="pr2_ik" type="pr2_ik_node" name="pr2_ik_left_arm">
<param name="tip_name" value="l_wrist_roll_link" />
<param name="root_name" value="torso_lift_link" />
</node>
Modified: pkg/trunk/util/pr2_ik/pr2_ik_rarm_node.launch
===================================================================
--- pkg/trunk/util/pr2_ik/pr2_ik_rarm_node.launch 2009-07-17 01:07:15 UTC (rev 19077)
+++ pkg/trunk/util/pr2_ik/pr2_ik_rarm_node.launch 2009-07-17 01:15:35 UTC (rev 19078)
@@ -1,5 +1,5 @@
<launch>
- <node pkg="pr2_ik" type="pr2_ik_node">
+ <node pkg="pr2_ik" type="pr2_ik_node" name="pr2_ik_right_arm">
<param name="tip_name" value="r_wrist_roll_link" />
<param name="root_name" value="torso_lift_link" />
</node>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <is...@us...> - 2009-07-17 18:01:43
|
Revision: 19121
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19121&view=rev
Author: isucan
Date: 2009-07-17 18:01:32 +0000 (Fri, 17 Jul 2009)
Log Message:
-----------
update to pose constraints + beginning work on cloning collision environments
Modified Paths:
--------------
pkg/trunk/highlevel/move_arm/src/arm_cmd_line.cpp
pkg/trunk/highlevel/move_arm/src/move_arm_action.cpp
pkg/trunk/highlevel/move_arm/test/oscillate_move.cpp
pkg/trunk/motion_planning/motion_planning_msgs/msg/JointConstraint.msg
pkg/trunk/motion_planning/motion_planning_msgs/msg/PoseConstraint.msg
pkg/trunk/motion_planning/motion_planning_srvs/srv/MotionPlan.srv
pkg/trunk/motion_planning/ompl_planning/include/ompl_planning/extensions/GoalDefinitions.h
pkg/trunk/motion_planning/ompl_planning/src/helpers/ompl_extensions/GoalDefinitions.cpp
pkg/trunk/motion_planning/ompl_planning/src/helpers/ompl_extensions/SpaceInformation.cpp
pkg/trunk/motion_planning/planning_environment/include/planning_environment/util/kinematic_state_constraint_evaluator.h
pkg/trunk/motion_planning/planning_environment/src/util/kinematic_state_constraint_evaluator.cpp
pkg/trunk/motion_planning/planning_models/include/planning_models/kinematic.h
pkg/trunk/motion_planning/planning_models/include/planning_models/kinematic_state_params.h
pkg/trunk/motion_planning/planning_models/src/kinematic.cpp
pkg/trunk/motion_planning/planning_models/test/test_kinematic.cpp
Modified: pkg/trunk/highlevel/move_arm/src/arm_cmd_line.cpp
===================================================================
--- pkg/trunk/highlevel/move_arm/src/arm_cmd_line.cpp 2009-07-17 17:54:04 UTC (rev 19120)
+++ pkg/trunk/highlevel/move_arm/src/arm_cmd_line.cpp 2009-07-17 18:01:32 UTC (rev 19121)
@@ -127,11 +127,11 @@
goal.goal_constraints.joint_constraint[i].header.frame_id = "/base_link";
goal.goal_constraints.joint_constraint[i].joint_name = names[i];
goal.goal_constraints.joint_constraint[i].value.resize(1);
- goal.goal_constraints.joint_constraint[i].toleranceAbove.resize(1);
- goal.goal_constraints.joint_constraint[i].toleranceBelow.resize(1);
+ goal.goal_constraints.joint_constraint[i].tolerance_above.resize(1);
+ goal.goal_constraints.joint_constraint[i].tolerance_below.resize(1);
goal.goal_constraints.joint_constraint[i].value[0] = 0.0;
- goal.goal_constraints.joint_constraint[i].toleranceBelow[0] = 0.0;
- goal.goal_constraints.joint_constraint[i].toleranceAbove[0] = 0.0;
+ goal.goal_constraints.joint_constraint[i].tolerance_below[0] = 0.0;
+ goal.goal_constraints.joint_constraint[i].tolerance_above[0] = 0.0;
}
}
@@ -151,9 +151,21 @@
goal.goal_constraints.pose_constraint[0].pose.pose.orientation.z = 0.0;
goal.goal_constraints.pose_constraint[0].pose.pose.orientation.w = 1.0;
- goal.goal_constraints.pose_constraint[0].position_distance = 0.0001;
- goal.goal_constraints.pose_constraint[0].orientation_distance = 0.01;
- goal.goal_constraints.pose_constraint[0].orientation_importance = 0.001;
+ goal.goal_constraints.pose_constraint[0].position_tolerance_above.x = 0.003;
+ goal.goal_constraints.pose_constraint[0].position_tolerance_above.y = 0.003;
+ goal.goal_constraints.pose_constraint[0].position_tolerance_above.z = 0.003;
+ goal.goal_constraints.pose_constraint[0].position_tolerance_below.x = 0.003;
+ goal.goal_constraints.pose_constraint[0].position_tolerance_below.y = 0.003;
+ goal.goal_constraints.pose_constraint[0].position_tolerance_below.z = 0.003;
+
+ goal.goal_constraints.pose_constraint[0].orientation_tolerance_above.x = 0.005;
+ goal.goal_constraints.pose_constraint[0].orientation_tolerance_above.y = 0.005;
+ goal.goal_constraints.pose_constraint[0].orientation_tolerance_above.z = 0.005;
+ goal.goal_constraints.pose_constraint[0].orientation_tolerance_below.x = 0.005;
+ goal.goal_constraints.pose_constraint[0].orientation_tolerance_below.y = 0.005;
+ goal.goal_constraints.pose_constraint[0].orientation_tolerance_below.z = 0.005;
+
+ goal.goal_constraints.pose_constraint[0].orientation_importance = 0.01;
}
void setConfig(const planning_models::StateParams *sp, const std::vector<std::string> &names, pr2_robot_actions::MoveArmGoal &goal)
Modified: pkg/trunk/highlevel/move_arm/src/move_arm_action.cpp
===================================================================
--- pkg/trunk/highlevel/move_arm/src/move_arm_action.cpp 2009-07-17 17:54:04 UTC (rev 19120)
+++ pkg/trunk/highlevel/move_arm/src/move_arm_action.cpp 2009-07-17 18:01:32 UTC (rev 19121)
@@ -492,9 +492,7 @@
if (req.goal_constraints.joint_constraint.empty() && // we have no joint constraints on the goal,
req.goal_constraints.pose_constraint.size() == 1 && // we have a single pose constraint on the goal
req.goal_constraints.pose_constraint[0].type == motion_planning_msgs::PoseConstraint::POSITION_XYZ +
- motion_planning_msgs::PoseConstraint::ORIENTATION_RPY && // that is active on all 6 DOFs
- req.goal_constraints.pose_constraint[0].position_distance < 0.1 && // and the desired position and
- req.goal_constraints.pose_constraint[0].orientation_distance < 0.1) // orientation distances are small
+ motion_planning_msgs::PoseConstraint::ORIENTATION_RPY) // that is active on all 6 DOFs
{
planning_models::KinematicModel::Link *link = planningMonitor_->getKinematicModel()->getLink(req.goal_constraints.pose_constraint[0].link_name);
if (link && link->before && link->before->name == arm_joint_names_.back())
@@ -516,8 +514,8 @@
for (unsigned int j = 0 ; j < u ; ++j)
{
jc.value.push_back(solution[n + j]);
- jc.toleranceAbove.push_back(0.0);
- jc.toleranceBelow.push_back(0.0);
+ jc.tolerance_above.push_back(0.0);
+ jc.tolerance_below.push_back(0.0);
}
n += u;
req.goal_constraints.joint_constraint.push_back(jc);
Modified: pkg/trunk/highlevel/move_arm/test/oscillate_move.cpp
===================================================================
--- pkg/trunk/highlevel/move_arm/test/oscillate_move.cpp 2009-07-17 17:54:04 UTC (rev 19120)
+++ pkg/trunk/highlevel/move_arm/test/oscillate_move.cpp 2009-07-17 18:01:32 UTC (rev 19121)
@@ -69,8 +69,21 @@
goalA.goal_constraints.pose_constraint[0].pose.pose.orientation.y = 0;
goalA.goal_constraints.pose_constraint[0].pose.pose.orientation.z = 0;
goalA.goal_constraints.pose_constraint[0].pose.pose.orientation.w = 1;
- goalA.goal_constraints.pose_constraint[0].position_distance = 0.01;
- goalA.goal_constraints.pose_constraint[0].orientation_distance = 0.01;
+
+ goalA.goal_constraints.pose_constraint[0].position_tolerance_above.x = 0.003;
+ goalA.goal_constraints.pose_constraint[0].position_tolerance_above.y = 0.003;
+ goalA.goal_constraints.pose_constraint[0].position_tolerance_above.z = 0.003;
+ goalA.goal_constraints.pose_constraint[0].position_tolerance_below.x = 0.003;
+ goalA.goal_constraints.pose_constraint[0].position_tolerance_below.y = 0.003;
+ goalA.goal_constraints.pose_constraint[0].position_tolerance_below.z = 0.003;
+
+ goalA.goal_constraints.pose_constraint[0].orientation_tolerance_above.x = 0.005;
+ goalA.goal_constraints.pose_constraint[0].orientation_tolerance_above.y = 0.005;
+ goalA.goal_constraints.pose_constraint[0].orientation_tolerance_above.z = 0.005;
+ goalA.goal_constraints.pose_constraint[0].orientation_tolerance_below.x = 0.005;
+ goalA.goal_constraints.pose_constraint[0].orientation_tolerance_below.y = 0.005;
+ goalA.goal_constraints.pose_constraint[0].orientation_tolerance_below.z = 0.005;
+
goalA.goal_constraints.pose_constraint[0].orientation_importance = 0.1;
goalA.goal_constraints.pose_constraint[0].type =
motion_planning_msgs::PoseConstraint::POSITION_XYZ +
@@ -93,11 +106,11 @@
goalB.goal_constraints.joint_constraint[i].header.frame_id = "base_link";
goalB.goal_constraints.joint_constraint[i].joint_name = names[i];
goalB.goal_constraints.joint_constraint[i].value.resize(1);
- goalB.goal_constraints.joint_constraint[i].toleranceAbove.resize(1);
- goalB.goal_constraints.joint_constraint[i].toleranceBelow.resize(1);
+ goalB.goal_constraints.joint_constraint[i].tolerance_above.resize(1);
+ goalB.goal_constraints.joint_constraint[i].tolerance_below.resize(1);
goalB.goal_constraints.joint_constraint[i].value[0] = 0.0;
- goalB.goal_constraints.joint_constraint[i].toleranceBelow[0] = 0.0;
- goalB.goal_constraints.joint_constraint[i].toleranceAbove[0] = 0.0;
+ goalB.goal_constraints.joint_constraint[i].tolerance_below[0] = 0.0;
+ goalB.goal_constraints.joint_constraint[i].tolerance_above[0] = 0.0;
}
goalB.goal_constraints.joint_constraint[0].value[0] = -2.0;
Modified: pkg/trunk/motion_planning/motion_planning_msgs/msg/JointConstraint.msg
===================================================================
--- pkg/trunk/motion_planning/motion_planning_msgs/msg/JointConstraint.msg 2009-07-17 17:54:04 UTC (rev 19120)
+++ pkg/trunk/motion_planning/motion_planning_msgs/msg/JointConstraint.msg 2009-07-17 18:01:32 UTC (rev 19121)
@@ -3,7 +3,7 @@
# Constrain the position of a joint to be within a certain bound
string joint_name
-# the bound to be achieved is [value - toleranceBelow, value + toleranceAbove]
+# the bound to be achieved is [value - tolerance_below, value + tolerance_above]
float64[] value
-float64[] toleranceAbove
-float64[] toleranceBelow
+float64[] tolerance_above
+float64[] tolerance_below
Modified: pkg/trunk/motion_planning/motion_planning_msgs/msg/PoseConstraint.msg
===================================================================
--- pkg/trunk/motion_planning/motion_planning_msgs/msg/PoseConstraint.msg 2009-07-17 17:54:04 UTC (rev 19120)
+++ pkg/trunk/motion_planning/motion_planning_msgs/msg/PoseConstraint.msg 2009-07-17 18:01:32 UTC (rev 19121)
@@ -32,13 +32,20 @@
# The desired pose of the robot link
robot_msgs/PoseStamped pose
-# the allowed difference (square of euclidian distance) for position
-float64 position_distance
+# The acceptable tolerance
+robot_msgs/Point position_tolerance_above
+robot_msgs/Point position_tolerance_below
-# the allowed difference (shortest angular distance, in radians) for orientation
-float64 orientation_distance
+# The acceptable tolerance (roll pitch yaw)
+robot_msgs/Point orientation_tolerance_above
+robot_msgs/Point orientation_tolerance_below
-# a factor that gets multiplied to the orientation when computing the
-# distance to the goal.
-# Distance_to_goal = position_distance + orientation_importance * orientation_distance
+# The planner may internally compute a distance from current state to goal pose.
+# This is done with a weighted sum such as:
+# Distance_to_goal = position_distance + orientation_importance * orientation_distance;
+# orientation_importance can be used to tell the planner which component is more important
+# (this only makes a difference when approximate solutions are found)
+# If you do not care about this value, simply set it to 1.0
+# Planners should use square of 2-norm for position distance and shortest angular distance
+# for orientations (roll, pitch yaw)
float64 orientation_importance
Modified: pkg/trunk/motion_planning/motion_planning_srvs/srv/MotionPlan.srv
===================================================================
--- pkg/trunk/motion_planning/motion_planning_srvs/srv/MotionPlan.srv 2009-07-17 17:54:04 UTC (rev 19120)
+++ pkg/trunk/motion_planning/motion_planning_srvs/srv/MotionPlan.srv 2009-07-17 18:01:32 UTC (rev 19121)
@@ -28,7 +28,8 @@
# A solution path, if found
motion_planning_msgs/KinematicPath path
-# distance to goal as computed by the heuristic
+# distance to goal as computed by internal planning heuristic
+# this should be 0.0 if the solution was achieved exaclty
float64 distance
# set to 1 if the computed path was approximate
Modified: pkg/trunk/motion_planning/ompl_planning/include/ompl_planning/extensions/GoalDefinitions.h
===================================================================
--- pkg/trunk/motion_planning/ompl_planning/include/ompl_planning/extensions/GoalDefinitions.h 2009-07-17 17:54:04 UTC (rev 19120)
+++ pkg/trunk/motion_planning/ompl_planning/include/ompl_planning/extensions/GoalDefinitions.h 2009-07-17 18:01:32 UTC (rev 19121)
@@ -85,14 +85,7 @@
planning_environment::PoseConstraintEvaluator *pce = new planning_environment::PoseConstraintEvaluator();
pce->use(model_->kmodel, pc[i]);
pce_.push_back(pce);
-
- // if we have position constraints
- if (pc[i].type & 0xFF)
- threshold += pc[i].position_distance;
-
- // if we have orientation constraints
- if (pc[i].type & (~0xFF))
- threshold += ((pc[i].type & 0xFF) ? pc[i].orientation_importance : 1.0) * pc[i].orientation_distance;
+ threshold = ompl::STATE_EPSILON;
}
}
Modified: pkg/trunk/motion_planning/ompl_planning/src/helpers/ompl_extensions/GoalDefinitions.cpp
===================================================================
--- pkg/trunk/motion_planning/ompl_planning/src/helpers/ompl_extensions/GoalDefinitions.cpp 2009-07-17 17:54:04 UTC (rev 19120)
+++ pkg/trunk/motion_planning/ompl_planning/src/helpers/ompl_extensions/GoalDefinitions.cpp 2009-07-17 18:01:32 UTC (rev 19121)
@@ -88,16 +88,16 @@
{
unsigned int usedParams = model->kmodel->getJoint(jc[i].joint_name)->usedParams;
- if (jc[i].toleranceAbove.size() != jc[i].toleranceBelow.size() || jc[i].value.size() != jc[i].toleranceBelow.size() || jc[i].value.size() != usedParams)
+ if (jc[i].tolerance_above.size() != jc[i].tolerance_below.size() || jc[i].value.size() != jc[i].tolerance_below.size() || jc[i].value.size() != usedParams)
ROS_ERROR("Constraint on joint %s has incorrect number of parameters. Expected %u", jc[i].joint_name.c_str(), usedParams);
else
{
for (unsigned int j = 0 ; j < usedParams ; ++j)
{
- if (bounds_[idx + j].first < jc[i].value[j] - jc[i].toleranceBelow[j])
- bounds_[idx + j].first = jc[i].value[j] - jc[i].toleranceBelow[j];
- if (bounds_[idx + j].second > jc[i].value[j] + jc[i].toleranceAbove[j])
- bounds_[idx + j].second = jc[i].value[j] + jc[i].toleranceAbove[j];
+ if (bounds_[idx + j].first < jc[i].value[j] - jc[i].tolerance_below[j])
+ bounds_[idx + j].first = jc[i].value[j] - jc[i].tolerance_below[j];
+ if (bounds_[idx + j].second > jc[i].value[j] + jc[i].tolerance_above[j])
+ bounds_[idx + j].second = jc[i].value[j] + jc[i].tolerance_above[j];
desiredValueCount[idx + j]++;
desiredValue[idx + j] = jc[i].value[j];
}
Modified: pkg/trunk/motion_planning/ompl_planning/src/helpers/ompl_extensions/SpaceInformation.cpp
===================================================================
--- pkg/trunk/motion_planning/ompl_planning/src/helpers/ompl_extensions/SpaceInformation.cpp 2009-07-17 17:54:04 UTC (rev 19120)
+++ pkg/trunk/motion_planning/ompl_planning/src/helpers/ompl_extensions/SpaceInformation.cpp 2009-07-17 18:01:32 UTC (rev 19121)
@@ -166,17 +166,17 @@
{
unsigned int usedParams = kmodel_->getJoint(jc[i].joint_name)->usedParams;
- if (jc[i].toleranceAbove.size() != jc[i].toleranceBelow.size() || jc[i].value.size() != jc[i].toleranceBelow.size() || jc[i].value.size() != usedParams)
+ if (jc[i].tolerance_above.size() != jc[i].tolerance_below.size() || jc[i].value.size() != jc[i].tolerance_below.size() || jc[i].value.size() != usedParams)
ROS_ERROR("Constraint on joint %s has incorrect number of parameters. Expected %u", jc[i].joint_name.c_str(), usedParams);
else
{
for (unsigned int j = 0 ; j < usedParams ; ++j)
{
- if (m_stateComponent[idx + j].minValue < jc[i].value[j] - jc[i].toleranceBelow[j])
- m_stateComponent[idx + j].minValue = jc[i].value[j] - jc[i].toleranceBelow[j];
- if (m_stateComponent[idx + j].maxValue > jc[i].value[j] + jc[i].toleranceAbove[j])
- m_stateComponent[idx + j].maxValue = jc[i].value[j] + jc[i].toleranceAbove[j];
+ if (m_stateComponent[idx + j].minValue < jc[i].value[j] - jc[i].tolerance_below[j])
+ m_stateComponent[idx + j].minValue = jc[i].value[j] - jc[i].tolerance_below[j];
+ if (m_stateComponent[idx + j].maxValue > jc[i].value[j] + jc[i].tolerance_above[j])
+ m_stateComponent[idx + j].maxValue = jc[i].value[j] + jc[i].tolerance_above[j];
}
}
}
@@ -305,17 +305,17 @@
{
unsigned int usedParams = kmodel_->getJoint(jc[i].joint_name)->usedParams;
- if (jc[i].toleranceAbove.size() != jc[i].toleranceBelow.size() || jc[i].value.size() != jc[i].toleranceBelow.size() || jc[i].value.size() != usedParams)
+ if (jc[i].tolerance_above.size() != jc[i].tolerance_below.size() || jc[i].value.size() != jc[i].tolerance_below.size() || jc[i].value.size() != usedParams)
ROS_ERROR("Constraint on joint %s has incorrect number of parameters. Expected %u", jc[i].joint_name.c_str(), usedParams);
else
{
for (unsigned int j = 0 ; j < usedParams ; ++j)
{
- if (m_stateComponent[idx + j].minValue < jc[i].value[j] - jc[i].toleranceBelow[j])
- m_stateComponent[idx + j].minValue = jc[i].value[j] - jc[i].toleranceBelow[j];
- if (m_stateComponent[idx + j].maxValue > jc[i].value[j] + jc[i].toleranceAbove[j])
- m_stateComponent[idx + j].maxValue = jc[i].value[j] + jc[i].toleranceAbove[j];
+ if (m_stateComponent[idx + j].minValue < jc[i].value[j] - jc[i].tolerance_below[j])
+ m_stateComponent[idx + j].minValue = jc[i].value[j] - jc[i].tolerance_below[j];
+ if (m_stateComponent[idx + j].maxValue > jc[i].value[j] + jc[i].tolerance_above[j])
+ m_stateComponent[idx + j].maxValue = jc[i].value[j] + jc[i].tolerance_above[j];
}
}
}
Modified: pkg/trunk/motion_planning/planning_environment/include/planning_environment/util/kinematic_state_constraint_evaluator.h
===================================================================
--- pkg/trunk/motion_planning/planning_environment/include/planning_environment/util/kinematic_state_constraint_evaluator.h 2009-07-17 17:54:04 UTC (rev 19120)
+++ pkg/trunk/motion_planning/planning_environment/include/planning_environment/util/kinematic_state_constraint_evaluator.h 2009-07-17 18:01:32 UTC (rev 19121)
@@ -148,12 +148,8 @@
protected:
motion_planning_msgs::PoseConstraint m_pc;
- double m_x;
- double m_y;
- double m_z;
- double m_yaw;
- double m_pitch;
- double m_roll;
+ double m_x, m_y, m_z;
+ double m_roll, m_pitch, m_yaw;
planning_models::KinematicModel::Link *m_link;
};
Modified: pkg/trunk/motion_planning/planning_environment/src/util/kinematic_state_constraint_evaluator.cpp
===================================================================
--- pkg/trunk/motion_planning/planning_environment/src/util/kinematic_state_constraint_evaluator.cpp 2009-07-17 17:54:04 UTC (rev 19120)
+++ pkg/trunk/motion_planning/planning_environment/src/util/kinematic_state_constraint_evaluator.cpp 2009-07-17 18:01:32 UTC (rev 19121)
@@ -64,12 +64,12 @@
bool planning_environment::JointConstraintEvaluator::decide(const double *params, const int groupID) const
{
const double *val = params + (groupID >= 0 ? m_kmodel->getJointIndexInGroup(m_joint->name, groupID) : m_kmodel->getJointIndex(m_joint->name));
- assert(m_jc.value.size() == m_jc.toleranceBelow.size() && m_jc.value.size() == m_jc.toleranceAbove.size());
+ assert(m_jc.value.size() == m_jc.tolerance_below.size() && m_jc.value.size() == m_jc.tolerance_above.size());
for (unsigned int i = 0 ; i < m_jc.value.size() ; ++i)
{
double dif = val[i] - m_jc.value[i];
- if (dif > m_jc.toleranceAbove[i] || dif < - m_jc.toleranceBelow[i])
+ if (dif > m_jc.tolerance_above[i] || dif < - m_jc.tolerance_below[i])
return false;
}
return true;
@@ -95,11 +95,11 @@
for (unsigned int i = 0 ; i < m_jc.value.size() ; ++i)
out << m_jc.value[i] << "; ";
out << " tolerance below = ";
- for (unsigned int i = 0 ; i < m_jc.toleranceBelow.size() ; ++i)
- out << m_jc.toleranceBelow[i] << "; ";
+ for (unsigned int i = 0 ; i < m_jc.tolerance_below.size() ; ++i)
+ out << m_jc.tolerance_below[i] << "; ";
out << " tolerance above = ";
- for (unsigned int i = 0 ; i < m_jc.toleranceAbove.size() ; ++i)
- out << m_jc.toleranceAbove[i] << "; ";
+ for (unsigned int i = 0 ; i < m_jc.tolerance_above.size() ; ++i)
+ out << m_jc.tolerance_above[i] << "; ";
out << std::endl;
}
else
@@ -161,34 +161,61 @@
dx = bodyPos.getX() - m_x;
dy = bodyPos.getY() - m_y;
dz = bodyPos.getZ() - m_z;
- *distPos = dx * dx + dy * dy + dz * dz;
+ *distPos = 0.0;
+ if (dx > m_pc.position_tolerance_above.x || -m_pc.position_tolerance_below.x > dx)
+ *distPos += dx * dx;
+ if (dy > m_pc.position_tolerance_above.y || -m_pc.position_tolerance_below.y > dy)
+ *distPos += dy * dy;
+ if (dz > m_pc.position_tolerance_above.z || -m_pc.position_tolerance_below.z > dz)
+ *distPos += dz * dz;
break;
case motion_planning_msgs::PoseConstraint::POSITION_XY:
dx = bodyPos.getX() - m_x;
dy = bodyPos.getY() - m_y;
- *distPos = dx * dx + dy * dy;
+ *distPos = 0.0;
+ if (dx > m_pc.position_tolerance_above.x || -m_pc.position_tolerance_below.x > dx)
+ *distPos += dx * dx;
+ if (dy > m_pc.position_tolerance_above.y || -m_pc.position_tolerance_below.y > dy)
+ *distPos += dy * dy;
break;
case motion_planning_msgs::PoseConstraint::POSITION_XZ:
dx = bodyPos.getX() - m_x;
dz = bodyPos.getZ() - m_z;
- *distPos = dx * dx + dz * dz;
+ *distPos = 0.0;
+ if (dx > m_pc.position_tolerance_above.x || -m_pc.position_tolerance_below.x > dx)
+ *distPos += dx * dx;
+ if (dz > m_pc.position_tolerance_above.z || -m_pc.position_tolerance_below.z > dz)
+ *distPos += dz * dz;
break;
case motion_planning_msgs::PoseConstraint::POSITION_YZ:
dy = bodyPos.getY() - m_y;
dz = bodyPos.getZ() - m_z;
- *distPos = dy * dy + dz * dz;
+ *distPos = 0.0;
+ if (dy > m_pc.position_tolerance_above.y || -m_pc.position_tolerance_below.y > dy)
+ *distPos += dy * dy;
+ if (dz > m_pc.position_tolerance_above.z || -m_pc.position_tolerance_below.z > dz)
+ *distPos += dz * dz;
break;
case motion_planning_msgs::PoseConstraint::POSITION_X:
dx = bodyPos.getX() - m_x;
- *distPos = dx * dx;
+ if (dx > m_pc.position_tolerance_above.x || -m_pc.position_tolerance_below.x > dx)
+ *distPos = dx * dx;
+ else
+ *distPos = 0.0;
break;
case motion_planning_msgs::PoseConstraint::POSITION_Y:
dy = bodyPos.getY() - m_y;
- *distPos = dy * dy;
+ if (dy > m_pc.position_tolerance_above.y || -m_pc.position_tolerance_below.y > dy)
+ *distPos = dy * dy;
+ else
+ *distPos = 0.0;
break;
case motion_planning_msgs::PoseConstraint::POSITION_Z:
dz = bodyPos.getZ() - m_z;
- *distPos = dz * dz;
+ if (dz > m_pc.position_tolerance_above.z || -m_pc.position_tolerance_below.z > dz)
+ *distPos = dz * dz;
+ else
+ *distPos = 0.0;
break;
default:
*distPos = 0.0;
@@ -202,35 +229,70 @@
{
if (m_pc.type & (~0xFF))
{
+ double dx, dy, dz;
btScalar yaw, pitch, roll;
m_link->globalTrans.getBasis().getEulerYPR(yaw, pitch, roll);
switch (m_pc.type & (~0xFF))
{
case motion_planning_msgs::PoseConstraint::ORIENTATION_RPY:
- *distAng = fabs(angles::shortest_angular_distance(roll, m_roll)) +
- fabs(angles::shortest_angular_distance(pitch, m_pitch)) +
- fabs(angles::shortest_angular_distance(yaw, m_yaw));
+ dx = angles::shortest_angular_distance(roll, m_roll);
+ dy = angles::shortest_angular_distance(pitch, m_pitch);
+ dz = angles::shortest_angular_distance(yaw, m_yaw);
+ *distAng = 0.0;
+ if (dx > m_pc.orientation_tolerance_above.x || -m_pc.orientation_tolerance_below.x > dx)
+ *distAng += fabs(dx);
+ if (dy > m_pc.orientation_tolerance_above.y || -m_pc.orientation_tolerance_below.y > dy)
+ *distAng += fabs(dy);
+ if (dz > m_pc.orientation_tolerance_above.z || -m_pc.orientation_tolerance_below.z > dz)
+ *distAng += fabs(dz);
break;
case motion_planning_msgs::PoseConstraint::ORIENTATION_RP:
- *distAng = fabs(angles::shortest_angular_distance(roll, m_roll)) +
- fabs(angles::shortest_angular_distance(pitch, m_pitch));
+ dx = angles::shortest_angular_distance(roll, m_roll);
+ dy = angles::shortest_angular_distance(pitch, m_pitch);
+ *distAng = 0.0;
+ if (dx > m_pc.orientation_tolerance_above.x || -m_pc.orientation_tolerance_below.x > dx)
+ *distAng += fabs(dx);
+ if (dy > m_pc.orientation_tolerance_above.y || -m_pc.orientation_tolerance_below.y > dy)
+ *distAng += fabs(dy);
break;
case motion_planning_msgs::PoseConstraint::ORIENTATION_RY:
- *distAng = fabs(angles::shortest_angular_distance(roll, m_roll)) +
- fabs(angles::shortest_angular_distance(yaw, m_yaw));
+ dx = angles::shortest_angular_distance(roll, m_roll);
+ dz = angles::shortest_angular_distance(yaw, m_yaw);
+ *distAng = 0.0;
+ if (dx > m_pc.orientation_tolerance_above.x || -m_pc.orientation_tolerance_below.x > dx)
+ *distAng += fabs(dx);
+ if (dz > m_pc.orientation_tolerance_above.z || -m_pc.orientation_tolerance_below.z > dz)
+ *distAng += fabs(dz);
break;
case motion_planning_msgs::PoseConstraint::ORIENTATION_PY:
- *distAng = fabs(angles::shortest_angular_distance(pitch, m_pitch)) +
- fabs(angles::shortest_angular_distance(yaw, m_yaw));
+ dy = angles::shortest_angular_distance(pitch, m_pitch);
+ dz = angles::shortest_angular_distance(yaw, m_yaw);
+ *distAng = 0.0;
+ if (dy > m_pc.orientation_tolerance_above.y || -m_pc.orientation_tolerance_below.y > dy)
+ *distAng += fabs(dy);
+ if (dz > m_pc.orientation_tolerance_above.z || -m_pc.orientation_tolerance_below.z > dz)
+ *distAng += fabs(dz);
break;
case motion_planning_msgs::PoseConstraint::ORIENTATION_R:
- *distAng = fabs(angles::shortest_angular_distance(roll, m_roll));
+ dx = angles::shortest_angular_distance(roll, m_roll);
+ if (dx > m_pc.orientation_tolerance_above.x || -m_pc.orientation_tolerance_below.x > dx)
+ *distAng = fabs(dx);
+ else
+ *distAng = 0.0;
break;
case motion_planning_msgs::PoseConstraint::ORIENTATION_P:
- *distAng = fabs(angles::shortest_angular_distance(pitch, m_pitch));
+ dy = angles::shortest_angular_distance(pitch, m_pitch);
+ if (dy > m_pc.orientation_tolerance_above.y || -m_pc.orientation_tolerance_below.y > dy)
+ *distAng = fabs(dy);
+ else
+ *distAng = 0.0;
break;
case motion_planning_msgs::PoseConstraint::ORIENTATION_Y:
- *distAng = fabs(angles::shortest_angular_distance(yaw, m_yaw));
+ dz = angles::shortest_angular_distance(yaw, m_yaw);
+ if (dz > m_pc.orientation_tolerance_above.z || -m_pc.orientation_tolerance_below.z > dz)
+ *distAng = fabs(dz);
+ else
+ *distAng = 0.0;
break;
default:
*distAng = 0.0;
@@ -252,8 +314,9 @@
bool planning_environment::PoseConstraintEvaluator::decide(double dPos, double dAng) const
{
- bool v1 = (m_pc.type & 0xFF) ? dPos < m_pc.position_distance : true;
- bool v2 = (m_pc.type & (~0xFF)) ? dAng < m_pc.orientation_distance : true;
+ // the values should actually be 0, for this to be true, but we put a small eps
+ bool v1 = (m_pc.type & 0xFF) ? dPos < 1e-12 : true;
+ bool v2 = (m_pc.type & (~0xFF)) ? dAng < 1e-12 : true;
return v1 && v2;
}
@@ -277,33 +340,53 @@
out << "x = " << m_x << " ";
out << "y = " << m_y << " ";
out << "z = " << m_z << " ";
+
+ out << " with tolerance: above [" << m_pc.position_tolerance_above.x << ", "
+ << m_pc.position_tolerance_above.y << ", " << m_pc.position_tolerance_above.z << "], below ["
+ << m_pc.position_tolerance_below.x << ", " << m_pc.position_tolerance_below.y << ", "
+ << m_pc.position_tolerance_below.z << "]" << std::endl;
+
break;
case motion_planning_msgs::PoseConstraint::POSITION_XY:
out << "x = " << m_x << " ";
out << "y = " << m_y << " ";
+
+ out << " with tolerance: above [" << m_pc.position_tolerance_above.x << ", "
+ << m_pc.position_tolerance_above.y << "], below ["
+ << m_pc.position_tolerance_below.x << ", " << m_pc.position_tolerance_below.y << "]" << std::endl;
break;
case motion_planning_msgs::PoseConstraint::POSITION_XZ:
out << "x = " << m_x << " ";
out << "z = " << m_z << " ";
+ out << " with tolerance: above [" << m_pc.position_tolerance_above.x << ", "
+ << m_pc.position_tolerance_above.z << "], below ["
+ << m_pc.position_tolerance_below.x << ", " << m_pc.position_tolerance_below.z << "]" << std::endl;
break;
case motion_planning_msgs::PoseConstraint::POSITION_YZ:
out << "y = " << m_y << " ";
out << "z = " << m_z << " ";
+ out << " with tolerance: above [" << m_pc.position_tolerance_above.y << ", "
+ << m_pc.position_tolerance_above.z << "], below ["
+ << m_pc.position_tolerance_below.y << ", " << m_pc.position_tolerance_below.z << "]" << std::endl;
break;
case motion_planning_msgs::PoseConstraint::POSITION_X:
out << "x = " << m_x << " ";
+ out << " with tolerance: above [" << m_pc.position_tolerance_above.x << "], below ["
+ << m_pc.position_tolerance_below.x << "]" << std::endl;
break;
case motion_planning_msgs::PoseConstraint::POSITION_Y:
out << "y = " << m_y << " ";
+ out << " with tolerance: above [" << m_pc.position_tolerance_above.y << "], below ["
+ << m_pc.position_tolerance_below.y << "]" << std::endl;
break;
case motion_planning_msgs::PoseConstraint::POSITION_Z:
out << "z = " << m_z << " ";
+ out << " with tolerance: above [" << m_pc.position_tolerance_above.z << "], below ["
+ ...
[truncated message content] |
|
From: <jfa...@us...> - 2009-07-17 20:54:01
|
Revision: 19136
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19136&view=rev
Author: jfaustwg
Date: 2009-07-17 20:53:58 +0000 (Fri, 17 Jul 2009)
Log Message:
-----------
Updated message_filters according to API review: connect() -> registerCallback(), connectTo() -> connectInputs()
Modified Paths:
--------------
pkg/trunk/drivers/robot/pr2/dense_laser_assembler/include/dense_laser_assembler/dense_laser_msg_filter.h
pkg/trunk/drivers/robot/pr2/dense_laser_assembler/include/dense_laser_assembler/joint_pv_msg_filter.h
pkg/trunk/drivers/robot/pr2/dense_laser_assembler/include/dense_laser_assembler/laser_scan_tagger.h
pkg/trunk/drivers/robot/pr2/dense_laser_assembler/src/joint_extractor_display.cpp
pkg/trunk/sandbox/message_filters/include/message_filters/cache.h
pkg/trunk/sandbox/message_filters/include/message_filters/subscriber.h
pkg/trunk/sandbox/message_filters/include/message_filters/time_sequencer.h
pkg/trunk/sandbox/message_filters/include/message_filters/time_synchronizer.h
pkg/trunk/sandbox/message_filters/test/time_sequencer_unittest.cpp
pkg/trunk/sandbox/message_filters/test/time_synchronizer_unittest.cpp
pkg/trunk/stacks/geometry/tf/include/tf/message_filter.h
pkg/trunk/stacks/geometry/tf/test/test_message_filter.cpp
pkg/trunk/stacks/nav/nav_view/src/nav_view/nav_view_panel.cpp
pkg/trunk/stacks/visualization/rviz/src/rviz/displays/camera_display.cpp
pkg/trunk/stacks/visualization/rviz/src/rviz/displays/collision_map_display.cpp
pkg/trunk/stacks/visualization/rviz/src/rviz/displays/laser_scan_display.cpp
pkg/trunk/stacks/visualization/rviz/src/rviz/displays/marker_display.cpp
pkg/trunk/stacks/visualization/rviz/src/rviz/displays/point_cloud_display.cpp
pkg/trunk/stacks/visualization/rviz/src/rviz/displays/poly_line_2d_display.cpp
pkg/trunk/stacks/visualization/rviz/src/rviz/displays/polygonal_map_display.cpp
pkg/trunk/stacks/visualization/rviz/src/rviz/displays/robot_base2d_pose_display.cpp
Added Paths:
-----------
pkg/trunk/sandbox/message_filters/include/message_filters/simple_filter.h
Modified: pkg/trunk/drivers/robot/pr2/dense_laser_assembler/include/dense_laser_assembler/dense_laser_msg_filter.h
===================================================================
--- pkg/trunk/drivers/robot/pr2/dense_laser_assembler/include/dense_laser_assembler/dense_laser_msg_filter.h 2009-07-17 20:49:52 UTC (rev 19135)
+++ pkg/trunk/drivers/robot/pr2/dense_laser_assembler/include/dense_laser_assembler/dense_laser_msg_filter.h 2009-07-17 20:53:58 UTC (rev 19136)
@@ -43,6 +43,7 @@
#include "dense_laser_assembler/laser_scan_tagger.h"
#include "message_filters/cache.h"
#include "message_filters/connection.h"
+#include "message_filters/simple_filter.h"
// Messages
@@ -68,13 +69,11 @@
/**
* \brief Listens to LaserScan and MechanismState messages, and builds DenseLaserSnapshots
*/
-class DenseLaserMsgFilter
+class DenseLaserMsgFilter : public message_filters::SimpleFilter<TaggedLaserScan<JointPVArray> >
{
public:
typedef boost::shared_ptr<const TaggedLaserScan<JointPVArray> > MConstPtr ;
- typedef boost::function<void(const MConstPtr&)> Callback;
- typedef boost::signal<void(const MConstPtr&)> Signal;
//! \brief Not yet implemented
template<class A, class B>
@@ -125,21 +124,15 @@
// Configure the joint_pv_filter and associated cache
joint_pv_filter_.setJointNames(joint_names_) ;
joint_cache_.setCacheSize(mech_state_cache_size) ;
- joint_cache_.connectTo(joint_pv_filter_) ;
+ joint_cache_.connectInput(joint_pv_filter_) ;
// Set up the laser tagger and associated cache
laser_tagger_.setMaxQueueSize(laser_queue_size) ;
laser_tagger_.subscribeTagCache(joint_cache_) ;
tagged_laser_cache_.setCacheSize(laser_cache_size) ;
- tagged_laser_cache_.connectTo(laser_tagger_) ;
+ tagged_laser_cache_.connectInput(laser_tagger_) ;
}
- /**
- * \brief Used to connect this MessageFilter to a callback
- * \param callback Function to be called whenever a new TaggedLaserScan message is available
- */
- message_filters::Connection connect(const Callback& callback) ;
-
//! \brief Not yet implemented
void processLaserScan(const sensor_msgs::LaserScanConstPtr& msg) ;
@@ -183,7 +176,7 @@
template<class B>
void subscribeMechState(B& b)
{
- joint_pv_filter_.subscribe(b) ;
+ joint_pv_filter_.connectInput(b) ;
}
//! Extracts positions data for a subset of joints in MechanismState
Modified: pkg/trunk/drivers/robot/pr2/dense_laser_assembler/include/dense_laser_assembler/joint_pv_msg_filter.h
===================================================================
--- pkg/trunk/drivers/robot/pr2/dense_laser_assembler/include/dense_laser_assembler/joint_pv_msg_filter.h 2009-07-17 20:49:52 UTC (rev 19135)
+++ pkg/trunk/drivers/robot/pr2/dense_laser_assembler/include/dense_laser_assembler/joint_pv_msg_filter.h 2009-07-17 20:53:58 UTC (rev 19136)
@@ -46,6 +46,7 @@
#include <boost/signals.hpp>
#include <boost/bind.hpp>
#include <message_filters/connection.h>
+#include <message_filters/simple_filter.h>
// Messages
#include "dense_laser_assembler/JointPVArray.h"
@@ -58,12 +59,9 @@
* Streams an array of joint positions and velocities from MechanismState,
* given a mapping from joint_names to array indices
*/
-class JointPVMsgFilter
+class JointPVMsgFilter : public message_filters::SimpleFilter<JointPVArray>
{
public:
- typedef boost::function<void(const JointPVArrayConstPtr&)> Callback;
- typedef boost::signal<void(const JointPVArrayConstPtr&)> Signal;
-
/**
* \brief Subscribe to another MessageFilter at construction time
* \param a The parent message filter
@@ -92,23 +90,12 @@
* \param a The MsgFilter that this MsgFilter should get data from
*/
template<class A>
- void subscribe(A& a)
+ void connectInput(A& a)
{
- boost::mutex::scoped_lock lock(signal_mutex_);
- incoming_connection_ = a.connect(boost::bind(&JointPVMsgFilter::processMechState, this, _1));
+ incoming_connection_ = a.registerCallback(boost::bind(&JointPVMsgFilter::processMechState, this, _1));
}
/**
- * \brief Called by user wants they want to connect this MessageFilter to their own code
- * \param callback Function to be called whenever a JointPVArray message is available
- */
- message_filters::Connection connect(const Callback& callback)
- {
- boost::mutex::scoped_lock lock(signal_mutex_);
- return message_filters::Connection(boost::bind(&JointPVMsgFilter::disconnect, this, _1), signal_.connect(callback));
- }
-
- /**
* \brief Define the mapping from MechanismState to JointPVArray
*/
void setJointNames(std::vector<std::string> joint_names)
@@ -152,23 +139,15 @@
}
// Call all connected callbacks
- signal_(joint_array_ptr) ;
+ signalMessage(joint_array_ptr) ;
}
protected:
- void disconnect(const message_filters::Connection& c)
- {
- boost::mutex::scoped_lock lock(signal_mutex_);
- signal_.disconnect(c.getBoostConnection());
- }
-
boost::mutex joint_mapping_mutex_ ;
std::vector<std::string> joint_names_ ;
// Filter Connection Stuff
message_filters::Connection incoming_connection_;
- Signal signal_;
- boost::mutex signal_mutex_;
} ;
}
Modified: pkg/trunk/drivers/robot/pr2/dense_laser_assembler/include/dense_laser_assembler/laser_scan_tagger.h
===================================================================
--- pkg/trunk/drivers/robot/pr2/dense_laser_assembler/include/dense_laser_assembler/laser_scan_tagger.h 2009-07-17 20:49:52 UTC (rev 19135)
+++ pkg/trunk/drivers/robot/pr2/dense_laser_assembler/include/dense_laser_assembler/laser_scan_tagger.h 2009-07-17 20:53:58 UTC (rev 19136)
@@ -45,6 +45,8 @@
#include "boost/shared_ptr.hpp"
#include "dense_laser_assembler/tagged_laser_scan.h"
+#include <message_filters/simple_filter.h>
+
namespace dense_laser_assembler
{
@@ -53,14 +55,12 @@
* whenever there is a tag msg that occurs before and after the scan.
*/
template <class T>
-class LaserScanTagger
+class LaserScanTagger : public message_filters::SimpleFilter<TaggedLaserScan<T> >
{
public:
typedef boost::shared_ptr<const T> TConstPtr ;
typedef boost::shared_ptr<const TaggedLaserScan<T> > MConstPtr ;
- typedef boost::function<void(const MConstPtr&)> Callback;
- typedef boost::signal<void(const MConstPtr&)> Signal;
@@ -92,15 +92,13 @@
template<class A>
void subscribeLaserScan(A& a)
{
- boost::mutex::scoped_lock lock(signal_mutex_);
- incoming_laser_scan_connection_ = a.connect(boost::bind(&LaserScanTagger<T>::processLaserScan, this, _1));
+ incoming_laser_scan_connection_ = a.registerCallback(boost::bind(&LaserScanTagger<T>::processLaserScan, this, _1));
}
void subscribeTagCache(message_filters::Cache<T>& tag_cache)
{
- boost::mutex::scoped_lock lock(signal_mutex_);
tag_cache_ = &tag_cache ;
- incoming_tag_connection_ = tag_cache.connect(boost::bind(&LaserScanTagger<T>::processTag, this, _1));
+ incoming_tag_connection_ = tag_cache.registerCallback(boost::bind(&LaserScanTagger<T>::processTag, this, _1));
}
void setMaxQueueSize(unsigned int max_queue_size)
@@ -136,16 +134,6 @@
}
/**
- * \brief Connect this message filter's output to some callback
- * \param callback Function to call after we've tagged a LaserScan
- */
- message_filters::Connection connect(const Callback& callback)
- {
- boost::mutex::scoped_lock lock(signal_mutex_);
- return message_filters::Connection(boost::bind(&LaserScanTagger::disconnect, this, _1), signal_.connect(callback));
- }
-
- /**
* Triggers the module to try to service the queue
*/
void update()
@@ -206,28 +194,20 @@
queue_.pop_front() ;
queue_mutex_.unlock() ;
- boost::mutex::scoped_lock lock(signal_mutex_);
- signal_(tagged_scan) ;
+ signalMessage(tagged_scan) ;
}
}
}
private:
- void disconnect(const message_filters::Connection& c)
- {
- boost::mutex::scoped_lock lock(signal_mutex_);
- signal_.disconnect(c.getBoostConnection());
- }
std::deque<sensor_msgs::LaserScanConstPtr> queue_ ; //!< Incoming queue of laser scans
boost::mutex queue_mutex_ ; //!< Mutex for laser scan queue
unsigned int max_queue_size_ ; //!< Max # of laser scans to queue up for processing
message_filters::Cache<T>* tag_cache_ ; //!< Cache of the tags that we need to merge with laser data
- Signal signal_;
message_filters::Connection incoming_laser_scan_connection_;
message_filters::Connection incoming_tag_connection_;
- boost::mutex signal_mutex_;
} ;
}
Modified: pkg/trunk/drivers/robot/pr2/dense_laser_assembler/src/joint_extractor_display.cpp
===================================================================
--- pkg/trunk/drivers/robot/pr2/dense_laser_assembler/src/joint_extractor_display.cpp 2009-07-17 20:49:52 UTC (rev 19135)
+++ pkg/trunk/drivers/robot/pr2/dense_laser_assembler/src/joint_extractor_display.cpp 2009-07-17 20:53:58 UTC (rev 19136)
@@ -85,7 +85,7 @@
JointPVMsgFilter joint_extractor(joint_names) ;
//JointPVDiagMsgFilter joint_extractor(diagnostic, joint_names) ;
- message_filters::Connection con = joint_extractor.connect( boost::bind(&display_joints, joint_names, _1) ) ;
+ joint_extractor.registerCallback( boost::bind(&display_joints, joint_names, _1) ) ;
ros::Subscriber sub = nh.subscribe("mechanism_state", 1, &JointPVMsgFilter::processMechState, &joint_extractor) ;
@@ -94,7 +94,5 @@
ros::spin() ;
- con.disconnect() ;
-
return 0 ;
}
Modified: pkg/trunk/sandbox/message_filters/include/message_filters/cache.h
===================================================================
--- pkg/trunk/sandbox/message_filters/include/message_filters/cache.h 2009-07-17 20:49:52 UTC (rev 19135)
+++ pkg/trunk/sandbox/message_filters/include/message_filters/cache.h 2009-07-17 20:53:58 UTC (rev 19136)
@@ -39,10 +39,10 @@
#include "boost/thread.hpp"
#include "boost/shared_ptr.hpp"
#include <boost/signals.hpp>
-#include <boost/noncopyable.hpp>
#include "ros/time.h"
#include "connection.h"
+#include "simple_filter.h"
namespace message_filters
{
@@ -63,18 +63,16 @@
\endverbatim
*/
template<class M>
-class Cache : public boost::noncopyable
+class Cache : public SimpleFilter<M>
{
public:
- typedef boost::shared_ptr<M const> MConstPtr ;
- typedef boost::function<void(const MConstPtr&)> Callback;
- typedef boost::signal<void(const MConstPtr&)> Signal;
+ typedef boost::shared_ptr<M const> MConstPtr;
template<class F>
Cache(F& f, unsigned int cache_size = 1)
{
setCacheSize(cache_size) ;
- connectTo(f) ;
+ connectInput(f) ;
}
/**
@@ -87,9 +85,9 @@
}
template<class F>
- void connectTo(F& f)
+ void connectInput(F& f)
{
- incoming_connection_ = f.connect(boost::bind(&Cache::add, this, _1));
+ incoming_connection_ = f.registerCallback(boost::bind(&Cache::add, this, _1));
}
~Cache()
@@ -112,12 +110,6 @@
cache_size_ = cache_size ;
}
- Connection connect(const Callback& callback)
- {
- boost::mutex::scoped_lock lock(signal_mutex_);
- return Connection(boost::bind(&Cache::disconnect, this, _1), signal_.connect(callback));
- }
-
/**
* Add the most recent message to the cache, and pop off any elements that are too old.
* This method is registered with a data provider when connectTo is called.
@@ -146,11 +138,7 @@
}
- {
- boost::mutex::scoped_lock lock(signal_mutex_);
- // Sequentially call each registered call
- signal_(msg);
- }
+ signalMessage(msg);
}
/**
@@ -293,19 +281,11 @@
}
private:
- void disconnect(const Connection& c)
- {
- boost::mutex::scoped_lock lock(signal_mutex_);
- c.getBoostConnection().disconnect();
- }
-
boost::mutex cache_lock_ ; //!< Lock for cache_
std::deque<MConstPtr > cache_ ; //!< Cache for the messages
unsigned int cache_size_ ; //!< Maximum number of elements allowed in the cache.
Connection incoming_connection_;
- Signal signal_;
- boost::mutex signal_mutex_;
};
}
Added: pkg/trunk/sandbox/message_filters/include/message_filters/simple_filter.h
===================================================================
--- pkg/trunk/sandbox/message_filters/include/message_filters/simple_filter.h (rev 0)
+++ pkg/trunk/sandbox/message_filters/include/message_filters/simple_filter.h 2009-07-17 20:53:58 UTC (rev 19136)
@@ -0,0 +1,82 @@
+/*********************************************************************
+* Software License Agreement (BSD License)
+*
+* Copyright (c) 2008, Willow Garage, Inc.
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* * Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+* * Redistributions in binary form must reproduce the above
+* copyright notice, this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided
+* with the distribution.
+* * Neither the name of the Willow Garage nor the names of its
+* contributors may be used to endorse or promote products derived
+* from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*********************************************************************/
+
+#ifndef MESSAGE_FILTERS_SIMPLE_FILTER_H
+#define MESSAGE_FILTERS_SIMPLE_FILTER_H
+
+#include <boost/noncopyable.hpp>
+
+#include <ros/ros.h>
+
+#include "connection.h"
+
+namespace message_filters
+{
+
+template<class M>
+class SimpleFilter : public boost::noncopyable
+{
+public:
+ typedef boost::shared_ptr<M const> MConstPtr;
+ typedef boost::function<void(const MConstPtr&)> Callback;
+ typedef boost::signal<void(const MConstPtr&)> Signal;
+
+ Connection registerCallback(const Callback& callback)
+ {
+ boost::mutex::scoped_lock lock(signal_mutex_);
+ return Connection(boost::bind(&SimpleFilter::disconnect, this, _1), signal_.connect(callback));
+ }
+
+protected:
+ void signalMessage(const MConstPtr& msg)
+ {
+ boost::mutex::scoped_lock lock(signal_mutex_);
+ signal_(msg);
+ }
+
+private:
+ void disconnect(const Connection& c)
+ {
+ boost::mutex::scoped_lock lock(signal_mutex_);
+ c.getBoostConnection().disconnect();
+ }
+
+ Signal signal_;
+ boost::mutex signal_mutex_;
+};
+
+}
+
+#endif
+
Modified: pkg/trunk/sandbox/message_filters/include/message_filters/subscriber.h
===================================================================
--- pkg/trunk/sandbox/message_filters/include/message_filters/subscriber.h 2009-07-17 20:49:52 UTC (rev 19135)
+++ pkg/trunk/sandbox/message_filters/include/message_filters/subscriber.h 2009-07-17 20:53:58 UTC (rev 19136)
@@ -39,9 +39,9 @@
#include <boost/signals.hpp>
#include <boost/thread/mutex.hpp>
-#include <boost/noncopyable.hpp>
#include "connection.h"
+#include "simple_filter.h"
namespace message_filters
{
@@ -66,12 +66,10 @@
\endverbatim
*/
template<class M>
-class Subscriber : public boost::noncopyable
+class Subscriber : public SimpleFilter<M>
{
public:
typedef boost::shared_ptr<M const> MConstPtr;
- typedef boost::function<void(const MConstPtr&)> Callback;
- typedef boost::signal<void(const MConstPtr&)> Signal;
/**
* \brief Constructor
@@ -134,34 +132,14 @@
sub_.shutdown();
}
- /**
- * \brief Connect a callback to this filter. That callback will be called whenever new data arrives.
- *
- * \param callback A function of the same form as the message callbacks used in roscpp
- * \return A connection object that allows you to disconnect a single connection from this subscriber
- */
- Connection connect(const Callback& callback)
- {
- boost::mutex::scoped_lock lock(signal_mutex_);
- return Connection(boost::bind(&Subscriber::disconnect, this, _1), signal_.connect(callback));
- }
-
private:
- void disconnect(const Connection& c)
- {
- boost::mutex::scoped_lock lock(signal_mutex_);
- c.getBoostConnection().disconnect();
- }
void cb(const MConstPtr& m)
{
- boost::mutex::scoped_lock lock(signal_mutex_);
- signal_(m);
+ signalMessage(m);
}
ros::Subscriber sub_;
- Signal signal_;
- boost::mutex signal_mutex_;
};
}
Modified: pkg/trunk/sandbox/message_filters/include/message_filters/time_sequencer.h
===================================================================
--- pkg/trunk/sandbox/message_filters/include/message_filters/time_sequencer.h 2009-07-17 20:49:52 UTC (rev 19135)
+++ pkg/trunk/sandbox/message_filters/include/message_filters/time_sequencer.h 2009-07-17 20:53:58 UTC (rev 19136)
@@ -35,11 +35,10 @@
#ifndef MESSAGE_FILTERS_TIME_SEQUENCER_H
#define MESSAGE_FILTERS_TIME_SEQUENCER_H
-#include <boost/noncopyable.hpp>
-
#include <ros/ros.h>
#include "connection.h"
+#include "simple_filter.h"
namespace message_filters
{
@@ -73,12 +72,10 @@
*
*/
template<class M>
-class TimeSequencer : public boost::noncopyable
+class TimeSequencer : public SimpleFilter<M>
{
public:
- typedef boost::shared_ptr<M const> MConstPtr ;
- typedef boost::function<void(const MConstPtr&)> Callback;
- typedef boost::signal<void(const MConstPtr&)> Signal;
+ typedef boost::shared_ptr<M const> MConstPtr;
/**
* \brief Constructor
@@ -96,13 +93,13 @@
, nh_(nh)
{
init();
- connectTo(f);
+ connectInput(f);
}
/**
* \brief Constructor
*
- * This version of the constructor does not take a filter immediately. You can connect to a filter later with the connectTo() function
+ * This version of the constructor does not take a filter immediately. You can connect to a filter later with the connectInput() function
*
* \param delay The minimum time to hold a message before passing it through.
* \param update_rate The rate at which to check for messages which have passed "delay"
@@ -122,7 +119,7 @@
* \brief Connect this filter's input to another filter's output.
*/
template<class F>
- void connectTo(F& f)
+ void connectInput(F& f)
{
incoming_connection_.disconnect();
incoming_connection_ = f.connect(boost::bind(&TimeSequencer::cb, this, _1));
@@ -134,12 +131,6 @@
incoming_connection_.disconnect();
}
- Connection connect(const Callback& callback)
- {
- boost::mutex::scoped_lock lock(signal_mutex_);
- return Connection(boost::bind(&TimeSequencer::disconnect, this, _1), signal_.connect(callback));
- }
-
void add(const MConstPtr& msg)
{
boost::mutex::scoped_lock lock(messages_mutex_);
@@ -173,12 +164,6 @@
add(msg);
}
- void disconnect(const Connection& c)
- {
- boost::mutex::scoped_lock lock(signal_mutex_);
- c.getBoostConnection().disconnect();
- }
-
void dispatch()
{
V_Message to_call;
@@ -203,13 +188,11 @@
}
{
- boost::mutex::scoped_lock lock(signal_mutex_);
-
typename V_Message::iterator it = to_call.begin();
typename V_Message::iterator end = to_call.end();
for (; it != end; ++it)
{
- signal_(*it);
+ signalMessage(*it);
}
}
}
@@ -234,8 +217,6 @@
ros::Timer update_timer_;
Connection incoming_connection_;
- Signal signal_;
- boost::mutex signal_mutex_;
S_Message messages_;
Modified: pkg/trunk/sandbox/message_filters/include/message_filters/time_synchronizer.h
===================================================================
--- pkg/trunk/sandbox/message_filters/include/message_filters/time_synchronizer.h 2009-07-17 20:49:52 UTC (rev 19135)
+++ pkg/trunk/sandbox/message_filters/include/message_filters/time_synchronizer.h 2009-07-17 20:53:58 UTC (rev 19136)
@@ -66,7 +66,7 @@
public:
typedef boost::shared_ptr<M const> MConstPtr;
typedef boost::function<void(const MConstPtr&)> Callback;
- Connection connect(const Callback& cb)
+ Connection registerCallback(const Callback& cb)
{
return Connection();
}
@@ -97,7 +97,7 @@
* Example usage would be:
\verbatim
TimeSynchronizer<sensor_msgs::CamInfo, sensor_msgs::Image, sensor_msgs::Image> sync(caminfo_sub, limage_sub, rimage_sub, 3);
-sync.connect(callback);
+sync.registerCallback(callback);
\endverbatim
* The callback is then of the form:
@@ -128,7 +128,7 @@
: queue_size_(queue_size)
{
determineRealTypeCount();
- connectTo(f0, f1);
+ connectInput(f0, f1);
}
template<class F0, class F1, class F2>
@@ -136,7 +136,7 @@
: queue_size_(queue_size)
{
determineRealTypeCount();
- connectTo(f0, f1, f2);
+ connectInput(f0, f1, f2);
}
template<class F0, class F1, class F2, class F3>
@@ -144,7 +144,7 @@
: queue_size_(queue_size)
{
determineRealTypeCount();
- connectTo(f0, f1, f2, f3);
+ connectInput(f0, f1, f2, f3);
}
template<class F0, class F1, class F2, class F3, class F4>
@@ -152,7 +152,7 @@
: queue_size_(queue_size)
{
determineRealTypeCount();
- connectTo(f0, f1, f2, f3, f4);
+ connectInput(f0, f1, f2, f3, f4);
}
template<class F0, class F1, class F2, class F3, class F4, class F5>
@@ -160,7 +160,7 @@
: queue_size_(queue_size)
{
determineRealTypeCount();
- connectTo(f0, f1, f2, f3, f4, f5);
+ connectInput(f0, f1, f2, f3, f4, f5);
}
template<class F0, class F1, class F2, class F3, class F4, class F5, class F6>
@@ -168,7 +168,7 @@
: queue_size_(queue_size)
{
determineRealTypeCount();
- connectTo(f0, f1, f2, f3, f4, f5, f6);
+ connectInput(f0, f1, f2, f3, f4, f5, f6);
}
template<class F0, class F1, class F2, class F3, class F4, class F5, class F6, class F7>
@@ -176,7 +176,7 @@
: queue_size_(queue_size)
{
determineRealTypeCount();
- connectTo(f0, f1, f2, f3, f4, f5, f6, f7);
+ connectInput(f0, f1, f2, f3, f4, f5, f6, f7);
}
template<class F0, class F1, class F2, class F3, class F4, class F5, class F6, class F7, class F8>
@@ -184,7 +184,7 @@
: queue_size_(queue_size)
{
determineRealTypeCount();
- connectTo(f0, f1, f2, f3, f4, f5, f6, f7, f8);
+ connectInput(f0, f1, f2, f3, f4, f5, f6, f7, f8);
}
TimeSynchronizer(uint32_t queue_size)
@@ -199,72 +199,72 @@
}
template<class F0, class F1>
- void connectTo(F0& f0, F1& f1)
+ void connectInput(F0& f0, F1& f1)
{
NullFilter<M2> f2;
- connectTo(f0, f1, f2);
+ connectInput(f0, f1, f2);
}
template<class F0, class F1, class F2>
- void connectTo(F0& f0, F1& f1, F2& f2)
+ void connectInput(F0& f0, F1& f1, F2& f2)
{
NullFilter<M3> f3;
- connectTo(f0, f1, f2, f3);
+ connectInput(f0, f1, f2, f3);
}
template<class F0, class F1, class F2, class F3>
- void connectTo(F0& f0, F1& f1, F2& f2, F3& f3)
+ void connectInput(F0& f0, F1& f1, F2& f2, F3& f3)
{
NullFilter<M4> f4;
- connectTo(f0, f1, f2, f3, f4);
+ connectInput(f0, f1, f2, f3, f4);
}
template<class F0, class F1, class F2, class F3, class F4>
- void connectTo(F0& f0, F1& f1, F2& f2, F3& f3, F4& f4)
+ void connectInput(F0& f0, F1& f1, F2& f2, F3& f3, F4& f4)
{
NullFilter<M5> f5;
- connectTo(f0, f1, f2, f3, f4, f5);
+ connectInput(f0, f1, f2, f3, f4, f5);
}
template<class F0, class F1, class F2, class F3, class F4, class F5>
- void connectTo(F0& f0, F1& f1, F2& f2, F3& f3, F4& f4, F5& f5)
+ void connectInput(F0& f0, F1& f1, F2& f2, F3& f3, F4& f4, F5& f5)
{
NullFilter<M6> f6;
- connectTo(f0, f1, f2, f3, f4, f5, f6);
+ connectInput(f0, f1, f2, f3, f4, f5, f6);
}
template<class F0, class F1, class F2, class F3, class F4, class F5, class F6>
- void connectTo(F0& f0, F1& f1, F2& f2, F3& f3, F4& f4, F5& f5, F6& f6)
+ void connectInput(F0& f0, F1& f1, F2& f2, F3& f3, F4& f4, F5& f5, F6& f6)
{
NullFilter<M7> f7;
- connectTo(f0, f1, f2, f3, f4, f5, f6, f7);
+ connectInput(f0, f1, f2, f3, f4, f5, f6, f7);
}
template<class F0, class F1, class F2, class F3, class F4, class F5, class F6, class F7>
- void connectTo(F0& f0, F1& f1, F2& f2, F3& f3, F4& f4, F5& f5, F6& f6, F7& f7)
+ void connectInput(F0& f0, F1& f1, F2& f2, F3& f3, F4& f4, F5& f5, F6& f6, F7& f7)
{
NullFilter<M8> f8;
- connectTo(f0, f1, f2, f3, f4, f5, f6, f7, f8);
+ connectInput(f0, f1, f2, f3, f4, f5, f6, f7, f8);
}
template<class F0, class F1, class F2, class F3, class F4, class F5, class F6, class F7, class F8>
- void connectTo(F0& f0, F1& f1, F2& f2, F3& f3, F4& f4, F5& f5, F6& f6, F7& f7, F8& f8)
+ void connectInput(F0& f0, F1& f1, F2& f2, F3& f3, F4& f4, F5& f5, F6& f6, F7& f7, F8& f8)
{
disconnectAll();
- input_connections_[0] = f0.connect(boost::bind(&TimeSynchronizer::cb0, this, _1));
- input_connections_[1] = f1.connect(boost::bind(&TimeSynchronizer::cb1, this, _1));
- input_connections_[2] = f2.connect(boost::bind(&TimeSynchronizer::cb2, this, _1));
- input_connections_[3] = f3.connect(boost::bind(&TimeSynchronizer::cb3, this, _1));
- input_connections_[4] = f4.connect(boost::bind(&TimeSynchronizer::cb4, this, _1));
- input_connections_[5] = f5.connect(boost::bind(&TimeSynchronizer::cb5, this, _1));
- input_connections_[6] = f6.connect(boost::bind(&TimeSynchronizer::cb6, this, _1));
- input_connections_[7] = f7.connect(boost::bind(&TimeSynchronizer::cb7, this, _1));
- input_connections_[8] = f8.connect(boost::bind(&TimeSynchronizer::cb8, this, _1));
+ input_connections_[0] = f0.registerCallback(boost::bind(&TimeSynchronizer::cb0, this, _1));
+ input_connections_[1] = f1.registerCallback(boost::bind(&TimeSynchronizer::cb1, this, _1));
+ input_connections_[2] = f2.registerCallback(boost::bind(&TimeSynchronizer::cb2, this, _1));
+ input_connections_[3] = f3.registerCallback(boost::bind(&TimeSynchronizer::cb3, this, _1));
+ input_connections_[4] = f4.registerCallback(boost::bind(&TimeSynchronizer::cb4, this, _1));
+ input_connections_[5] = f5.registerCallback(boost::bind(&TimeSynchronizer::cb5, this, _1));
+ input_connections_[6] = f6.registerCallback(boost::bind(&TimeSynchronizer::cb6, this, _1));
+ input_connections_[7] = f7.registerCallback(boost::bind(&TimeSynchronizer::cb7, this, _1));
+ input_connections_[8] = f8.registerCallback(boost::bind(&TimeSynchronizer::cb8, this, _1));
}
template<class C>
- Connection connect(const C& callback)
+ Connection registerCallback(const C& callback)
{
boost::mutex::scoped_lock lock(signal_mutex_);
return Connection(boost::bind(&TimeSynchronizer::disconnect, this, _1), signal_.connect(boost::bind(callback, _1, _2, _3, _4, _5, _6, _7, _8, _9)));
Modified: pkg/trunk/sandbox/message_filters/test/time_sequencer_unittest.cpp
===================================================================
--- pkg/trunk/sandbox/message_filters/test/time_sequencer_unittest.cpp 2009-07-17 20:49:52 UTC (rev 19135)
+++ pkg/trunk/sandbox/message_filters/test/time_sequencer_unittest.cpp 2009-07-17 20:53:58 UTC (rev 19136)
@@ -72,7 +72,7 @@
{
TimeSequencer<Msg> seq(ros::Duration(1.0), ros::Duration(0.01), 10);
Helper h;
- seq.connect(boost::bind(&Helper::cb, &h, _1));
+ seq.registerCallback(boost::b...
[truncated message content] |
|
From: <jam...@us...> - 2009-07-17 23:50:56
|
Revision: 19151
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19151&view=rev
Author: jamesbowman
Date: 2009-07-17 23:50:49 +0000 (Fri, 17 Jul 2009)
Log Message:
-----------
camera mode test
Modified Paths:
--------------
pkg/trunk/stacks/camera_drivers/dcam/src/python/dcam.cpp
pkg/trunk/vision/vision_tests/manifest.xml
pkg/trunk/vision/vision_tests/scripts/camera_hammer_1.py
Added Paths:
-----------
pkg/trunk/vision/vision_tests/scripts/
pkg/trunk/vision/vision_tests/scripts/loop.py
Removed Paths:
-------------
pkg/trunk/vision/vision_tests/src/
Modified: pkg/trunk/stacks/camera_drivers/dcam/src/python/dcam.cpp
===================================================================
--- pkg/trunk/stacks/camera_drivers/dcam/src/python/dcam.cpp 2009-07-17 23:37:00 UTC (rev 19150)
+++ pkg/trunk/stacks/camera_drivers/dcam/src/python/dcam.cpp 2009-07-17 23:50:49 UTC (rev 19151)
@@ -34,110 +34,41 @@
static void dcam_dealloc(PyObject *self)
{
+ // dcam::fini();
dcam_t *pc = (dcam_t*)self;
delete pc->dev;
PyObject_Del(self);
}
-#if 0
-static PyObject *dcam_repr(PyObject *self)
+static uint8_t *getdata(ImageData *id)
{
- dcam_t *cva = (dcam_t*)self;
- IplImage* ipl = (IplImage*)(cva->a);
- char str[1000];
- sprintf(str, "<dcam(");
- char *d = str + strlen(str);
- sprintf(d, "nChannels=%d ", ipl->nChannels);
- d += strlen(d);
- sprintf(d, "width=%d ", ipl->width);
- d += strlen(d);
- sprintf(d, "height=%d ", ipl->height);
- d += strlen(d);
- sprintf(d, "widthStep=%d ", ipl->widthStep);
- d += strlen(d);
- sprintf(d, ")>");
- return PyString_FromString(str);
+ // left window display, try rect, then raw
+ if (id->imRectColorType != COLOR_CODING_NONE)
+ return id->imRectColor;
+ else if (id->imRectType != COLOR_CODING_NONE)
+ return id->imRect;
+ else if (id->imColorType != COLOR_CODING_NONE)
+ return id->imColor;
+ else if (id->imType != COLOR_CODING_NONE)
+ return id->im;
+ else
+ return NULL;
}
-
-static PyObject *dcam_tostring(PyObject *self, PyObject *args)
+static size_t getdatasize(ImageData *id)
{
- IplImage *i;
- if (!convert_to_IplImage(self, &i, "self"))
- return NULL;
- if (i == NULL)
- return NULL;
- int bps;
- switch (i->depth) {
- case IPL_DEPTH_8U:
- case IPL_DEPTH_8S:
- bps = 1;
- break;
- case IPL_DEPTH_16U:
- case IPL_DEPTH_16S:
- bps = 2;
- break;
- case IPL_DEPTH_32S:
- case IPL_DEPTH_32F:
- bps = 4;
- break;
- case IPL_DEPTH_64F:
- bps = 8;
- break;
- default:
- bps = 0;
- assert(0);
- }
- int bpl = i->width * i->nChannels * bps;
- int l = bpl * i->height;
- char *s = new char[l];
- int y;
- for (y = 0; y < i->height; y++) {
- memcpy(s + y * bpl, i->imageData + y * i->widthStep, bpl);
- }
- return PyString_FromStringAndSize(s, l);
+ // left window display, try rect, then raw
+ if (id->imRectColorType != COLOR_CODING_NONE)
+ return id->imRectColorSize;
+ else if (id->imRectType != COLOR_CODING_NONE)
+ return id->imRectSize;
+ else if (id->imColorType != COLOR_CODING_NONE)
+ return id->imColorSize;
+ else if (id->imType != COLOR_CODING_NONE)
+ return id->imSize;
+ else
+ return 0;
}
-static PyObject *dcam_getnChannels(dcam_t *cva)
-{
- return PyInt_FromLong(((IplImage*)(cva->a))->nChannels);
-}
-static PyObject *dcam_getwidth(dcam_t *cva)
-{
- return PyInt_FromLong(((IplImage*)(cva->a))->width);
-}
-static PyObject *dcam_getheight(dcam_t *cva)
-{
- return PyInt_FromLong(((IplImage*)(cva->a))->height);
-}
-static PyObject *dcam_getdepth(dcam_t *cva)
-{
- return PyInt_FromLong(((IplImage*)(cva->a))->depth);
-}
-static PyObject *dcam_getorigin(dcam_t *cva)
-{
- return PyInt_FromLong(((IplImage*)(cva->a))->origin);
-}
-static void dcam_setorigin(dcam_t *cva, PyObject *v)
-{
- ((IplImage*)(cva->a))->origin = PyInt_AsLong(v);
-}
-
-static PyGetSetDef dcam_getseters[] = {
- {(char*)"nChannels", (getter)dcam_getnChannels, (setter)NULL, (char*)"nChannels", NULL},
- {(char*)"width", (getter)dcam_getwidth, (setter)NULL, (char*)"width", NULL},
- {(char*)"height", (getter)dcam_getheight, (setter)NULL, (char*)"height", NULL},
- {(char*)"depth", (getter)dcam_getdepth, (setter)NULL, (char*)"depth", NULL},
- {(char*)"origin", (getter)dcam_getorigin, (setter)dcam_setorigin, (char*)"origin", NULL},
- {NULL} /* Sentinel */
-};
-
-static PyMappingMethods dcam_as_map = {
- NULL,
- &cvarr_GetItem,
- &cvarr_SetItem,
-};
-#endif
-
static PyObject *dcam_getImage(PyObject *self, PyObject *args)
{
dcam_t *ps = (dcam_t*)self;
@@ -151,14 +82,19 @@
int w = stIm->imWidth;
int h = stIm->imHeight;
- assert(stIm->imLeft->imRect != NULL);
- assert(stIm->imRight->imRect != NULL);
+ uint8_t *Ld = NULL, *Rd = NULL; // left data, right data
+ Ld = getdata(stIm->imLeft);
+ Rd = getdata(stIm->imRight);
+
+ assert(Ld != NULL);
+ assert(Rd != NULL);
+
return Py_BuildValue("iiNN",
w,
h,
- PyBuffer_FromMemory(stIm->imLeft->imRect, w * h),
- PyBuffer_FromMemory(stIm->imRight->imRect, w * h));
+ PyBuffer_FromMemory(Ld, getdatasize(stIm->imLeft)),
+ PyBuffer_FromMemory(Rd, getdatasize(stIm->imRight)));
}
#if 0
printf("%p\n", stIm->imLeft->imRaw);
@@ -207,7 +143,13 @@
static PyObject *make_dcam(PyObject *self, PyObject *args)
{
dcam_t *ps = PyObject_NEW(dcam_t, &dcam_Type);
+ char *str_pmode;
+ if (!PyArg_ParseTuple(args, "s", &str_pmode))
+ return NULL;
+
+ dcam::init();
+
// This code copied from ost.cpp - it is the initialization sequence
// for the camera.
//
@@ -215,7 +157,17 @@
ps->dev = new dcam::StereoDcam(dcam::getGuid(devIndex));
ps->dev->setRangeMax(4.0); // in meters
ps->dev->setRangeMin(0.5); // in meters
- static videre_proc_mode_t pmode = PROC_MODE_RECTIFIED;
+ videre_proc_mode_t pmode = PROC_MODE_RECTIFIED;
+ if (strcmp(str_pmode, "rectified") == 0)
+ pmode = PROC_MODE_RECTIFIED;
+ else if (strcmp(str_pmode, "none") == 0)
+ pmode = PROC_MODE_NONE;
+ else if (strcmp(str_pmode, "test") == 0)
+ pmode = PROC_MODE_TEST;
+ else {
+ PyErr_SetString(PyExc_TypeError, "mode must be none/test/rectified ");
+ return NULL;
+ }
dc1394video_mode_t videoMode; // current video mode
dc1394framerate_t videoRate; // current video rate
videoMode = VIDERE_STEREO_640x480;
@@ -238,8 +190,6 @@
extern "C" void initdcam()
{
- dcam::init();
-
dcam_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE;
dcam_specials();
if (PyType_Ready(&dcam_Type) < 0)
Modified: pkg/trunk/vision/vision_tests/manifest.xml
===================================================================
--- pkg/trunk/vision/vision_tests/manifest.xml 2009-07-17 23:37:00 UTC (rev 19150)
+++ pkg/trunk/vision/vision_tests/manifest.xml 2009-07-17 23:50:49 UTC (rev 19151)
@@ -11,7 +11,11 @@
<depend package="rospy"/>
<depend package="sensor_msgs"/>
<depend package="robot_msgs"/>
+ <depend package="robot_actions"/>
+ <depend package="python_actions"/>
+ <depend package="tf"/>
<depend package="opencvpython"/>
+ <depend package="dcam"/>
<url>http://pr.willowgarage.com/wiki/vision_tests</url>
Property changes on: pkg/trunk/vision/vision_tests/scripts
___________________________________________________________________
Added: svn:mergeinfo
+
Modified: pkg/trunk/vision/vision_tests/scripts/camera_hammer_1.py
===================================================================
--- pkg/trunk/vision/vision_tests/src/camera_hammer_1.py 2009-07-17 20:15:00 UTC (rev 19131)
+++ pkg/trunk/vision/vision_tests/scripts/camera_hammer_1.py 2009-07-17 23:50:49 UTC (rev 19151)
@@ -43,13 +43,46 @@
import cv
import dcam
-self.dc = dcam.dcam()
+def runTest(mode):
+ print mode
+ dc = dcam.dcam(mode)
+ paramstr = dc.retParameters()
-paramstr = self.dc.retParameters()
+ for i in range(50):
+ print i
+ w,h,l,r = dc.getImage()
+ cv_l = cv.CreateImageHeader((w, h), cv.IPL_DEPTH_8U, 1)
+ cv.SetData(cv_l, str(l), w)
+ cv_r = cv.CreateImageHeader((w, h), cv.IPL_DEPTH_8U, 1)
+ cv.SetData(cv_r, str(r), w)
+ return (cv_l, cv_r)
-w,h,l,r = self.dc.getImage()
-sz = (w, h)
-print sz
-#li = Im(sz, l)
-#ri = Im(sz, r)
+def compose(a, b):
+ w,h = cv.GetSize(a)
+ r = cv.CreateImage((w*2, h), cv.IPL_DEPTH_8U, 1)
+ cv.SetImageROI(r, (0, 0, w, h))
+ cv.Copy(a, r)
+ cv.SetImageROI(r, (w, 0, w, h))
+ cv.Copy(b, r)
+ cv.ResetImageROI(r)
+ return r
+i = int(sys.argv[1])
+m = sys.argv[2]
+l,r = runTest(m)
+comp = compose(l, r)
+cv.SaveImage("cam-%s-%06d.png" % (m, i), compose(l, r))
+
+## Collect goldens
+#modes = ('none', 'test')
+#goldens = {}
+#for m in modes:
+# goldens[m] = runTest(m)
+#
+#modes = ('test',)
+#for i in range(10):
+# for m in modes:
+# gl,gr = goldens[m]
+# l,r = runTest(m)
+# comp = compose(l, r)
+# cv.SaveImage("cam-%s-%06d.png" % (m, i), compose(l, r))
Added: pkg/trunk/vision/vision_tests/scripts/loop.py
===================================================================
--- pkg/trunk/vision/vision_tests/scripts/loop.py (rev 0)
+++ pkg/trunk/vision/vision_tests/scripts/loop.py 2009-07-17 23:50:49 UTC (rev 19151)
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+# Software License Agreement (BSD License)
+#
+# Copyright (c) 2009, Willow Garage, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+# * Neither the name of the Willow Garage nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+import os
+
+modes = ('none', 'test')
+for i in range(10):
+ for m in modes:
+ os.system("scripts/camera_hammer_1.py %d %s" % (i, m))
Property changes on: pkg/trunk/vision/vision_tests/scripts/loop.py
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wa...@us...> - 2009-07-20 06:50:49
|
Revision: 19187
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19187&view=rev
Author: wattsk
Date: 2009-07-20 06:50:39 +0000 (Mon, 20 Jul 2009)
Log Message:
-----------
Moved ntp_monitor to pr2_computer_monitor, removed dep on runtime_monitor from pr2_alpha
Modified Paths:
--------------
pkg/trunk/stacks/pr2/pr2_alpha/manifest.xml
pkg/trunk/stacks/pr2/pr2_alpha/pre.launch
pkg/trunk/stacks/pr2/pr2_alpha/pre.people.launch
pkg/trunk/stacks/pr2/pr2_alpha/prf.launch
pkg/trunk/stacks/pr2/pr2_alpha/prf_manip.launch
pkg/trunk/stacks/pr2/pr2_alpha/prg.launch
pkg/trunk/stacks/pr2/pr2_alpha/prg.people.launch
Added Paths:
-----------
pkg/trunk/pr2/pr2_computer_monitor/scripts/ntp_monitor.py
Removed Paths:
-------------
pkg/trunk/stacks/hardware_test/runtime_monitor/scripts/ntp_monitor.py
Added: pkg/trunk/pr2/pr2_computer_monitor/scripts/ntp_monitor.py
===================================================================
--- pkg/trunk/pr2/pr2_computer_monitor/scripts/ntp_monitor.py (rev 0)
+++ pkg/trunk/pr2/pr2_computer_monitor/scripts/ntp_monitor.py 2009-07-20 06:50:39 UTC (rev 19187)
@@ -0,0 +1,98 @@
+#!/usr/bin/env python
+# Software License Agreement (BSD License)
+#
+# Copyright (c) 2008, Willow Garage, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+# * Neither the name of the Willow Garage nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+import roslib
+roslib.load_manifest('pr2_computer_monitor')
+
+from diagnostic_msgs.msg import DiagnosticMessage, DiagnosticStatus, DiagnosticValue, DiagnosticString
+import sys
+import rospy
+import socket
+from subprocess import Popen, PIPE
+
+import time
+
+import re
+
+NAME = 'ntp_monitor'
+
+def ntp_monitor(ntp_hostname, offset=500):
+ pub = rospy.Publisher("/diagnostics", DiagnosticMessage)
+ rospy.init_node(NAME, anonymous=True)
+
+ hostname = socket.gethostbyaddr(socket.gethostname())[0]
+
+ while not rospy.is_shutdown():
+ try:
+ p = Popen(["ntpdate", "-q", ntp_hostname], stdout=PIPE, stdin=PIPE, stderr=PIPE)
+ res = p.wait()
+ (o,e) = p.communicate()
+ except OSError, (errno, msg):
+ if errno == 4:
+ break #ctrl-c interrupt
+ else:
+ raise
+ if (res == 0):
+ measured_offset = float(re.search("offset (.*),", o).group(1))*1000000
+ if (abs(measured_offset) < offset):
+ stat = DiagnosticStatus(0,"NTP offset from: "+ hostname + " to: " +ntp_hostname, "Acceptable synchronization", [DiagnosticValue(measured_offset,"offset (us)")],[])
+ print measured_offset
+ else:
+ stat = DiagnosticStatus(2,"NTP offset from: "+ hostname + " to: " +ntp_hostname, "Offset too great", [DiagnosticValue(measured_offset,"offset (us)")],[])
+ else:
+ stat = DiagnosticStatus(2,"NTP offset from: "+ hostname + " to: " +ntp_hostname, "Failure to run ntpdate -q", [],[])
+
+ pub.publish(DiagnosticMessage(None, [stat]))
+ time.sleep(1)
+
+def ntp_monitor_main(argv=sys.argv):
+ import optparse
+ parser = optparse.OptionParser(usage="usage: ntp_monitor ntp-hostname [offset-tolerance]")
+ options, args = parser.parse_args(argv[1:])
+ if len(args) == 1:
+ ntp_hostname, offset = args[0], 500
+ elif len(args) == 2:
+ ntp_hostname, offset = args
+ try:
+ offset = int(offset)
+ except:
+ parser.error("offset must be a number")
+ else:
+ parser.error("Invalid arguments")
+ ntp_monitor(ntp_hostname, offset)
+
+if __name__ == "__main__":
+ try:
+ ntp_monitor_main(rospy.myargv())
+ except KeyboardInterrupt: pass
+
Property changes on: pkg/trunk/pr2/pr2_computer_monitor/scripts/ntp_monitor.py
___________________________________________________________________
Added: svn:executable
+ *
Deleted: pkg/trunk/stacks/hardware_test/runtime_monitor/scripts/ntp_monitor.py
===================================================================
--- pkg/trunk/stacks/hardware_test/runtime_monitor/scripts/ntp_monitor.py 2009-07-20 06:48:59 UTC (rev 19186)
+++ pkg/trunk/stacks/hardware_test/runtime_monitor/scripts/ntp_monitor.py 2009-07-20 06:50:39 UTC (rev 19187)
@@ -1,98 +0,0 @@
-#!/usr/bin/env python
-# Software License Agreement (BSD License)
-#
-# Copyright (c) 2008, Willow Garage, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided
-# with the distribution.
-# * Neither the name of the Willow Garage nor the names of its
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-import roslib
-roslib.load_manifest('runtime_monitor')
-
-from diagnostic_msgs.msg import DiagnosticMessage, DiagnosticStatus, DiagnosticValue, DiagnosticString
-import sys
-import rospy
-import socket
-from subprocess import Popen, PIPE
-
-import time
-
-import re
-
-NAME = 'ntp_monitor'
-
-def ntp_monitor(ntp_hostname, offset=500):
- pub = rospy.Publisher("/diagnostics", DiagnosticMessage)
- rospy.init_node(NAME, anonymous=True)
-
- hostname = socket.gethostbyaddr(socket.gethostname())[0]
-
- while not rospy.is_shutdown():
- try:
- p = Popen(["ntpdate", "-q", ntp_hostname], stdout=PIPE, stdin=PIPE, stderr=PIPE)
- res = p.wait()
- (o,e) = p.communicate()
- except OSError, (errno, msg):
- if errno == 4:
- break #ctrl-c interrupt
- else:
- raise
- if (res == 0):
- measured_offset = float(re.search("offset (.*),", o).group(1))*1000000
- if (abs(measured_offset) < offset):
- stat = DiagnosticStatus(0,"NTP offset from: "+ hostname + " to: " +ntp_hostname, "Acceptable synchronization", [DiagnosticValue(measured_offset,"offset (us)")],[])
- print measured_offset
- else:
- stat = DiagnosticStatus(2,"NTP offset from: "+ hostname + " to: " +ntp_hostname, "Offset too great", [DiagnosticValue(measured_offset,"offset (us)")],[])
- else:
- stat = DiagnosticStatus(2,"NTP offset from: "+ hostname + " to: " +ntp_hostname, "Failure to run ntpdate -q", [],[])
-
- pub.publish(DiagnosticMessage(None, [stat]))
- time.sleep(1)
-
-def ntp_monitor_main(argv=sys.argv):
- import optparse
- parser = optparse.OptionParser(usage="usage: ntp_monitor ntp-hostname [offset-tolerance]")
- options, args = parser.parse_args(argv[1:])
- if len(args) == 1:
- ntp_hostname, offset = args[0], 500
- elif len(args) == 2:
- ntp_hostname, offset = args
- try:
- offset = int(offset)
- except:
- parser.error("offset must be a number")
- else:
- parser.error("Invalid arguments")
- ntp_monitor(ntp_hostname, offset)
-
-if __name__ == "__main__":
- try:
- ntp_monitor_main(rospy.myargv())
- except KeyboardInterrupt: pass
-
Modified: pkg/trunk/stacks/pr2/pr2_alpha/manifest.xml
===================================================================
--- pkg/trunk/stacks/pr2/pr2_alpha/manifest.xml 2009-07-20 06:48:59 UTC (rev 19186)
+++ pkg/trunk/stacks/pr2/pr2_alpha/manifest.xml 2009-07-20 06:50:39 UTC (rev 19187)
@@ -1,5 +1,5 @@
-<package>
+
<description brief="The scripts to run the PR2 Alpha base">
This package contains XML descriptions of robots in the format
@@ -23,7 +23,6 @@
<depend package="imu_node"/>
<depend package="dcam"/>
<depend package="robot_pose_ekf"/>
- <depend package="runtime_monitor"/>
<depend package="sound_play"/>
<depend package="joint_calibration_monitor" />
<depend package="forearm_cam" />
Modified: pkg/trunk/stacks/pr2/pr2_alpha/pre.launch
===================================================================
--- pkg/trunk/stacks/pr2/pr2_alpha/pre.launch 2009-07-20 06:48:59 UTC (rev 19186)
+++ pkg/trunk/stacks/pr2/pr2_alpha/pre.launch 2009-07-20 06:50:39 UTC (rev 19187)
@@ -59,8 +59,8 @@
<node pkg="rosrecord" type="rosrecord" args="-f /hwlog/pre_runtime_automatic /diagnostics" />
<!-- NTP monitoring script Warns to console if sync error
- <node pkg="runtime_monitor" type="ntp_monitor.py" args="pre2" machine="realtime"/>
- <node pkg="runtime_monitor" type="ntp_monitor.py" args="fw1 7000" machine="two"/>
+ <node pkg="pr2_computer_monitor" type="ntp_monitor.py" args="pre2" machine="realtime"/>
+ <node pkg="pr2_computer_monitor" type="ntp_monitor.py" args="fw1 7000" machine="two"/>
-->
<!-- Disk usage monitoring script Warns to console if disk full -->
Modified: pkg/trunk/stacks/pr2/pr2_alpha/pre.people.launch
===================================================================
--- pkg/trunk/stacks/pr2/pr2_alpha/pre.people.launch 2009-07-20 06:48:59 UTC (rev 19186)
+++ pkg/trunk/stacks/pr2/pr2_alpha/pre.people.launch 2009-07-20 06:50:39 UTC (rev 19187)
@@ -59,10 +59,10 @@
<node pkg="rosrecord" type="rosrecord" args="-f /hwlog/pre_runtime_automatic /diagnostics" />
<!-- NTP monitoring script Warns to console if sync error -->
- <node pkg="runtime_monitor" type="ntp_monitor.py" args="pre2" machine="realtime"/>
- <node pkg="runtime_monitor" type="ntp_monitor.py" args="fw1 7000" machine="two"/>
- <node pkg="runtime_monitor" type="ntp_monitor.py" args="pre2" machine="three"/>
- <node pkg="runtime_monitor" type="ntp_monitor.py" args="pre2" machine="four"/>
+ <node pkg="pr2_computer_monitor" type="ntp_monitor.py" args="pre2" machine="realtime"/>
+ <node pkg="pr2_computer_monitor" type="ntp_monitor.py" args="fw1 7000" machine="two"/>
+ <node pkg="pr2_computer_monitor" type="ntp_monitor.py" args="pre2" machine="three"/>
+ <node pkg="pr2_computer_monitor" type="ntp_monitor.py" args="pre2" machine="four"/>
</launch>
Modified: pkg/trunk/stacks/pr2/pr2_alpha/prf.launch
===================================================================
--- pkg/trunk/stacks/pr2/pr2_alpha/prf.launch 2009-07-20 06:48:59 UTC (rev 19186)
+++ pkg/trunk/stacks/pr2/pr2_alpha/prf.launch 2009-07-20 06:50:39 UTC (rev 19187)
@@ -98,10 +98,10 @@
<node pkg="joint_calibration_monitor" type="pr2_calibration_monitor_node.py" machine="two" />
<!-- NTP monitoring script Warns to console if sync error -->
- <node pkg="runtime_monitor" type="ntp_monitor.py" args="prf2" machine="realtime"/>
- <node pkg="runtime_monitor" type="ntp_monitor.py" args="fw1 7000" machine="two"/>
- <node pkg="runtime_monitor" type="ntp_monitor.py" args="prf2" machine="three"/>
- <node pkg="runtime_monitor" type="ntp_monitor.py" args="prf2" machine="four"/>
+ <node pkg="pr2_computer_monitor" type="ntp_monitor.py" args="prf2" machine="realtime"/>
+ <node pkg="pr2_computer_monitor" type="ntp_monitor.py" args="fw1 7000" machine="two"/>
+ <node pkg="pr2_computer_monitor" type="ntp_monitor.py" args="prf2" machine="three"/>
+ <node pkg="pr2_computer_monitor" type="ntp_monitor.py" args="prf2" machine="four"/>
<!-- Disk, CPU monitoring scripts. -->
<include file="$(find pr2_alpha)/pr2_monitors.launch" />
Modified: pkg/trunk/stacks/pr2/pr2_alpha/prf_manip.launch
===================================================================
--- pkg/trunk/stacks/pr2/pr2_alpha/prf_manip.launch 2009-07-20 06:48:59 UTC (rev 19186)
+++ pkg/trunk/stacks/pr2/pr2_alpha/prf_manip.launch 2009-07-20 06:50:39 UTC (rev 19187)
@@ -78,9 +78,9 @@
<node pkg="rosrecord" type="rosrecord" args="-f /hwlog/prf_runtime_automatic /diagnostics" />
<!-- NTP monitoring script Warns to console if sync error -->
- <node pkg="runtime_monitor" type="ntp_monitor.py" args="prf2" machine="realtime"/>
- <node pkg="runtime_monitor" type="ntp_monitor.py" args="prf2" machine="three"/>
- <node pkg="runtime_monitor" type="ntp_monitor.py" args="prf2" machine="four"/>
+ <node pkg="pr2_computer_monitor" type="ntp_monitor.py" args="prf2" machine="realtime"/>
+ <node pkg="pr2_computer_monitor" type="ntp_monitor.py" args="prf2" machine="three"/>
+ <node pkg="pr2_computer_monitor" type="ntp_monitor.py" args="prf2" machine="four"/>
</launch>
Modified: pkg/trunk/stacks/pr2/pr2_alpha/prg.launch
===================================================================
--- pkg/trunk/stacks/pr2/pr2_alpha/prg.launch 2009-07-20 06:48:59 UTC (rev 19186)
+++ pkg/trunk/stacks/pr2/pr2_alpha/prg.launch 2009-07-20 06:50:39 UTC (rev 19187)
@@ -96,10 +96,10 @@
<node pkg="joint_calibration_monitor" type="pr2_calibration_monitor_node.py" machine="two" />
-->
<!-- NTP monitoring script Warns to console if sync error -->
- <node pkg="runtime_monitor" type="ntp_monitor.py" args="prg2" machine="realtime"/>
- <node pkg="runtime_monitor" type="ntp_monitor.py" args="fw1 7000" machine="two"/>
- <node pkg="runtime_monitor" type="ntp_monitor.py" args="prg2" machine="three"/>
- <node pkg="runtime_monitor" type="ntp_monitor.py" args="prg2" machine="four"/>
+ <node pkg="pr2_computer_monitor" type="ntp_monitor.py" args="prg2" machine="realtime"/>
+ <node pkg="pr2_computer_monitor" type="ntp_monitor.py" args="fw1 7000" machine="two"/>
+ <node pkg="pr2_computer_monitor" type="ntp_monitor.py" args="prg2" machine="three"/>
+ <node pkg="pr2_computer_monitor" type="ntp_monitor.py" args="prg2" machine="four"/>
<!-- Disk, CPU monitoring scripts. -->
<include file="$(find pr2_alpha)/pr2_monitors.launch" />
Modified: pkg/trunk/stacks/pr2/pr2_alpha/prg.people.launch
===================================================================
--- pkg/trunk/stacks/pr2/pr2_alpha/prg.people.launch 2009-07-20 06:48:59 UTC (rev 19186)
+++ pkg/trunk/stacks/pr2/pr2_alpha/prg.people.launch 2009-07-20 06:50:39 UTC (rev 19187)
@@ -58,10 +58,10 @@
<node pkg="rosrecord" type="rosrecord" args="-f /hwlog/prg_runtime_automatic /diagnostics" />
<!-- NTP monitoring script Warns to console if sync error -->
- <node pkg="runtime_monitor" type="ntp_monitor.py" args="prg2" machine="realtime"/>
- <node pkg="runtime_monitor" type="ntp_monitor.py" args="fw1 7000" machine="two"/>
- <node pkg="runtime_monitor" type="ntp_monitor.py" args="prg2" machine="three"/>
- <node pkg="runtime_monitor" type="ntp_monitor.py" args="prg2" machine="four"/>
+ <node pkg="pr2_computer_monitor" type="ntp_monitor.py" args="prg2" machine="realtime"/>
+ <node pkg="pr2_computer_monitor" type="ntp_monitor.py" args="fw1 7000" machine="two"/>
+ <node pkg="pr2_computer_monitor" type="ntp_monitor.py" args="prg2" machine="three"/>
+ <node pkg="pr2_computer_monitor" type="ntp_monitor.py" args="prg2" machine="four"/>
</launch>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <stu...@us...> - 2009-07-21 00:22:19
|
Revision: 19244
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19244&view=rev
Author: stuglaser
Date: 2009-07-21 00:22:16 +0000 (Tue, 21 Jul 2009)
Log Message:
-----------
JointUDCalibrationController with nodehandle-style init
Modified Paths:
--------------
pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_ud_calibration_controller.h
pkg/trunk/controllers/robot_mechanism_controllers/src/joint_ud_calibration_controller.cpp
pkg/trunk/stacks/pr2/pr2_default_controllers/pr2_calibration_controllers.yaml
Modified: pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_ud_calibration_controller.h
===================================================================
--- pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_ud_calibration_controller.h 2009-07-21 00:16:07 UTC (rev 19243)
+++ pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/joint_ud_calibration_controller.h 2009-07-21 00:22:16 UTC (rev 19244)
@@ -34,6 +34,7 @@
#pragma once
+#include "ros/node_handle.h"
#include "mechanism_model/robot.h"
#include "robot_mechanism_controllers/joint_velocity_controller.h"
#include "realtime_tools/realtime_publisher.h"
@@ -50,6 +51,7 @@
virtual ~JointUDCalibrationController();
virtual bool initXml(mechanism::RobotState *robot, TiXmlElement *config);
+ virtual bool init(mechanism::RobotState *robot, const ros::NodeHandle &n);
virtual void update();
@@ -62,6 +64,11 @@
protected:
+ mechanism::RobotState* robot_;
+ ros::NodeHandle node_;
+ boost::scoped_ptr<realtime_tools::RealtimePublisher<std_msgs::Empty> > pub_calibrated_;
+ double last_publish_time_;
+
enum { INITIALIZED, BEGINNING, MOVING_TO_LOW, MOVING_TO_HIGH, CALIBRATED };
int state_;
int countdown_;
Modified: pkg/trunk/controllers/robot_mechanism_controllers/src/joint_ud_calibration_controller.cpp
===================================================================
--- pkg/trunk/controllers/robot_mechanism_controllers/src/joint_ud_calibration_controller.cpp 2009-07-21 00:16:07 UTC (rev 19243)
+++ pkg/trunk/controllers/robot_mechanism_controllers/src/joint_ud_calibration_controller.cpp 2009-07-21 00:22:16 UTC (rev 19244)
@@ -38,10 +38,11 @@
using namespace std;
using namespace controller;
-//ROS_REGISTER_CONTROLLER(JointUDCalibrationController)
+ROS_REGISTER_CONTROLLER(JointUDCalibrationController)
JointUDCalibrationController::JointUDCalibrationController()
- : state_(INITIALIZED), actuator_(NULL), joint_(NULL), transmission_(NULL)
+: robot_(NULL), last_publish_time_(0), state_(INITIALIZED),
+ actuator_(NULL), joint_(NULL), transmission_(NULL)
{
}
@@ -110,6 +111,75 @@
return true;
}
+bool JointUDCalibrationController::init(mechanism::RobotState *robot, const ros::NodeHandle &n)
+{
+ robot_ = robot;
+ node_ = n;
+
+ // Joint
+
+ std::string joint_name;
+ if (!node_.getParam("joint", joint_name))
+ {
+ ROS_ERROR("No joint given (namespace: %s)", node_.getNamespace().c_str());
+ return false;
+ }
+ if (!(joint_ = robot->getJointState(joint_name)))
+ {
+ ROS_ERROR("Could not find joint %s (namespace: %s)",
+ joint_name.c_str(), node_.getNamespace().c_str());
+ return false;
+ }
+
+ // Actuator
+
+ std::string actuator_name;
+ if (!node_.getParam("actuator", actuator_name))
+ {
+ ROS_ERROR("No actuator given (namespace: %s)", node_.getNamespace().c_str());
+ return false;
+ }
+ if (!(actuator_ = robot->model_->getActuator(actuator_name)))
+ {
+ ROS_ERROR("Could not find actuator %s (namespace: %s)",
+ actuator_name.c_str(), node_.getNamespace().c_str());
+ return false;
+ }
+
+ // Transmission
+
+ std::string transmission_name;
+ if (!node_.getParam("transmission", transmission_name))
+ {
+ ROS_ERROR("No transmission given (namespace: %s)", node_.getNamespace().c_str());
+ return false;
+ }
+ if (!(transmission_ = robot->model_->getTransmission(transmission_name)))
+ {
+ ROS_ERROR("Could not find transmission %s (namespace: %s)",
+ transmission_name.c_str(), node_.getNamespace().c_str());
+ return false;
+ }
+
+ if (!node_.getParam("velocity", search_velocity_))
+ {
+ ROS_ERROR("Velocity value was not specified (namespace: %s)", node_.getNamespace().c_str());
+ return false;
+ }
+
+ // Contained velocity controller
+
+ if (!vc_.init(robot, node_))
+ return false;
+
+ // "Calibrated" topic
+ pub_calibrated_.reset(
+ new realtime_tools::RealtimePublisher<std_msgs::Empty>(node_, "calibrated", 1));
+
+ return true;
+}
+
+
void JointUDCalibrationController::update()
{
assert(joint_);
@@ -171,6 +241,18 @@
break;
}
case CALIBRATED:
+ if (pub_calibrated_)
+ {
+ if (last_publish_time_ + 0.5 < robot_->hw_->current_time_)
+ {
+ assert(pub_calibrated_);
+ if (pub_calibrated_->trylock())
+ {
+ last_publish_time_ = robot_->hw_->current_time_;
+ pub_calibrated_->unlockAndPublish();
+ }
+ }
+ }
break;
}
Modified: pkg/trunk/stacks/pr2/pr2_default_controllers/pr2_calibration_controllers.yaml
===================================================================
--- pkg/trunk/stacks/pr2/pr2_default_controllers/pr2_calibration_controllers.yaml 2009-07-21 00:16:07 UTC (rev 19243)
+++ pkg/trunk/stacks/pr2/pr2_default_controllers/pr2_calibration_controllers.yaml 2009-07-21 00:22:16 UTC (rev 19244)
@@ -2,7 +2,7 @@
type: JointUDCalibrationController
joint: torso_lift_joint
actuator: torso_lift_motor
- transmision: torso_lift_trans
+ transmission: torso_lift_trans
velocity: -10.0
pid:
p: 2000000
@@ -20,7 +20,7 @@
i: 0.5
d: 0
i_clamp: 1.0
-call_shoulder_pan:
+cal_l_shoulder_pan:
type: JointUDCalibrationController
joint: l_shoulder_pan_joint
actuator: l_shoulder_pan_motor
@@ -188,7 +188,7 @@
cal_caster_fl:
type: CasterCalibrationController
- <<: caster_calibration
+ <<: *caster_calibration
actuator: fl_caster_rotation_motor
joint: fl_caster_rotation_joint
transmission: fl_caster_rotation_trans
@@ -198,7 +198,7 @@
wheel_r: fl_caster_r_wheel_joint
cal_caster_fr:
type: CasterCalibrationController
- <<: caster_calibration
+ <<: *caster_calibration
actuator: fr_caster_rotation_motor
joint: fr_caster_rotation_joint
transmission: fr_caster_rotation_trans
@@ -208,7 +208,7 @@
wheel_r: fr_caster_r_wheel_joint
cal_caster_bl:
type: CasterCalibrationController
- <<: caster_calibration
+ <<: *caster_calibration
actuator: bl_caster_rotation_motor
joint: bl_caster_rotation_joint
transmission: bl_caster_rotation_trans
@@ -218,7 +218,7 @@
wheel_r: bl_caster_r_wheel_joint
cal_caster_br:
type: CasterCalibrationController
- <<: caster_calibration
+ <<: *caster_calibration
actuator: br_caster_rotation_motor
joint: br_caster_rotation_joint
transmission: br_caster_rotation_trans
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wa...@us...> - 2009-07-21 06:44:57
|
Revision: 19293
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19293&view=rev
Author: wattsk
Date: 2009-07-21 06:44:50 +0000 (Tue, 21 Jul 2009)
Log Message:
-----------
Updated hd and cpu monitor to use threading to reduce load and lag. Hddtemp now called with socket
Modified Paths:
--------------
pkg/trunk/pr2/pr2_computer_monitor/cpu_monitor.launch
pkg/trunk/pr2/pr2_computer_monitor/hd_monitor.launch
pkg/trunk/pr2/pr2_computer_monitor/scripts/cpu_monitor.py
pkg/trunk/pr2/pr2_computer_monitor/scripts/hd_monitor.py
pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_head_cart/cart_monitors.launch
pkg/trunk/stacks/pr2/pr2_alpha/pr2_monitors.launch
Removed Paths:
-------------
pkg/trunk/pr2/pr2_computer_monitor/scripts/disk_usage.py
Modified: pkg/trunk/pr2/pr2_computer_monitor/cpu_monitor.launch
===================================================================
--- pkg/trunk/pr2/pr2_computer_monitor/cpu_monitor.launch 2009-07-21 06:36:25 UTC (rev 19292)
+++ pkg/trunk/pr2/pr2_computer_monitor/cpu_monitor.launch 2009-07-21 06:44:50 UTC (rev 19293)
@@ -2,8 +2,9 @@
<!-- Should make this be localhost or whatever -->
<machine name="local_root" user="root" address="nsf" ros-root="$(env ROS_ROOT)" ros-package-path="$(env ROS_PACKAGE_PATH)" default="never"/>
- <param name="no_cpu_temp" value="True" />
-
<!-- Set machine to robot machine in final version -->
+ <param name="check_ipmi_tool" value="False" />
<node machine="local_root" pkg="pr2_computer_monitor" type="cpu_monitor.py" />
+
+
</launch>
\ No newline at end of file
Modified: pkg/trunk/pr2/pr2_computer_monitor/hd_monitor.launch
===================================================================
--- pkg/trunk/pr2/pr2_computer_monitor/hd_monitor.launch 2009-07-21 06:36:25 UTC (rev 19292)
+++ pkg/trunk/pr2/pr2_computer_monitor/hd_monitor.launch 2009-07-21 06:44:50 UTC (rev 19293)
@@ -5,5 +5,8 @@
<param name="no_hd_temp_warn" value="True" />
<!-- Set machine to robot machine in final version -->
- <node machine="local_root" pkg="pr2_computer_monitor" type="hd_monitor.py" args="$(optenv HOME /home) /dev/sda /dev/sdb" />
+ <node machine="local_root" pkg="pr2_computer_monitor" type="hd_monitor.py"
+ args="$(optenv HOME /home)" />
+
+
</launch>
\ No newline at end of file
Modified: pkg/trunk/pr2/pr2_computer_monitor/scripts/cpu_monitor.py
===================================================================
--- pkg/trunk/pr2/pr2_computer_monitor/scripts/cpu_monitor.py 2009-07-21 06:36:25 UTC (rev 19292)
+++ pkg/trunk/pr2/pr2_computer_monitor/scripts/cpu_monitor.py 2009-07-21 06:44:50 UTC (rev 19293)
@@ -41,8 +41,10 @@
import traceback
import threading
+from threading import Timer
import sys, os, time
import subprocess
+import string
import socket
@@ -50,115 +52,219 @@
stat_dict = { 0: 'OK', 1: 'Warning', 2: 'Error' }
-def check_cpu_temp(hostname):
- stat = DiagnosticStatus()
- stat.name = '%s CPU Temp Data' % hostname
- stat.strings = []
- stat.values = []
+# Output entire IPMI data set
+def check_ipmi():
+ diag_strs = []
+ diag_vals = []
+ diag_msgs = []
+ diag_level = 0
try:
- p = subprocess.Popen('sudo ipmitool sdr type Temperature',
+ p = subprocess.Popen('ipmitool sdr',
stdout = subprocess.PIPE,
stderr = subprocess.PIPE, shell = True)
stdout, stderr = p.communicate()
retcode = p.returncode
-
- stat.level = retcode
-
- if retcode == 0:
- stat.level = 0
- stat.message = 'OK'
- else:
- stat.level = 2
- stat.message = 'Bad return code'
- stat.strings.append(DiagnosticString(label = 'Error code: %d' % retcode, value = stderr.replace('\n', '')))
-
- # Parse STDOUT for temp, device ID
+ if retcode != 0:
+ diag_level = 2
+ diag_msg = [ 'ipmitool Error' ]
+ diag_strs = [ DiagnosticString(label = 'IPMI Error', value = stderr) ]
+ return diag_strs, diag_vals, diag_msgs, diag_level
+
lines = stdout.split('\n')
if len(lines) < 2:
- stat.strings.append(DiagnosticString(label = 'ipmitool status', value = 'No output'))
- stat.message = 'No response'
- stat.level = 1
+ diag_strs = [ DiagnosticString(label = 'ipmitool status', value = 'No output') ]
+ diag_msgs = [ 'No response' ]
+ diag_level = 2
+ return diag_strs, diag_vals, diag_msgs, diag_level
+
for ln in lines:
-
- lst = ln.split('|')
- if lst[-1].endswith('degrees C'):
- tmp = lst[-1].rstrip('degrees C').lstrip()
- if unicode(tmp).isnumeric():
- stat.values.append(DiagnosticValue(label = lst[0], value = float(tmp)))
- else:
- stat.strings.append(DiagnosticString(label = lst[0], value = lst[-1]))
-
+ if len(ln) < 2:
+ continue
+ words = ln.split('|')
+ name = words[0].strip()
+ ipmi_val = words[1].strip()
+ stat_byte = words[1].strip()
+
+ # CPU temps
+ if words[0].startswith('CPU') and words[0].strip().endswith('Temp'):
+ if words[1].strip().endswith('degrees C'):
+ tmp = ipmi_val.rstrip(' degrees C').lstrip()
+ if unicode(tmp).isnumeric():
+ temperature = float(tmp)
+ diag_vals.append(DiagnosticValue(label = name, value = temperature))
+
+ cpu_name = name.split()[0]
+ if temperature >= 80 and temperature < 85:
+ diag_level = max(diag_level, 1)
+ if diag_msgs.count('CPU Hot') == 0:
+ diag_msgs.append('CPU Warm')
+ if temperature >= 85:
+ diag_level = max(diag_level, 2)
+ diag_msgs.append('CPU Hot')
+ # Don't keep CPU Warm in list if CPU is hot
+ if diag_msgs.count('CPU Warm') > 0:
+ idx = diag_msgs.index('CPU Warm')
+ diag_msgs.pop(idx)
+
+
+ else:
+ diag_strs.append(DiagnosticString(label = name, value = words[1]))
+
+
+ # MP, BP, FP temps
+ if name == 'MB Temp' or name == 'BP Temp' or name == 'FP Temp':
+ if ipmi_val.endswith('degrees C'):
+ tmp = ipmi_val.rstrip(' degrees C').lstrip()
+ if unicode(tmp).isnumeric():
+ temperature = float(tmp)
+ diag_vals.append(DiagnosticValue(label = name, value = temperature))
+
+ dev_name = name.split()[0]
+ if temperature >= 60 and temperature < 70:
+ diag_level = max(diag_level, 1)
+ diag_msgs.append('%s Warm' % dev_name)
+ if temperature >= 70:
+ diag_level = max(diag_level, 2)
+ diag_msgs.append('%s Hot' % dev_name)
+
+ else:
+ diag_strs.append(DiagnosticString(label = name, value = ipmi_val))
+
+ # CPU fan speeds
+ if (name.startswith('CPU') and name.endswith('Fan')) or name == 'MB Fan':
+ if ipmi_val.endswith('RPM'):
+ rpm = ipmi_val.rstrip(' RPM').lstrip()
+ if unicode(rpm).isnumeric():
+ rpm = float(rpm)
+ diag_vals.append(DiagnosticValue(label = name, value = rpm))
+ else:
+ diag_strs.append(DiagnosticString(label = name, value = ipmi_val))
+
+ # If CPU is hot we get an alarm from ipmitool, report that too
+ if name.startswith('CPU') and name.endswith('hot'):
+ if ipmi_val == '0x01':
+ diag_strs.append(DiagnosticString(label = name, value = 'OK'))
+ else:
+ diag_strs.append(DiagnosticString(label = name, value = 'Hot'))
+ diag_level = max(diag_level, 2)
+ diag_msgs.append('CPU Hot Alarm')
+
except Exception, e:
- traceback.print_exc()
+ diag_strs.append(DiagnosticString(label = 'Exception', value = traceback.format_exc()))
+ diag_level = 2
+ diag_msgs.append('Exception')
+
+ return diag_strs, diag_vals, diag_msgs, diag_level
- stat.level = 2
- stat.message = 'Exception'
- stat.strings.append(DiagnosticString(label = 'Exception', value = str(e)))
+
+# Check core temps
+# Use 'find /sys -name temp1_input' to find cores
+# Read from every core, divide by 1000
+def check_core_temps(sys_temp_strings):
+ diag_vals = []
+ diag_strs = []
+ diag_level = 0
+ diag_msgs = []
+
+ for index, temp_str in enumerate(sys_temp_strings):
+ if len(temp_str) < 5:
+ continue
- return stat
+ cmd = 'cat %s' % temp_str
+ p = subprocess.Popen(cmd, stdout = subprocess.PIPE,
+ stderr = subprocess.PIPE, shell = True)
+ stdout, stderr = p.communicate()
+ retcode = p.returncode
+ if retcode != 0:
+ diag_level = 2
+ diag_msg = [ 'Core Temp Error' ]
+ diag_strs = [ DiagnosticString(label = 'Core Temp Error', value = stderr), DiagnosticString(label = 'Output', value = stdout) ]
+ return diag_strs, diag_vals, diag_msgs, diag_level
+
+ tmp = stdout.strip()
+ if unicode(tmp).isnumeric():
+ temp = float(tmp) / 1000
+ diag_vals.append(DiagnosticValue(label = 'Core %d Temp' % index, value = temp))
+ if temp >= 80 and temp < 85:
+ diag_level = max(diag_level, 1)
+ diag_msgs.append('Warm')
+ if temp >= 85:
+ diag_level = max(diag_level, 2)
+ diag_msgs.append('Hot')
+ else:
+ diag_strs.append(DiagnosticString(label = 'Core %s Temp' % index, value = tmp))
-def check_nfs_stat(hostname):
- stat = DiagnosticStatus()
- stat.name = '%s NFS I/O' % hostname
- stat.level = 0
- stat.message = 'OK'
- stat.strings = []
- stat.values = []
+ return diag_strs, diag_vals, diag_msgs, diag_level
+## Checks clock speed from reading from CPU info
+def check_clock_speed(enforce_speed):
+ strs = []
+ vals = []
+ msgs = []
+ lvl = 0
+
try:
- p = subprocess.Popen('iostat -n',
+ p = subprocess.Popen('cat /proc/cpuinfo | grep MHz',
stdout = subprocess.PIPE,
stderr = subprocess.PIPE, shell = True)
stdout, stderr = p.communicate()
retcode = p.returncode
-
- for index, row in enumerate(stdout.split('\n')):
- if index < 3:
- continue
- lst = row.split()
- if len(lst) < 7:
+ if retcode != 0:
+ lvl = 2
+ msgs = [ 'Clock speed error' ]
+ strs = [ DiagnosticString(label = 'Clock speed error', value = stderr),
+ DiagnosticString(label = 'Output', value = stdout) ]
+
+ return (strs, vals, msgs, lvl)
+
+ for index, ln in enumerate(stdout.split('\n')):
+ words = ln.split(':')
+ if len(words) < 2:
continue
- file_sys = lst[0]
- read_blk = float(lst[1])
- write_blk = float(lst[2])
- read_blk_dir = float(lst[3])
- write_blk_dir = float(lst[4])
- r_blk_srv = float(lst[5])
- w_blk_srv = float(lst[6])
+ speed = words[1].strip().split('.')[0]
+ if unicode(speed).isnumeric():
+ mhz = float(speed)
+ vals.append(DiagnosticValue(label = 'Core %d Speed' % index, value = mhz))
+
+ if mhz < 2240 and mhz > 2150:
+ lvl = max(lvl, 1)
+ if mhz <= 2150:
+ lvl = max(lvl, 2)
- stat.values.append(DiagnosticValue(
- label = '%s Read Blks/s' % file_sys, value=read_blk))
- stat.values.append(DiagnosticValue(
- label = '%s Write Blks/s' % file_sys, value=write_blk))
- stat.values.append(DiagnosticValue(
- label = '%s Read Blk dir/s' % file_sys, value=read_blk_dir))
- stat.values.append(DiagnosticValue(
- label = '%s Write Blks dir/s' % file_sys, value=write_blk_dir))
- stat.values.append(DiagnosticValue(
- label = '%s Read Blks srv/s' % file_sys, value=r_blk_srv))
- stat.values.append(DiagnosticValue(
- label = '%s Write Blks srv/s' % file_sys, value=w_blk_srv))
-
+ else:
+ lvl = max(lvl, 2)
+ strs.append(DiagnosticString(label = 'Core %d Speed' % index, value = speed))
+
+ if not enforce_speed:
+ lvl = 0
+
+ if lvl == 1 and enforce_speed:
+ msgs = [ 'Core slowing' ]
+ elif lvl == 2 and enforce_speed:
+ msgs = [ 'Core throttled' ]
+
except Exception, e:
- traceback.print_exc()
- stat.level = 2
- stat.message = 'Exception'
- stat.strings.append(DiagnosticString(label = 'Exception', value = str(e)))
-
- return stat
+ rospy.logerr(traceback.format_exc())
+ lvl = 2
+ msgs.append('Exception')
+ strs.append(DiagnosticString(label = 'Exception', value = traceback.format_exc()))
+ return strs, vals, msgs, lvl
+
+
+# Add msgs output, too
def check_uptime():
level = 0
vals = []
- string = DiagnosticString(label = 'Load Average Status', value = 'Error')
+ str = DiagnosticString(label = 'Load Average Status', value = 'Error')
try:
p = subprocess.Popen('uptime', stdout = subprocess.PIPE,
@@ -182,15 +288,16 @@
if load1 > 35 or load5 > 25 or load15 > 20:
level = 2
- string = DiagnosticString(label = 'Load Average Status', value = stat_dict[level])
+ str = DiagnosticString(label = 'Load Average Status', value = stat_dict[level])
except Exception, e:
- rospy.logerr(traceback.print_exc())
+ rospy.logerr(traceback.format_exc())
level = 2
- DiagnosticString(label = 'Load Average Status', value = str(e))
+ str = DiagnosticString(label = 'Load Average Status', value = str(e))
- return level, vals, string
+ return level, vals, str
+# Add msgs output
def check_memory():
values = []
str = DiagnosticString(label = 'Memory Status', value = 'Exception')
@@ -227,13 +334,11 @@
return level, values, str
# Use mpstat
-def check_usage(hostname):
- stat = DiagnosticStatus()
- stat.name = '%s CPU Usage' % hostname
- stat.level = 0
- stat.strings = []
- stat.values = []
-
+def check_mpstat():
+ strs = []
+ vals = []
+ mp_level = 0
+
try:
p = subprocess.Popen('mpstat -P ALL 1 1',
stdout = subprocess.PIPE,
@@ -259,71 +364,338 @@
user = float(lst[3])
system = float(lst[5])
- stat.values.append(DiagnosticValue(label = 'CPU %s User' % cpu_name, value = user))
- stat.values.append(DiagnosticValue(label = 'CPU %s System' % cpu_name, value = system))
- stat.values.append(DiagnosticValue(label = 'CPU %s Idle' % cpu_name, value = idle))
+ vals.append(DiagnosticValue(label = 'CPU %s User' % cpu_name, value = user))
+ vals.append(DiagnosticValue(label = 'CPU %s System' % cpu_name, value = system))
+ vals.append(DiagnosticValue(label = 'CPU %s Idle' % cpu_name, value = idle))
- cpu_lvl = 0
if user > 75.0:
- cpu_lvl = 1
+ mp_level = 1
if user > 90.0:
- cpu_lvl = 2
- stat.level = max(stat.level, cpu_lvl)
+ mp_level = 2
- stat.strings.append(DiagnosticString(label = 'CPU %s Status' % cpu_name, value = stat_dict[cpu_lvl]))
+ strs.append(DiagnosticString(label = 'CPU %s Status' % cpu_name, value = stat_dict[mp_level]))
+
+ except Exception, e:
+ mp_level = 2
+ strs.append(DiagnosticString(label = 'mpstat Exception', value = str(e)))
+
+ return mp_level, vals, strs
+
+## Returns names for core temperature files
+## Returns list of names, each name can be read like file
+def get_core_temp_names():
+ temp_vals = []
+ try:
+ p = subprocess.Popen('find /sys -name temp1_input',
+ stdout = subprocess.PIPE,
+ stderr = subprocess.PIPE, shell = True)
+ stdout, stderr = p.communicate()
+ retcode = p.returncode
+
+ if retcode != 0:
+ rospy.logerr('Error find core temp locations: %s' % stderr)
+ return []
+
+ for ln in stdout.split('\n'):
+ temp_vals.append(ln.strip())
+
+ return temp_vals
+ except:
+ rospy.logerr('Exception finding temp vals: %s' % traceback.format_exc())
+ return []
+
+def update_status_stale(stat, last_update_time):
+ time_since_update = rospy.get_time() - last_update_time
+
+ level = stat.level
+ stale_status = 'OK'
+ if time_since_update > 20:
+ stale_status = 'Lagging'
+ level = max(level, 1)
+ if time_since_update > 35:
+ stale_status = 'Stale'
+ level = max(level, 2)
+
+ stat.strings.pop(0)
+ stat.values.pop(0)
+ stat.strings.insert(0, DiagnosticString(label = 'Update Status', value = stale_status))
+ stat.values.insert(0, DiagnosticValue(label = 'Time Since Update', value = time_since_update))
+
+class CPUMonitor():
+ def __init__(self, hostname):
+ rospy.init_node('cpu_monitor_%s' % hostname)
+
+ self._diag_pub = rospy.Publisher('/diagnostics', DiagnosticMessage)
+
+ self._mutex = threading.Lock()
+
+ self._check_ipmi = rospy.get_param('check_ipmi_tool', True)
+ self._enforce_speed = rospy.get_param('enforce_clock_speed', True)
+
+ # Get temp_input files
+ self._temp_vals = get_core_temp_names()
+
+ # CPU stats
+ self._temp_stat = DiagnosticStatus()
+ self._temp_stat.name = '%s CPU Temperature' % hostname
+ self._temp_stat.level = 2
+ self._temp_stat.message = 'No Data'
+ self._temp_stat.strings = [ DiagnosticString(label = 'Update Status', value = 'No Data' )]
+ self._temp_stat.values = [ DiagnosticValue(label = 'Time Since Last Update', value = 100000 )]
+
+ self._usage_stat = DiagnosticStatus()
+ self._usage_stat.name = '%s CPU Usage' % hostname
+ self._usage_stat.level = 2
+ self._usage_stat.message = 'No Data'
+ self._usage_stat.strings = [ DiagnosticString(label = 'Update Status', value = 'No Data' )]
+ self._usage_stat.values = [ DiagnosticValue(label = 'Time Since Last Update', value = 100000 )]
+
+ self._nfs_stat = DiagnosticStatus()
+ self._nfs_stat.name = '%s NFS I/O' % hostname
+ self._nfs_stat.level = 2
+ self._nfs_stat.message = 'No Data'
+ self._nfs_stat.strings = [ DiagnosticString(label = 'Update Status', value = 'No Data' )]
+ self._nfs_stat.values = [ DiagnosticValue(label = 'Time Since Last Update', value = 100000 )]
+
+ self._last_temp_time = 0
+ self._last_usage_time = 0
+ self._last_nfs_time = 0
+ self._last_publish_time = 0
+
+ self._temps_timer = None
+ self._usage_timer = None
+ self._nfs_timer = None
+ self._publish_timer = None
+ ##@TODO Need wireless stuff, at some point, put NFS in usage status
+
+ # Start checking everything
+ self.check_temps()
+ self.check_nfs_stat()
+ self.check_usage()
+
+ self._publish_timer = threading.Timer(1.0, self.publish_stats)
+ self._publish_timer.start()
+
+ ## Must have the lock to cancel everything
+ def cancel_timers(self):
+ if self._temps_timer:
+ self._temps_timer.cancel()
+
+ if self._nfs_timer:
+ self._nfs_timer.cancel()
+
+ if self._usage_timer:
+ self._usage_timer.cancel()
+
+ if self._publish_timer:
+ self._publish_timer.cancel()
+
+ def check_nfs_stat(self):
+ if rospy.is_shutdown():
+ self._mutex.acquire()
+ self.cancel_timers()
+ self._mutex.release()
+ return
+
+ nfs_level = 0
+ msg = 'OK'
+ strs = [ DiagnosticString(label = 'Update Status', value = 'OK' )]
+ vals = [ DiagnosticValue(label = 'Time Since Last Update', value = 0 )]
+
+ try:
+ p = subprocess.Popen('iostat -n',
+ stdout = subprocess.PIPE,
+ stderr = subprocess.PIPE, shell = True)
+ stdout, stderr = p.communicate()
+ retcode = p.returncode
+ for index, row in enumerate(stdout.split('\n')):
+ if index < 3:
+ continue
+
+ lst = row.split()
+ if len(lst) < 7:
+ continue
+
+ file_sys = lst[0]
+ read_blk = float(lst[1])
+ write_blk = float(lst[2])
+ read_blk_dir = float(lst[3])
+ write_blk_dir = float(lst[4])
+ r_blk_srv = float(lst[5])
+ w_blk_srv = float(lst[6])
+
+ vals.append(DiagnosticValue(
+ label = '%s Read Blks/s' % file_sys, value=read_blk))
+ vals.append(DiagnosticValue(
+ label = '%s Write Blks/s' % file_sys, value=write_blk))
+ vals.append(DiagnosticValue(
+ label = '%s Read Blk dir/s' % file_sys, value=read_blk_dir))
+ vals.append(DiagnosticValue(
+ label = '%s Write Blks dir/s' % file_sys, value=write_blk_dir))
+ vals.append(DiagnosticValue(
+ label = '%s Read Blks srv/s' % file_sys, value=r_blk_srv))
+ vals.append(DiagnosticValue(
+ label = '%s Write Blks srv/s' % file_sys, value=w_blk_srv))
+
+ except Exception, e:
+ rospy.logerr(traceback.format_exc())
+ nfs_level = 2
+ msg = 'Exception'
+ strings.append(DiagnosticString(label = 'Exception', value = str(e)))
+
+ self._mutex.acquire()
+
+ self._nfs_stat.level = nfs_level
+ self._nfs_stat.message = msg
+ self._nfs_stat.strings = strs
+ self._nfs_stat.values = vals
+
+ self._last_nfs_time = rospy.get_time()
+
+ if not rospy.is_shutdown():
+ self._nfs_timer = threading.Timer(5.0, self.check_nfs_stat)
+ self._nfs_timer.start()
+ else:
+ self.cancel_timers()
+
+ self._mutex.release()
+
+ ## Call every 10sec at minimum
+ def check_temps(self):
+ if rospy.is_shutdown():
+ self._mutex.acquire()
+ self.cancel_timers()
+ self._mutex.release()
+ return
+
+ diag_strs = [ DiagnosticString(label = 'Update Status', value = 'OK' ) ]
+ diag_vals = [ DiagnosticValue(label = 'Time Since Last Update', value = 0 ) ]
+ diag_msgs = []
+ diag_level = 0
+
+ if self._check_ipmi:
+ ipmi_strs, ipmi_vals, ipmi_msgs, ipmi_level = check_ipmi()
+ diag_strs.extend(ipmi_strs)
+ diag_vals.extend(ipmi_vals)
+ diag_msgs.extend(ipmi_msgs)
+ diag_level = max(diag_level, ipmi_level)
+
+ core_strs, core_vals, core_msgs, core_level = check_core_temps(self._temp_vals)
+ diag_strs.extend(core_strs)
+ diag_vals.extend(core_vals)
+ diag_msgs.extend(core_msgs)
+ diag_level = max(diag_level, core_level)
+
+ clock_strs, clock_vals, clock_msgs, clock_level = check_clock_speed(self._enforce_speed)
+ diag_strs.extend(clock_strs)
+ diag_vals.extend(clock_vals)
+ diag_msgs.extend(clock_msgs)
+ diag_level = max(diag_level, clock_level)
+
+ diag_log = set(diag_msgs)
+ if len(diag_log) > 0:
+ message = string.join(diag_log, ', ')
+ else:
+ message = stat_dict[diag_level]
+
+ self._mutex.acquire()
+ self._last_temp_time = rospy.get_time()
+
+ self._temp_stat.level = diag_level
+ self._temp_stat.message = message
+ self._temp_stat.strings = diag_strs
+ self._temp_stat.values = diag_vals
+
+ if not rospy.is_shutdown():
+ self._temp_timer = threading.Timer(5.0, self.check_temps)
+ self._temp_timer.start()
+ else:
+ self.cancel_timers()
+
+ self._mutex.release()
+
+ def check_usage(self):
+ if rospy.is_shutdown():
+ self._mutex.acquire()
+ self.cancel_timers()
+ self._mutex.release()
+ return
+
+ diag_level = 0
+ diag_strs = [ DiagnosticString(label = 'Update Status', value = 'OK' ) ]
+ diag_vals = [ DiagnosticValue(label = 'Time Since Last Update', value = 0 )]
+
+ # Check mpstat
+ mp_level, mp_vals, mp_strs = check_mpstat()
+ diag_vals.extend(mp_vals)
+ diag_strs.extend(mp_strs)
+ diag_level = max(diag_level, mp_level)
+
# Check uptime
uptime_level, up_vals, up_str = check_uptime()
- stat.values.extend(up_vals)
- stat.strings.append(up_str)
- stat.level = max(stat.level, uptime_level)
-
+ diag_vals.extend(up_vals)
+ diag_strs.append(up_str)
+ diag_level = max(diag_level, uptime_level)
+
# Check memory
mem_level, mem_vals, mem_str = check_memory()
- stat.values.extend(mem_vals)
- stat.strings.append(mem_str)
- stat.level = max(stat.level, mem_level)
+ diag_vals.extend(mem_vals)
+ diag_strs.append(mem_str)
+ diag_level = max(diag_level, mem_level)
+
+
+ # Update status
+ self._mutex.acquire()
+ self._last_usage_time = rospy.get_time()
+ self._usage_stat.level = diag_level
+ self._usage_stat.values = diag_vals
+ self._usage_stat.strings = diag_strs
- stat.message = stat_dict[stat.level]
+ self._usage_stat.message = stat_dict[diag_level]
- except Exception, e:
- stat.level = 2
- stat.message = 'Exception'
- stat.strings.append(DiagnosticString(label = 'mpstat Exception', value = str(e)))
+ if not rospy.is_shutdown():
+ self._usage_timer = threading.Timer(5.0, self.check_usage)
+ self._usage_timer.start()
+ else:
+ self.cancel_timers()
- return stat
+ self._mutex.release()
-def main():
- hds = []
+ def publish_stats(self):
+ self._mutex.acquire()
+
+ # Update everything with last update times
+ update_status_stale(self._temp_stat, self._last_temp_time)
+ update_status_stale(self._usage_stat, self._last_usage_time)
+ update_status_stale(self._nfs_stat, self._last_nfs_time)
+ msg = DiagnosticMessage()
+ msg.status.append(self._temp_stat)
+ msg.status.append(self._usage_stat)
+ msg.status.append(self._nfs_stat)
+
+ if rospy.get_time() - self._last_publish_time > 0.5:
+ self._diag_pub.publish(msg)
+ self._last_publish_time = rospy.get_time()
+
+ if not rospy.is_shutdown():
+ self._publish_timer = threading.Timer(1.0, self.publish_stats)
+ self._publish_timer.start()
+ else:
+ self.cancel_timers()
+
+ self._mutex.release()
+
+if __name__ == '__main__':
hostname = socket.gethostname()
-
- rospy.init_node('cpu_monitor_%s' % hostname, anonymous = True)
-
- pub = rospy.Publisher('/diagnostics', DiagnosticMessage)
- no_cpu_temp = rospy.get_param('no_cpu_temp', False)
+ cpu_node = CPUMonitor(hostname)
- while not rospy.is_shutdown():
- msg = DiagnosticMessage()
- msg.status = []
-
- # Temperature, don't check if user says not to
- if not no_cpu_temp:
- msg.status.append(check_cpu_temp(hostname))
-
- # Usage, memory, and load average
- msg.status.append(check_usage(hostname))
- # NFS status
- msg.status.append(check_nfs_stat(hostname))
-
- pub.publish(msg)
- time.sleep(1.0)
+
+
-if __name__ == '__main__':
- main()
-
Deleted: pkg/trunk/pr2/pr2_computer_monitor/scripts/disk_usage.py
===================================================================
--- pkg/trunk/pr2/pr2_computer_monitor/scripts/disk_usage.py 2009-07-21 06:36:25 UTC (rev 19292)
+++ pkg/trunk/pr2/pr2_computer_monitor/scripts/disk_usage.py 2009-07-21 06:44:50 UTC (rev 19293)
@@ -1,106 +0,0 @@
-#!/usr/bin/env python
-# Software License Agreement (BSD License)
-#
-# Copyright (c) 2008, Willow Garage, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# ...
[truncated message content] |
|
From: <is...@us...> - 2009-07-22 03:52:32
|
Revision: 19376
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19376&view=rev
Author: isucan
Date: 2009-07-22 03:52:27 +0000 (Wed, 22 Jul 2009)
Log Message:
-----------
adding things to 3dnav_pr2 package
Modified Paths:
--------------
pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/larm.launch
pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/laser+stereo-perception.launch
pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/laser-perception.launch
pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/rarm.launch
pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/stereo-perception.launch
pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/manifest.xml
pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/src/simple.cpp
pkg/trunk/sandbox/3dnav_pr2/params/collision/collision_checks_both_arms.yaml
pkg/trunk/sandbox/3dnav_pr2/params/collision/collision_checks_left_arm.yaml
pkg/trunk/sandbox/3dnav_pr2/params/collision/collision_checks_right_arm.yaml
pkg/trunk/sandbox/3dnav_pr2/params/planning/planning.yaml
Added Paths:
-----------
pkg/trunk/sandbox/3dnav_pr2/launch/pr2_planning_environment.launch
pkg/trunk/sandbox/3dnav_pr2/params/
pkg/trunk/sandbox/3dnav_pr2/params/collision/
pkg/trunk/sandbox/3dnav_pr2/params/planning/
Removed Paths:
-------------
pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/old/
pkg/trunk/stacks/pr2/pr2_defs/collision/
pkg/trunk/stacks/pr2/pr2_defs/planning/
pkg/trunk/stacks/pr2/pr2_defs/pr2_planning_environment.launch
Modified: pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/larm.launch
===================================================================
--- pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/larm.launch 2009-07-22 03:32:28 UTC (rev 19375)
+++ pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/larm.launch 2009-07-22 03:52:27 UTC (rev 19376)
@@ -1,5 +1,5 @@
<launch>
- <include file="$(find pr2_defs)/pr2_planning_environment.launch" />
+ <include file="$(find 3dnav_pr2)/launch/pr2_planning_environment.launch" />
<include file="$(find pr2_ik)/pr2_ik_larm_node.launch"/>
<include file="$(find move_arm)/launch/move_larm.launch"/>
<node pkg="mechanism_control" type="spawner.py" args="$(find pr2_default_controllers)/l_arm_joint_trajectory_controller.xml" />
Modified: pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/laser+stereo-perception.launch
===================================================================
--- pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/laser+stereo-perception.launch 2009-07-22 03:32:28 UTC (rev 19375)
+++ pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/laser+stereo-perception.launch 2009-07-22 03:52:27 UTC (rev 19376)
@@ -1,7 +1,7 @@
<launch>
<!-- send additional description parameters -->
- <include file="$(find pr2_defs)/pr2_planning_environment.launch" />
+ <include file="$(find 3dnav_pr2)/launch/pr2_planning_environment.launch" />
<!-- start controller -->
<node pkg="mechanism_control" type="spawner.py" args="$(find pr2_default_controllers)/laser_tilt_controller.xml" />
Modified: pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/laser-perception.launch
===================================================================
--- pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/laser-perception.launch 2009-07-22 03:32:28 UTC (rev 19375)
+++ pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/laser-perception.launch 2009-07-22 03:52:27 UTC (rev 19376)
@@ -1,7 +1,7 @@
<launch>
<!-- send additional description parameters -->
- <include file="$(find pr2_defs)/pr2_planning_environment.launch" />
+ <include file="$(find 3dnav_pr2)/launch/pr2_planning_environment.launch" />
<!-- start controller -->
<node pkg="mechanism_control" type="spawner.py" args="$(find pr2_default_controllers)/laser_tilt_controller.xml" />
Modified: pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/rarm.launch
===================================================================
--- pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/rarm.launch 2009-07-22 03:32:28 UTC (rev 19375)
+++ pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/rarm.launch 2009-07-22 03:52:27 UTC (rev 19376)
@@ -1,5 +1,6 @@
<launch>
- <include file="$(find pr2_defs)/pr2_planning_environment.launch" />
+
+ <include file="$(find 3dnav_pr2)/launch/pr2_planning_environment.launch" />
<include file="$(find pr2_ik)/pr2_ik_rarm_node.launch"/>
<include file="$(find move_arm)/launch/move_rarm.launch"/>
Modified: pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/stereo-perception.launch
===================================================================
--- pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/stereo-perception.launch 2009-07-22 03:32:28 UTC (rev 19375)
+++ pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/stereo-perception.launch 2009-07-22 03:52:27 UTC (rev 19376)
@@ -1,6 +1,6 @@
<launch>
- <include file="$(find pr2_defs)/pr2_planning_environment.launch" />
+ <include file="$(find 3dnav_pr2)/launch/pr2_planning_environment.launch" />
<include file="$(find stereo_image_proc)/narrow_stereoproc.launch" />
<!-- remove points corresponding to known objects -->
Modified: pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/manifest.xml
===================================================================
--- pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/manifest.xml 2009-07-22 03:32:28 UTC (rev 19375)
+++ pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/manifest.xml 2009-07-22 03:52:27 UTC (rev 19376)
@@ -5,31 +5,12 @@
<review status="na" notes=""/>
<url>http://pr.willowgarage.com/wiki</url>
- <depend package="laser_scan"/>
- <depend package="robot_self_filter"/>
- <depend package="point_cloud_assembler"/>
- <depend package="table_object_detector"/>
- <depend package="collision_map"/>
- <depend package="ompl_planning"/>
+ <depend package="3dnav_pr2"/>
- <depend package="pr2_msgs"/>
- <depend package="robot_msgs"/>
- <depend package="visualization_msgs" />
- <depend package="manipulation_msgs" />
- <depend package="motion_planning_msgs" />
- <depend package="motion_planning_srvs" />
- <depend package="tabletop_msgs" />
- <depend package="tabletop_srvs" />
- <depend package="recognition_lambertian" />
-
-<!-- <depend package="move_base" /> -->
-
- <depend package="move_arm" />
- <depend package="pr2_ik" />
-
<!--
<depend package="2dnav_pr2"/>
<depend package="pr2_gazebo"/>
<depend package="rviz"/>
-->
+
</package>
Modified: pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/src/simple.cpp
===================================================================
--- pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/src/simple.cpp 2009-07-22 03:32:28 UTC (rev 19375)
+++ pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/src/simple.cpp 2009-07-22 03:52:27 UTC (rev 19376)
@@ -138,7 +138,7 @@
recognition_lambertian::FindObjectPoses::Response res;
ros::Publisher vmPub = nh.advertise<visualization_msgs::Marker>("visualization_marker", 10240);
- robot_actions::ActionClient<pr2_robot_actions::MoveArmGoal, pr2_robot_actions::MoveArmState, int32_t> move_arm("move_arm");
+ robot_actions::ActionClient<pr2_robot_actions::MoveArmGoal, pr2_robot_actions::MoveArmState, int32_t> move_arm("move_right_arm");
ros::ServiceClient client = nh.serviceClient<recognition_lambertian::FindObjectPoses>("table_top/find_object_poses");
if (client.call(req, res))
@@ -147,8 +147,11 @@
if (res.objects.size() > 0)
{
recognition_lambertian::TableTopObject obj = res.objects[0];
- ROS_INFO("point to grasp: %f %f %f", obj.object_pose.pose.position.x, obj.object_pose.pose.position.y, obj.object_pose.pose.position.z);
+ obj.grasp_pose.pose.position.x -= 0.16;
+ ROS_INFO("pose of object: %f %f %f", obj.object_pose.pose.position.x, obj.object_pose.pose.position.y, obj.object_pose.pose.position.z);
+ ROS_INFO("point to grasp: %f %f %f", obj.grasp_pose.pose.position.x, obj.grasp_pose.pose.position.y, obj.grasp_pose.pose.position.z);
+
mapping_msgs::ObjectInMap o1;
o1.header = obj.object_pose.header;
o1.id = "Part1";
@@ -189,8 +192,8 @@
sendPoint(vmPub, obj.grasp_pose.header, obj.grasp_pose.pose.position.x, obj.grasp_pose.pose.position.y, obj.grasp_pose.pose.position.z);
- if (move_arm.execute(goal, feedback, ros::Duration(60.0)) != robot_actions::SUCCESS)
- ROS_ERROR("failed achieving goal");
+ // if (move_arm.execute(goal, feedback, ros::Duration(60.0)) != robot_actions::SUCCESS)
+ // ROS_ERROR("failed achieving goal");
}
}
else
Copied: pkg/trunk/sandbox/3dnav_pr2/launch/pr2_planning_environment.launch (from rev 19374, pkg/trunk/stacks/pr2/pr2_defs/pr2_planning_environment.launch)
===================================================================
--- pkg/trunk/sandbox/3dnav_pr2/launch/pr2_planning_environment.launch (rev 0)
+++ pkg/trunk/sandbox/3dnav_pr2/launch/pr2_planning_environment.launch 2009-07-22 03:52:27 UTC (rev 19376)
@@ -0,0 +1,9 @@
+
+<launch>
+ <!-- send parameters for collision checking for PR2; this includes parameters for the self filter -->
+ <rosparam command="load" ns="robotdesc/pr2_collision" file="$(find 3dnav_pr2)/params/collision/collision_checks_both_arms.yaml" />
+
+ <!-- send parameters needed for motion planning -->
+ <rosparam command="load" ns="robotdesc/pr2_planning" file="$(find 3dnav_pr2)/params/planning/planning.yaml" />
+
+</launch>
Property changes on: pkg/trunk/sandbox/3dnav_pr2/launch/pr2_planning_environment.launch
___________________________________________________________________
Added: svn:mergeinfo
+ /pkg/branches/gazebo-branch-merge/robot_descriptions/pr2/pr2_defs/pr2_planning_environment.launch:15683-15684,15739-15794,15797-15820,15822-15839,15852-15870,15983-16008,16010-16016,16129-16141,16145-16169,16245-16262,16274-16334
Property changes on: pkg/trunk/sandbox/3dnav_pr2/params/collision
___________________________________________________________________
Added: svn:mergeinfo
+ /pkg/branches/gazebo-branch-merge/robot_descriptions/pr2/pr2_defs/collision:15683-15684,15739-15794,15797-15820,15822-15839,15852-15870,15983-16008,16010-16016,16129-16141,16145-16169,16245-16262,16274-16334
Modified: pkg/trunk/sandbox/3dnav_pr2/params/collision/collision_checks_both_arms.yaml
===================================================================
--- pkg/trunk/stacks/pr2/pr2_defs/collision/collision_checks_both_arms.yaml 2009-07-22 03:12:32 UTC (rev 19374)
+++ pkg/trunk/sandbox/3dnav_pr2/params/collision/collision_checks_both_arms.yaml 2009-07-22 03:52:27 UTC (rev 19376)
@@ -91,13 +91,13 @@
## The padding to be added for the body parts the robot can see
-self_see_padd: 0.1
+self_see_padd: 0.05
## The scaling to be considered for the body parts the robot can see
self_see_scale: 1.0
## The padding for the robot body parts to be considered when collision checking with the environment
-robot_padd: 0.002
+robot_padd: 0.003
## The scaling for the robot body parts to be considered when collision checking with the environment
robot_scale: 1.0
Modified: pkg/trunk/sandbox/3dnav_pr2/params/collision/collision_checks_left_arm.yaml
===================================================================
--- pkg/trunk/stacks/pr2/pr2_defs/collision/collision_checks_left_arm.yaml 2009-07-22 03:12:32 UTC (rev 19374)
+++ pkg/trunk/sandbox/3dnav_pr2/params/collision/collision_checks_left_arm.yaml 2009-07-22 03:52:27 UTC (rev 19376)
@@ -54,14 +54,14 @@
## The padding to be added for the body parts the robot can see
-self_see_padd: 0.1
+self_see_padd: 0.05
## The scaling to be considered for the body parts the robot can see
self_see_scale: 1.0
## The padding for the robot body parts to be considered when collision checking with the environment
-robot_padd: 0.005
+robot_padd: 0.003
## The scaling for the robot body parts to be considered when collision checking with the environment
-robot_scale: 1.1
+robot_scale: 1.0
Modified: pkg/trunk/sandbox/3dnav_pr2/params/collision/collision_checks_right_arm.yaml
===================================================================
--- pkg/trunk/stacks/pr2/pr2_defs/collision/collision_checks_right_arm.yaml 2009-07-22 03:12:32 UTC (rev 19374)
+++ pkg/trunk/sandbox/3dnav_pr2/params/collision/collision_checks_right_arm.yaml 2009-07-22 03:52:27 UTC (rev 19376)
@@ -54,14 +54,14 @@
## The padding to be added for the body parts the robot can see
-self_see_padd: 0.1
+self_see_padd: 0.05
## The scaling to be considered for the body parts the robot can see
self_see_scale: 1.0
## The padding for the robot body parts to be considered when collision checking with the environment
-robot_padd: 0.005
+robot_padd: 0.003
## The scaling for the robot body parts to be considered when collision checking with the environment
-robot_scale: 1.1
+robot_scale: 1.0
Property changes on: pkg/trunk/sandbox/3dnav_pr2/params/planning
___________________________________________________________________
Added: svn:mergeinfo
+ /pkg/branches/gazebo-branch-merge/robot_descriptions/pr2/pr2_defs/planning:15683-15684,15739-15794,15797-15820,15822-15839,15852-15870,15983-16008,16010-16016,16129-16141,16145-16169,16245-16262,16274-16334
Modified: pkg/trunk/sandbox/3dnav_pr2/params/planning/planning.yaml
===================================================================
--- pkg/trunk/stacks/pr2/pr2_defs/planning/planning.yaml 2009-07-22 03:12:32 UTC (rev 19374)
+++ pkg/trunk/sandbox/3dnav_pr2/params/planning/planning.yaml 2009-07-22 03:52:27 UTC (rev 19376)
@@ -42,7 +42,7 @@
r_wrist_flex_link
r_wrist_roll_link
planner_configs:
- RRTkConfig2 SBLkConfig2 KPIECEkConfig1 KPIECEkConfig2r LBKPIECEkConfig2r
+ RRTkConfig2 SBLkConfig2 KPIECEkConfig1 KPIECEkConfig2l LBKPIECEkConfig2l
arms:
links:
@@ -73,6 +73,11 @@
planner_configs:
+ pRRTConfig1:
+ type: kinematic::pRRT
+ range: 0.75
+ thread_count: 2
+
RRTkConfig1:
type: kinematic::RRT
range: 0.75
Deleted: pkg/trunk/stacks/pr2/pr2_defs/pr2_planning_environment.launch
===================================================================
--- pkg/trunk/stacks/pr2/pr2_defs/pr2_planning_environment.launch 2009-07-22 03:32:28 UTC (rev 19375)
+++ pkg/trunk/stacks/pr2/pr2_defs/pr2_planning_environment.launch 2009-07-22 03:52:27 UTC (rev 19376)
@@ -1,8 +0,0 @@
-
-<launch>
- <!-- send parameters for collision checking for PR2; this includes parameters for the self filter -->
- <rosparam command="load" ns="robotdesc/pr2_collision" file="$(find pr2_defs)/collision/collision_checks_both_arms.yaml" />
-
- <!-- send parameters needed for motion planning -->
- <rosparam command="load" ns="robotdesc/pr2_planning" file="$(find pr2_defs)/planning/planning.yaml" />
-</launch>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <is...@us...> - 2009-07-22 04:02:08
|
Revision: 19378
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19378&view=rev
Author: isucan
Date: 2009-07-22 04:02:06 +0000 (Wed, 22 Jul 2009)
Log Message:
-----------
removing unsafe attribute from planning response
Modified Paths:
--------------
pkg/trunk/highlevel/move_arm/src/move_arm_action.cpp
pkg/trunk/motion_planning/motion_planning_srvs/srv/MotionPlan.srv
pkg/trunk/motion_planning/ompl_planning/src/motion_planner.cpp
Modified: pkg/trunk/highlevel/move_arm/src/move_arm_action.cpp
===================================================================
--- pkg/trunk/highlevel/move_arm/src/move_arm_action.cpp 2009-07-22 03:57:26 UTC (rev 19377)
+++ pkg/trunk/highlevel/move_arm/src/move_arm_action.cpp 2009-07-22 04:02:06 UTC (rev 19378)
@@ -190,31 +190,26 @@
}
else
{
- if (res.unsafe)
- ROS_WARN("Received path is unsafe (planning data was out of date). Ignoring");
+ if (res.path.model_id != req.params.model_id)
+ ROS_ERROR("Received path for incorrect model: expected '%s', received '%s'", req.params.model_id.c_str(), res.path.model_id.c_str());
else
{
- if (res.path.model_id != req.params.model_id)
- ROS_ERROR("Received path for incorrect model: expected '%s', received '%s'", req.params.model_id.c_str(), res.path.model_id.c_str());
+ if (!planningMonitor_->getTransformListener()->frameExists(res.path.header.frame_id))
+ ROS_ERROR("Received path in unknown frame: '%s'", res.path.header.frame_id.c_str());
else
{
- if (!planningMonitor_->getTransformListener()->frameExists(res.path.header.frame_id))
- ROS_ERROR("Received path in unknown frame: '%s'", res.path.header.frame_id.c_str());
- else
+ approx = res.approximate;
+ if (res.approximate)
+ ROS_INFO("Approximate path was found. Distance to goal is: %f", res.distance);
+ ROS_INFO("Received path with %u states from motion planner", (unsigned int)res.path.states.size());
+ currentPath = res.path;
+ currentPos = 0;
+ if (planningMonitor_->transformPathToFrame(currentPath, planningMonitor_->getFrameId()))
{
- approx = res.approximate;
- if (res.approximate)
- ROS_INFO("Approximate path was found. Distance to goal is: %f", res.distance);
- ROS_INFO("Received path with %u states from motion planner", (unsigned int)res.path.states.size());
- currentPath = res.path;
- currentPos = 0;
- if (planningMonitor_->transformPathToFrame(currentPath, planningMonitor_->getFrameId()))
- {
- displayPathPublisher_.publish(currentPath);
- printPath(currentPath);
- feedback = pr2_robot_actions::MoveArmState::MOVING;
- update(feedback);
- }
+ displayPathPublisher_.publish(currentPath);
+ printPath(currentPath);
+ feedback = pr2_robot_actions::MoveArmState::MOVING;
+ update(feedback);
}
}
}
Modified: pkg/trunk/motion_planning/motion_planning_srvs/srv/MotionPlan.srv
===================================================================
--- pkg/trunk/motion_planning/motion_planning_srvs/srv/MotionPlan.srv 2009-07-22 03:57:26 UTC (rev 19377)
+++ pkg/trunk/motion_planning/motion_planning_srvs/srv/MotionPlan.srv 2009-07-22 04:02:06 UTC (rev 19378)
@@ -34,6 +34,3 @@
# set to 1 if the computed path was approximate
byte approximate
-
-# if state information was not up to date when planning, this is set to 1
-byte unsafe
Modified: pkg/trunk/motion_planning/ompl_planning/src/motion_planner.cpp
===================================================================
--- pkg/trunk/motion_planning/ompl_planning/src/motion_planner.cpp 2009-07-22 03:57:26 UTC (rev 19377)
+++ pkg/trunk/motion_planning/ompl_planning/src/motion_planner.cpp 2009-07-22 04:02:06 UTC (rev 19378)
@@ -143,7 +143,6 @@
res.path.model_id = req.params.model_id;
res.path.header.frame_id = planningMonitor_->getFrameId();
res.path.header.stamp = planningMonitor_->lastMapUpdate();
- res.unsafe = planningMonitor_->isEnvironmentSafe() ? 0 : 1;
res.distance = -1.0;
res.approximate = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <is...@us...> - 2009-07-22 04:42:22
|
Revision: 19381
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19381&view=rev
Author: isucan
Date: 2009-07-22 04:42:20 +0000 (Wed, 22 Jul 2009)
Log Message:
-----------
simplifying pose constraint message
Modified Paths:
--------------
pkg/trunk/highlevel/move_arm/src/arm_cmd_line.cpp
pkg/trunk/highlevel/move_arm/src/move_arm_action.cpp
pkg/trunk/highlevel/move_arm/test/oscillate_move.cpp
pkg/trunk/motion_planning/motion_planning_msgs/msg/PoseConstraint.msg
pkg/trunk/motion_planning/planning_environment/src/util/kinematic_state_constraint_evaluator.cpp
Modified: pkg/trunk/highlevel/move_arm/src/arm_cmd_line.cpp
===================================================================
--- pkg/trunk/highlevel/move_arm/src/arm_cmd_line.cpp 2009-07-22 04:41:39 UTC (rev 19380)
+++ pkg/trunk/highlevel/move_arm/src/arm_cmd_line.cpp 2009-07-22 04:42:20 UTC (rev 19381)
@@ -149,7 +149,8 @@
void setupGoalEEf(const std::string &link, double x, double y, double z, pr2_robot_actions::MoveArmGoal &goal)
{
goal.goal_constraints.pose_constraint.resize(1);
- goal.goal_constraints.pose_constraint[0].type = motion_planning_msgs::PoseConstraint::POSITION_XYZ + motion_planning_msgs::PoseConstraint::ORIENTATION_RPY;
+ goal.goal_constraints.pose_constraint[0].type = motion_planning_msgs::PoseConstraint::POSITION_X + motion_planning_msgs::PoseConstraint::POSITION_Y + motion_planning_msgs::PoseConstraint::POSITION_Z +
+ + motion_planning_msgs::PoseConstraint::ORIENTATION_R + motion_planning_msgs::PoseConstraint::ORIENTATION_P + motion_planning_msgs::PoseConstraint::ORIENTATION_Y;
goal.goal_constraints.pose_constraint[0].link_name = link;
goal.goal_constraints.pose_constraint[0].pose.header.stamp = ros::Time::now();
goal.goal_constraints.pose_constraint[0].pose.header.frame_id = "/base_link";
Modified: pkg/trunk/highlevel/move_arm/src/move_arm_action.cpp
===================================================================
--- pkg/trunk/highlevel/move_arm/src/move_arm_action.cpp 2009-07-22 04:41:39 UTC (rev 19380)
+++ pkg/trunk/highlevel/move_arm/src/move_arm_action.cpp 2009-07-22 04:42:20 UTC (rev 19381)
@@ -544,8 +544,9 @@
// change pose constraints to joint constraints, if possible and so desired
if (req.goal_constraints.joint_constraint.empty() && // we have no joint constraints on the goal,
req.goal_constraints.pose_constraint.size() == 1 && // we have a single pose constraint on the goal
- req.goal_constraints.pose_constraint[0].type == motion_planning_msgs::PoseConstraint::POSITION_XYZ +
- motion_planning_msgs::PoseConstraint::ORIENTATION_RPY) // that is active on all 6 DOFs
+ req.goal_constraints.pose_constraint[0].type ==
+ motion_planning_msgs::PoseConstraint::POSITION_X + motion_planning_msgs::PoseConstraint::POSITION_Y + motion_planning_msgs::PoseConstraint::POSITION_Z +
+ motion_planning_msgs::PoseConstraint::ORIENTATION_R + motion_planning_msgs::PoseConstraint::ORIENTATION_P + motion_planning_msgs::PoseConstraint::ORIENTATION_Y) // that is active on all 6 DOFs
{
planning_models::KinematicModel::Link *link = planningMonitor_->getKinematicModel()->getLink(req.goal_constraints.pose_constraint[0].link_name);
if (link && link->before && link->before->name == arm_joint_names_.back())
Modified: pkg/trunk/highlevel/move_arm/test/oscillate_move.cpp
===================================================================
--- pkg/trunk/highlevel/move_arm/test/oscillate_move.cpp 2009-07-22 04:41:39 UTC (rev 19380)
+++ pkg/trunk/highlevel/move_arm/test/oscillate_move.cpp 2009-07-22 04:42:20 UTC (rev 19381)
@@ -86,8 +86,8 @@
goalA.goal_constraints.pose_constraint[0].orientation_importance = 0.1;
goalA.goal_constraints.pose_constraint[0].type =
- motion_planning_msgs::PoseConstraint::POSITION_XYZ +
- motion_planning_msgs::PoseConstraint::ORIENTATION_RPY;
+ motion_planning_msgs::PoseConstraint::POSITION_X + motion_planning_msgs::PoseConstraint::POSITION_Y + motion_planning_msgs::PoseConstraint::POSITION_Z +
+ motion_planning_msgs::PoseConstraint::ORIENTATION_R + motion_planning_msgs::PoseConstraint::ORIENTATION_P + motion_planning_msgs::PoseConstraint::ORIENTATION_Y;
std::vector<std::string> names(7);
Modified: pkg/trunk/motion_planning/motion_planning_msgs/msg/PoseConstraint.msg
===================================================================
--- pkg/trunk/motion_planning/motion_planning_msgs/msg/PoseConstraint.msg 2009-07-22 04:41:39 UTC (rev 19380)
+++ pkg/trunk/motion_planning/motion_planning_msgs/msg/PoseConstraint.msg 2009-07-22 04:42:20 UTC (rev 19381)
@@ -5,24 +5,16 @@
# Constants that represent possible values for type. A position and an
# orientation constant can be combined (by adding).
-int32 POSITION_XYZ=1 # only x,y,z of position is considered
-int32 POSITION_XY=2 # only x,y of position is considered
-int32 POSITION_XZ=3 # only x,z of position is considered
-int32 POSITION_YZ=4 # only y,z of position is considered
-int32 POSITION_X=5 # only x of position is considered
-int32 POSITION_Y=6 # only y of position is considered
-int32 POSITION_Z=7 # only z of position is considered
+int32 POSITION_X=1 # only x of position is considered
+int32 POSITION_Y=2 # only y of position is considered
+int32 POSITION_Z=4 # only z of position is considered
# the next values can be combined with one of the above, so they are offset by
# 256, so we can use bit operations on them
-int32 ORIENTATION_RPY=256 # only roll, pitch, yaw of orientation is considered
-int32 ORIENTATION_RY=512 # only roll, yaw of orientation is considered
-int32 ORIENTATION_RP=768 # only roll, yaw of orientation is considered
-int32 ORIENTATION_PY=1024 # only roll, yaw of orientation is considered
-int32 ORIENTATION_R=1280 # only roll, yaw of orientation is considered
-int32 ORIENTATION_P=1536 # only roll, yaw of orientation is considered
-int32 ORIENTATION_Y=1792 # only roll, yaw of orientation is considered
+int32 ORIENTATION_R=8 # only roll, yaw of orientation is considered
+int32 ORIENTATION_P=16 # only roll, yaw of orientation is considered
+int32 ORIENTATION_Y=32 # only roll, yaw of orientation is considered
int32 type
Modified: pkg/trunk/motion_planning/planning_environment/src/util/kinematic_state_constraint_evaluator.cpp
===================================================================
--- pkg/trunk/motion_planning/planning_environment/src/util/kinematic_state_constraint_evaluator.cpp 2009-07-22 04:41:39 UTC (rev 19380)
+++ pkg/trunk/motion_planning/planning_environment/src/util/kinematic_state_constraint_evaluator.cpp 2009-07-22 04:42:20 UTC (rev 19381)
@@ -151,156 +151,62 @@
{
if (distPos)
{
- if (m_pc.type & 0xFF)
- {
+ *distPos = 0.0;
+
+ if (m_pc.type & (motion_planning_msgs::PoseConstraint::POSITION_X | motion_planning_msgs::PoseConstraint::POSITION_Y | motion_planning_msgs::PoseConstraint::POSITION_Z))
+ {
const btVector3 &bodyPos = m_link->globalTrans.getOrigin();
- double dx, dy, dz;
- switch (m_pc.type & 0xFF)
+ if (m_pc.type & motion_planning_msgs::PoseConstraint::POSITION_X)
{
- case motion_planning_msgs::PoseConstraint::POSITION_XYZ:
- dx = bodyPos.getX() - m_x;
- dy = bodyPos.getY() - m_y;
- dz = bodyPos.getZ() - m_z;
- *distPos = 0.0;
+ double dx = bodyPos.getX() - m_x;
if (dx > m_pc.position_tolerance_above.x || -m_pc.position_tolerance_below.x > dx)
*distPos += dx * dx;
+ }
+ if (m_pc.type & motion_planning_msgs::PoseConstraint::POSITION_Y)
+ {
+ double dy = bodyPos.getX() - m_y;
if (dy > m_pc.position_tolerance_above.y || -m_pc.position_tolerance_below.y > dy)
*distPos += dy * dy;
+ }
+ if (m_pc.type & motion_planning_msgs::PoseConstraint::POSITION_Z)
+ {
+ double dz = bodyPos.getZ() - m_z;
if (dz > m_pc.position_tolerance_above.z || -m_pc.position_tolerance_below.z > dz)
*distPos += dz * dz;
- break;
- case motion_planning_msgs::PoseConstraint::POSITION_XY:
- dx = bodyPos.getX() - m_x;
- dy = bodyPos.getY() - m_y;
- *distPos = 0.0;
- if (dx > m_pc.position_tolerance_above.x || -m_pc.position_tolerance_below.x > dx)
- *distPos += dx * dx;
- if (dy > m_pc.position_tolerance_above.y || -m_pc.position_tolerance_below.y > dy)
- *distPos += dy * dy;
- break;
- case motion_planning_msgs::PoseConstraint::POSITION_XZ:
- dx = bodyPos.getX() - m_x;
- dz = bodyPos.getZ() - m_z;
- *distPos = 0.0;
- if (dx > m_pc.position_tolerance_above.x || -m_pc.position_tolerance_below.x > dx)
- *distPos += dx * dx;
- if (dz > m_pc.position_tolerance_above.z || -m_pc.position_tolerance_below.z > dz)
- *distPos += dz * dz;
- break;
- case motion_planning_msgs::PoseConstraint::POSITION_YZ:
- dy = bodyPos.getY() - m_y;
- dz = bodyPos.getZ() - m_z;
- *distPos = 0.0;
- if (dy > m_pc.position_tolerance_above.y || -m_pc.position_tolerance_below.y > dy)
- *distPos += dy * dy;
- if (dz > m_pc.position_tolerance_above.z || -m_pc.position_tolerance_below.z > dz)
- *distPos += dz * dz;
- break;
- case motion_planning_msgs::PoseConstraint::POSITION_X:
- dx = bodyPos.getX() - m_x;
- if (dx > m_pc.position_tolerance_above.x || -m_pc.position_tolerance_below.x > dx)
- *distPos = dx * dx;
- else
- *distPos = 0.0;
- break;
- case motion_planning_msgs::PoseConstraint::POSITION_Y:
- dy = bodyPos.getY() - m_y;
- if (dy > m_pc.position_tolerance_above.y || -m_pc.position_tolerance_below.y > dy)
- *distPos = dy * dy;
- else
- *distPos = 0.0;
- break;
- case motion_planning_msgs::PoseConstraint::POSITION_Z:
- dz = bodyPos.getZ() - m_z;
- if (dz > m_pc.position_tolerance_above.z || -m_pc.position_tolerance_below.z > dz)
- *distPos = dz * dz;
- else
- *distPos = 0.0;
- break;
- default:
- *distPos = 0.0;
}
}
- else
- *distPos = 0.0;
}
+
+
if (distAng)
{
- if (m_pc.type & (~0xFF))
+ *distAng = 0.0;
+
+ if (m_pc.type & (motion_planning_msgs::PoseConstraint::ORIENTATION_R | motion_planning_msgs::PoseConstraint::ORIENTATION_P | motion_planning_msgs::PoseConstraint::ORIENTATION_Y))
{
- double dx, dy, dz;
btScalar yaw, pitch, roll;
- m_link->globalTrans.getBasis().getEulerYPR(yaw, pitch, roll);
- switch (m_pc.type & (~0xFF))
+ m_link->globalTrans.getBasis().getEulerYPR(yaw, pitch, roll);
+
+ if (m_pc.type & motion_planning_msgs::PoseConstraint::ORIENTATION_R)
{
- case motion_planning_msgs::PoseConstraint::ORIENTATION_RPY:
- dx = angles::shortest_angular_distance(roll, m_roll);
- dy = angles::shortest_angular_distance(pitch, m_pitch);
- dz = angles::shortest_angular_distance(yaw, m_yaw);
- *distAng = 0.0;
+ double dx = angles::shortest_angular_distance(roll, m_roll);
if (dx > m_pc.orientation_tolerance_above.x || -m_pc.orientation_tolerance_below.x > dx)
- *distAng += fabs(dx);
+ *distAng += fabs(dx);
+ }
+ if (m_pc.type & motion_planning_msgs::PoseConstraint::ORIENTATION_P)
+ {
+ double dy = angles::shortest_angular_distance(pitch, m_pitch);
if (dy > m_pc.orientation_tolerance_above.y || -m_pc.orientation_tolerance_below.y > dy)
*distAng += fabs(dy);
+ }
+ if (m_pc.type & motion_planning_msgs::PoseConstraint::ORIENTATION_Y)
+ {
+ double dz = angles::shortest_angular_distance(yaw, m_yaw);
if (dz > m_pc.orientation_tolerance_above.z || -m_pc.orientation_tolerance_below.z > dz)
*distAng += fabs(dz);
- break;
- case motion_planning_msgs::PoseConstraint::ORIENTATION_RP:
- dx = angles::shortest_angular_distance(roll, m_roll);
- dy = angles::shortest_angular_distance(pitch, m_pitch);
- *distAng = 0.0;
- if (dx > m_pc.orientation_tolerance_above.x || -m_pc.orientation_tolerance_below.x > dx)
- *distAng += fabs(dx);
- if (dy > m_pc.orientation_tolerance_above.y || -m_pc.orientation_tolerance_below.y > dy)
- *distAng += fabs(dy);
- break;
- case motion_planning_msgs::PoseConstraint::ORIENTATION_RY:
- dx = angles::shortest_angular_distance(roll, m_roll);
- dz = angles::shortest_angular_distance(yaw, m_yaw);
- *distAng = 0.0;
- if (dx > m_pc.orientation_tolerance_above.x || -m_pc.orientation_tolerance_below.x > dx)
- *distAng += fabs(dx);
- if (dz > m_pc.orientation_tolerance_above.z || -m_pc.orientation_tolerance_below.z > dz)
- *distAng += fabs(dz);
- break;
- case motion_planning_msgs::PoseConstraint::ORIENTATION_PY:
- dy = angles::shortest_angular_distance(pitch, m_pitch);
- dz = angles::shortest_angular_distance(yaw, m_yaw);
- *distAng = 0.0;
- if (dy > m_pc.orientation_tolerance_above.y || -m_pc.orientation_tolerance_below.y > dy)
- *distAng += fabs(dy);
- if (dz > m_pc.orientation_tolerance_above.z || -m_pc.orientation_tolerance_below.z > dz)
- *distAng += fabs(dz);
- break;
- case motion_planning_msgs::PoseConstraint::ORIENTATION_R:
- dx = angles::shortest_angular_distance(roll, m_roll);
- if (dx > m_pc.orientation_tolerance_above.x || -m_pc.orientation_tolerance_below.x > dx)
- *distAng = fabs(dx);
- else
- *distAng = 0.0;
- break;
- case motion_planning_msgs::PoseConstraint::ORIENTATION_P:
- dy = angles::shortest_angular_distance(pitch, m_pitch);
- if (dy > m_pc.orientation_tolerance_above.y || -m_pc.orientation_tolerance_below.y > dy)
- *distAng = fabs(dy);
- else
- *distAng = 0.0;
- break;
- case motion_planning_msgs::PoseConstraint::ORIENTATION_Y:
- dz = angles::shortest_angular_distance(yaw, m_yaw);
- if (dz > m_pc.orientation_tolerance_above.z || -m_pc.orientation_tolerance_below.z > dz)
- *distAng = fabs(dz);
- else
- *distAng = 0.0;
- break;
- default:
- *distAng = 0.0;
- break;
- }
+ }
}
- else
- *distAng = 0.0;
}
}
else
@@ -330,127 +236,48 @@
if (m_link)
{
out << "Pose constraint on link '" << m_pc.link_name << "'" << std::endl;
+
+ if (m_pc.type & motion_planning_msgs::PoseConstraint::POSITION_X)
+ {
+ out << "x = " << m_x << " ";
+ out << " with tolerance: above " << m_pc.position_tolerance_above.x << ", below "
+ << m_pc.position_tolerance_below.x << std::endl;
+ }
+ if (m_pc.type & motion_planning_msgs::PoseConstraint::POSITION_Y)
+ {
+ out << "y = " << m_y << " ";
+ out << " with tolerance: above " << m_pc.position_tolerance_above.y << ", below "
+ << m_pc.position_tolerance_below.y << std::endl;
+ }
+ if (m_pc.type & motion_planning_msgs::PoseConstraint::POSITION_Z)
+ {
+ out << "z = " << m_z << " ";
+ out << " with tolerance: above " << m_pc.position_tolerance_above.z << ", below "
+ << m_pc.position_tolerance_below.z << std::endl;
+ }
- if (m_pc.type & 0xFF)
+ if (m_pc.type & motion_planning_msgs::PoseConstraint::ORIENTATION_R)
{
- out << " Desired position: ";
- switch (m_pc.type & 0xFF)
- {
- case motion_planning_msgs::PoseConstraint::POSITION_XYZ:
- out << "x = " << m_x << " ";
- out << "y = " << m_y << " ";
- out << "z = " << m_z << " ";
-
- out << " with tolerance: above [" << m_pc.position_tolerance_above.x << ", "
- << m_pc.position_tolerance_above.y << ", " << m_pc.position_tolerance_above.z << "], below ["
- << m_pc.position_tolerance_below.x << ", " << m_pc.position_tolerance_below.y << ", "
- << m_pc.position_tolerance_below.z << "]" << std::endl;
-
- break;
- case motion_planning_msgs::PoseConstraint::POSITION_XY:
- out << "x = " << m_x << " ";
- out << "y = " << m_y << " ";
-
- out << " with tolerance: above [" << m_pc.position_tolerance_above.x << ", "
- << m_pc.position_tolerance_above.y << "], below ["
- << m_pc.position_tolerance_below.x << ", " << m_pc.position_tolerance_below.y << "]" << std::endl;
- break;
- case motion_planning_msgs::PoseConstraint::POSITION_XZ:
- out << "x = " << m_x << " ";
- out << "z = " << m_z << " ";
- out << " with tolerance: above [" << m_pc.position_tolerance_above.x << ", "
- << m_pc.position_tolerance_above.z << "], below ["
- << m_pc.position_tolerance_below.x << ", " << m_pc.position_tolerance_below.z << "]" << std::endl;
- break;
- case motion_planning_msgs::PoseConstraint::POSITION_YZ:
- out << "y = " << m_y << " ";
- out << "z = " << m_z << " ";
- out << " with tolerance: above [" << m_pc.position_tolerance_above.y << ", "
- << m_pc.position_tolerance_above.z << "], below ["
- << m_pc.position_tolerance_below.y << ", " << m_pc.position_tolerance_below.z << "]" << std::endl;
- break;
- case motion_planning_msgs::PoseConstraint::POSITION_X:
- out << "x = " << m_x << " ";
- out << " with tolerance: above [" << m_pc.position_tolerance_above.x << "], below ["
- << m_pc.position_tolerance_below.x << "]" << std::endl;
- break;
- case motion_planning_msgs::PoseConstraint::POSITION_Y:
- out << "y = " << m_y << " ";
- out << " with tolerance: above [" << m_pc.position_tolerance_above.y << "], below ["
- << m_pc.position_tolerance_below.y << "]" << std::endl;
- break;
- case motion_planning_msgs::PoseConstraint::POSITION_Z:
- out << "z = " << m_z << " ";
- out << " with tolerance: above [" << m_pc.position_tolerance_above.z << "], below ["
- << m_pc.position_tolerance_below.z << "]" << std::endl;
- break;
- default:
- break;
- }
+ out << "roll = " << m_roll << " ";
+ out << " with tolerance: above " << m_pc.position_tolerance_above.x << ", below "
+ << m_pc.position_tolerance_below.x << std::endl;
}
-
- if (m_pc.type & (~0xFF))
+ if (m_pc.type & motion_planning_msgs::PoseConstraint::ORIENTATION_P)
{
- out << " Desired orientation: ";
- switch (m_pc.type & (~0xFF))
- {
- case motion_planning_msgs::PoseConstraint::ORIENTATION_RPY:
- out << "roll = " << m_roll << " ";
- out << "pitch = " << m_pitch << " ";
- out << "yaw = " << m_yaw << " ";
-
- out << " with tolerance: above [" << m_pc.position_tolerance_above.x << ", "
- << m_pc.position_tolerance_above.y << ", " << m_pc.position_tolerance_above.z << "], below ["
- << m_pc.position_tolerance_below.x << ", " << m_pc.position_tolerance_below.y << ", "
- << m_pc.position_tolerance_below.z << "]" << std::endl;
- break;
- case motion_planning_msgs::PoseConstraint::ORIENTATION_RP:
- out << "roll = " << m_roll << " ";
- out << "pitch = " << m_pitch << " ";
-
- out << " with tolerance: above [" << m_pc.position_tolerance_above.x << ", "
- << m_pc.position_tolerance_above.y << "], below ["
- << m_pc.position_tolerance_below.x << ", " << m_pc.position_tolerance_below.y << "]" << std::endl;
- break;
- case motion_planning_msgs::PoseConstraint::ORIENTATION_RY:
- out << "roll = " << m_roll << " ";
- out << "yaw = " << m_yaw << " ";
-
- out << " with tolerance: above [" << m_pc.position_tolerance_above.x << ", "
- << m_pc.position_tolerance_above.z << "], below ["
- << m_pc.position_tolerance_below.x << ", " << m_pc.position_tolerance_below.z << "]" << std::endl;
- break;
- case motion_planning_msgs::PoseConstraint::ORIENTATION_PY:
- out << "pitch = " << m_pitch << " ";
- out << "yaw = " << m_yaw << " ";
-
- out << " with tolerance: above [" << m_pc.position_tolerance_above.y << ", "
- << m_pc.position_tolerance_above.z << "], below ["
- << m_pc.position_tolerance_below.y << ", " << m_pc.position_tolerance_below.z << "]" << std::endl;
- break;
- case motion_planning_msgs::PoseConstraint::ORIENTATION_R:
- out << "roll = " << m_roll << " ";
- out << " with tolerance: above [" << m_pc.position_tolerance_above.x << "], below ["
- << m_pc.position_tolerance_below.x << "]" << std::endl;
- break;
- case motion_planning_msgs::PoseConstraint::ORIENTATION_P:
- out << "pitch = " << m_pitch << " ";
- out << " with tolerance: above [" << m_pc.position_tolerance_above.y << "], below ["
- << m_pc.position_tolerance_below.y << "]" << std::endl;
- break;
- case motion_planning_msgs::PoseConstraint::ORIENTATION_Y:
- out << "yaw = " << m_yaw << " ";
- out << " with tolerance: above [" << m_pc.position_tolerance_above.z << "], below ["
- << m_pc.position_tolerance_below.z << "]" << std::endl;
- break;
- default:
- break;
- }
+ out << "pitch = " << m_pitch << " ";
+ out << " with tolerance: above " << m_pc.position_tolerance_above.y << ", below "
+ << m_pc.position_tolerance_below.y << std::endl;
+ }
+ if (m_pc.type & motion_planning_msgs::PoseConstraint::ORIENTATION_Y)
+ {
+ out << "yaw = " << m_yaw << " ";
+ out << " with tolerance: above " << m_pc.position_tolerance_above.z << ", below "
+ << m_pc.position_tolerance_below.z << std::endl;
- if (m_pc.type & 0xFF)
- out << "Orientation importance is " << m_pc.orientation_importance;
}
+ if (m_pc.type & (motion_planning_msgs::PoseConstraint::ORIENTATION_R | motion_planning_msgs::PoseConstraint::ORIENTATION_P | motion_planning_msgs::PoseConstraint::ORIENTATION_Y))
+ out << "Orientation importance is " << m_pc.orientation_importance;
}
else
out << "No constraint" << std::endl;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hsu...@us...> - 2009-07-22 14:44:05
|
Revision: 19403
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19403&view=rev
Author: hsujohnhsu
Date: 2009-07-22 14:44:02 +0000 (Wed, 22 Jul 2009)
Log Message:
-----------
update head stereo hztests due to changes in pr2.xacro.xml to use wide_stereo and narrow_stereo.
Modified Paths:
--------------
pkg/trunk/drivers/simulator/test_pr2_sensors_gazebo/hztest_pr2_image.launch
pkg/trunk/stacks/pr2/pr2_defs/defs/head_defs.xml
Modified: pkg/trunk/drivers/simulator/test_pr2_sensors_gazebo/hztest_pr2_image.launch
===================================================================
--- pkg/trunk/drivers/simulator/test_pr2_sensors_gazebo/hztest_pr2_image.launch 2009-07-22 09:07:13 UTC (rev 19402)
+++ pkg/trunk/drivers/simulator/test_pr2_sensors_gazebo/hztest_pr2_image.launch 2009-07-22 14:44:02 UTC (rev 19403)
@@ -13,18 +13,17 @@
<node pkg="pr2_mechanism_controllers" type="send_laser_traj_cmd_ms2.py" args="laser_tilt_controller" />
<!-- start stereo -->
- <include file="$(find stereo_image_proc)/stereoproc.launch" />
+ <include file="$(find stereo_image_proc)/wide_stereoproc.launch" />
+ <include file="$(find stereo_image_proc)/narrow_stereoproc.launch" />
<!-- Run hztest -->
<!-- Test for publication rate of 'stereo/cloud' topic -->
- <test test-name="hztest_test_stereo_cloud" pkg="rostest" type="hztest" time-limit="60" name="stereo_cloud_test">
+ <test test-name="hztest_test_narrow_stereo_cloud" pkg="rostest" type="hztest" time-limit="60" name="narrow_stereo_cloud_test">
<!-- The topic to listen for -->
- <param name="topic" value="/stereo/cloud" />
- <!-- The expected publication rate [Hz]. Set to 0.0 to only check that
- at least one message is received. -->
+ <param name="topic" value="/narrow_stereo/cloud" />
+ <!-- The expected publication rate [Hz]. Set to 0.0 to only check that at least one message is received. -->
<param name="hz" value="20.0" />
- <!-- Acceptable error in the publication rate [Hz]. Ignored if hz is set
- to 0.0. -->
+ <!-- Acceptable error in the publication rate [Hz]. Ignored if hz is set to 0.0. -->
<param name="hzerror" value="1.0" />
<!-- Time to listen for [seconds] -->
<param name="test_duration" value="2.0" />
@@ -36,33 +35,67 @@
<param name="check_intervals" value="false" />
</test>
- <!-- Test for publication of 'left stereo camera image publish rate' topic -->
- <test test-name="hztest_test_stereo_left_image" pkg="rostest" type="hztest" time-limit="60" name="stereo_left_image_test">
- <param name="topic" value="/stereo/left/image" />
+ <!-- Test for publication of 'left narrow_stereo camera image publish rate' topic -->
+ <test test-name="hztest_test_narrow_stereo_left_image" pkg="rostest" type="hztest" time-limit="60" name="narrow_stereo_left_image_test">
+ <param name="topic" value="/narrow_stereo/left/image" />
<param name="hz" value="20.0" />
<param name="hzerror" value="1.0" />
<param name="test_duration" value="2.0" />
<param name="check_intervals" value="false" />
</test>
- <!-- Test for publication of 'left stereo camera image publish rate' topic -->
- <test test-name="hztest_test_stereo_right_image" pkg="rostest" type="hztest" time-limit="60" name="stereo_right_image_test">
- <param name="topic" value="/stereo/right/image" />
+ <!-- Test for publication of 'right narrow_stereo camera image publish rate' topic -->
+ <test test-name="hztest_test_narrow_stereo_right_image" pkg="rostest" type="hztest" time-limit="60" name="narrow_stereo_right_image_test">
+ <param name="topic" value="/narrow_stereo/right/image" />
<param name="hz" value="20.0" />
<param name="hzerror" value="1.0" />
<param name="test_duration" value="2.0" />
<param name="check_intervals" value="false" />
</test>
- <!-- Test for publication of 'raw_stereo' topic. -->
- <test test-name="hztest_test_raw_stereo" pkg="rostest" type="hztest" time-limit="50" name="raw_stereo_test">
- <!-- Note how we use a different parameter namespace and node name
- for this test (raw_stereo_test vs. scan_test). -->
- <param name="topic" value="/stereo/raw_stereo" />
+ <!-- Test for publication of narrow 'raw_stereo' topic. -->
+ <test test-name="hztest_test_narrow_raw_stereo" pkg="rostest" type="hztest" time-limit="50" name="narrow_raw_stereo_test">
+ <param name="topic" value="/narrow_stereo/raw_stereo" />
<param name="hz" value="20.0" />
<param name="hzerror" value="1.0" />
<param name="test_duration" value="2.0" />
<param name="check_intervals" value="false" />
</test>
+ <!-- Run hztest -->
+ <test test-name="hztest_test_wide_stereo_cloud" pkg="rostest" type="hztest" time-limit="60" name="wide_stereo_cloud_test">
+ <param name="topic" value="/wide_stereo/cloud" />
+ <param name="hz" value="20.0" />
+ <param name="hzerror" value="1.0" />
+ <param name="test_duration" value="2.0" />
+ <param name="check_intervals" value="false" />
+ </test>
+
+ <!-- Test for publication of 'left wide_stereo camera image publish rate' topic -->
+ <test test-name="hztest_test_wide_stereo_left_image" pkg="rostest" type="hztest" time-limit="60" name="wide_stereo_left_image_test">
+ <param name="topic" value="/wide_stereo/left/image" />
+ <param name="hz" value="20.0" />
+ <param name="hzerror" value="1.0" />
+ <param name="test_duration" value="2.0" />
+ <param name="check_intervals" value="false" />
+ </test>
+
+ <!-- Test for publication of 'right wide_stereo camera image publish rate' topic -->
+ <test test-name="hztest_test_wide_stereo_right_image" pkg="rostest" type="hztest" time-limit="60" name="wide_stereo_right_image_test">
+ <param name="topic" value="/wide_stereo/right/image" />
+ <param name="hz" value="20.0" />
+ <param name="hzerror" value="1.0" />
+ <param name="test_duration" value="2.0" />
+ <param name="check_intervals" value="false" />
+ </test>
+
+ <!-- Test for publication of wide 'raw_stereo' topic. -->
+ <test test-name="hztest_test_wide_raw_stereo" pkg="rostest" type="hztest" time-limit="50" name="wide_raw_stereo_test">
+ <param name="topic" value="/wide_stereo/raw_stereo" />
+ <param name="hz" value="20.0" />
+ <param name="hzerror" value="1.0" />
+ <param name="test_duration" value="2.0" />
+ <param name="check_intervals" value="false" />
+ </test>
+
</launch>
Modified: pkg/trunk/stacks/pr2/pr2_defs/defs/head_defs.xml
===================================================================
--- pkg/trunk/stacks/pr2/pr2_defs/defs/head_defs.xml 2009-07-22 09:07:13 UTC (rev 19402)
+++ pkg/trunk/stacks/pr2/pr2_defs/defs/head_defs.xml 2009-07-22 14:44:02 UTC (rev 19403)
@@ -220,11 +220,11 @@
<!-- Wide camera is on robot right (hca1), narrow on left (hca2)? -->
<!-- 15mm offset from center needs check with CAD -->
- <stereo_camera parent="${name}_link" name="${name}_wide" >
+ <stereo_camera parent="${name}_link" name="wide_stereo" >
<origin xyz="0 -0.015 0" rpy="0 0 0" />
</stereo_camera>
- <stereo_camera parent="${name}_link" name="${name}_narrow" >
+ <stereo_camera parent="${name}_link" name="narrow_stereo" >
<origin xyz="0 0.015 0" rpy="0 0 0" />
</stereo_camera>
</macro>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <is...@us...> - 2009-07-22 17:09:38
|
Revision: 19411
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19411&view=rev
Author: isucan
Date: 2009-07-22 17:09:37 +0000 (Wed, 22 Jul 2009)
Log Message:
-----------
debug message
Modified Paths:
--------------
pkg/trunk/highlevel/move_arm/src/move_arm_action.cpp
pkg/trunk/motion_planning/ompl_planning/src/helpers/ompl_extensions/StateValidator.cpp
Modified: pkg/trunk/highlevel/move_arm/src/move_arm_action.cpp
===================================================================
--- pkg/trunk/highlevel/move_arm/src/move_arm_action.cpp 2009-07-22 17:07:21 UTC (rev 19410)
+++ pkg/trunk/highlevel/move_arm/src/move_arm_action.cpp 2009-07-22 17:09:37 UTC (rev 19411)
@@ -179,7 +179,9 @@
}
fillStartState(req.start_state);
-
+
+ ROS_DEBUG("Issued request for motion planning");
+
// call the planner and decide whether to use the path
if (clientPlan.call(req, res))
{
Modified: pkg/trunk/motion_planning/ompl_planning/src/helpers/ompl_extensions/StateValidator.cpp
===================================================================
--- pkg/trunk/motion_planning/ompl_planning/src/helpers/ompl_extensions/StateValidator.cpp 2009-07-22 17:07:21 UTC (rev 19410)
+++ pkg/trunk/motion_planning/ompl_planning/src/helpers/ompl_extensions/StateValidator.cpp 2009-07-22 17:09:37 UTC (rev 19411)
@@ -51,6 +51,7 @@
// if this is a new thread, we create an additional clone
if (p == (int)clones_.size())
{
+ ROS_DEBUG("Cloning collision environment (index %d)", p);
clones_.resize(p + 1);
clones_[p].em = clones_[0].em->clone();
clones_[p].km = clones_[p].em->getRobotModel().get();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hsu...@us...> - 2009-07-22 19:22:20
|
Revision: 19420
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19420&view=rev
Author: hsujohnhsu
Date: 2009-07-22 19:02:34 +0000 (Wed, 22 Jul 2009)
Log Message:
-----------
* replace parameter name "robotdesc/pr2" by "robot_description"
* use ros::NodeHandle().searchParam() when looking for robot_description
* update launch scripts
* rename package gazebo_robot_description to gazebo_worlds
* rename sub directories gazebo_worlds->worlds, gazebo_objects->objects
* update manifests and launch scripts
Modified Paths:
--------------
pkg/trunk/calibration/kinematic_calibration/src/add_calibration_data.cpp
pkg/trunk/calibration/kinematic_calibration/src/arm_phasespace_grabber.cpp
pkg/trunk/calibration/kinematic_calibration/src/run_chain_dumper.cpp
pkg/trunk/calibration/laser_cb_processing/src/pr2_tilt_laser_projector.cpp
pkg/trunk/controllers/pr2_mechanism_controllers/src/base_controller.cpp
pkg/trunk/controllers/pr2_mechanism_controllers/src/base_controller_pos.cpp
pkg/trunk/controllers/pr2_mechanism_controllers/src/pr2_arm_dynamics_controller.cpp
pkg/trunk/demos/2dnav_gazebo/doc.dox
pkg/trunk/demos/2dnav_gazebo/pr2-empty-amcl.launch
pkg/trunk/demos/2dnav_gazebo/pr2-empty-fake_localization.launch
pkg/trunk/demos/2dnav_gazebo/pr2-simple-fake_localization.launch
pkg/trunk/demos/2dnav_gazebo/pr2-wg-amcl.launch
pkg/trunk/demos/2dnav_gazebo/prototype1-simple-amcl.launch
pkg/trunk/demos/2dnav_gazebo/prototype1-wg-fake_localization.launch
pkg/trunk/demos/2dnav_pr2/rviz/move_base.vcg
pkg/trunk/demos/2dnav_pr2/rviz/move_base_local.vcg
pkg/trunk/demos/arm_gazebo/l_arm.launch
pkg/trunk/demos/arm_gazebo/l_gripper.launch
pkg/trunk/demos/arm_gazebo/manifest.xml
pkg/trunk/demos/arm_gazebo/r_arm.launch
pkg/trunk/demos/arm_gazebo/r_arm_grasping_demo.launch
pkg/trunk/demos/arm_gazebo/r_gripper.launch
pkg/trunk/demos/arm_gazebo/scripts/setparam.py
pkg/trunk/demos/arm_gazebo/scripts/test_launch_order.tcsh
pkg/trunk/demos/arm_gazebo/tests/r_arm_constraint.launch
pkg/trunk/demos/arm_gazebo/tests/r_arm_spacenav.launch
pkg/trunk/demos/door_demos_gazebo/door_defs/door_defs.xml
pkg/trunk/demos/door_demos_gazebo/door_defs/send_description.launch
pkg/trunk/demos/door_demos_gazebo/launch/door_only_test.launch
pkg/trunk/demos/door_demos_gazebo/launch/pr2_and_door.launch
pkg/trunk/demos/door_demos_gazebo/robots/door_only.xacro.xml
pkg/trunk/demos/erratic_gazebo/2dnav-gazebo-simple-fake_localization.xml
pkg/trunk/demos/erratic_gazebo/erratic.launch
pkg/trunk/demos/erratic_gazebo/manifest.xml
pkg/trunk/demos/examples_gazebo/dual_link.launch
pkg/trunk/demos/examples_gazebo/dual_link_defs/Makefile
pkg/trunk/demos/examples_gazebo/dual_link_defs/send_description.launch
pkg/trunk/demos/examples_gazebo/multi_link.launch
pkg/trunk/demos/examples_gazebo/multi_link_defs/Makefile
pkg/trunk/demos/examples_gazebo/multi_link_defs/send_description.launch
pkg/trunk/demos/examples_gazebo/simple_box.launch
pkg/trunk/demos/examples_gazebo/simple_cylinder.launch
pkg/trunk/demos/examples_gazebo/simple_rdf_examples/simple_cylinder.xml
pkg/trunk/demos/examples_gazebo/simple_sphere.launch
pkg/trunk/demos/examples_gazebo/single_link.launch
pkg/trunk/demos/examples_gazebo/single_link_defs/Makefile
pkg/trunk/demos/examples_gazebo/single_link_defs/send_description.launch
pkg/trunk/demos/examples_gazebo/table.launch
pkg/trunk/demos/examples_gazebo/table_defs/Makefile
pkg/trunk/demos/examples_gazebo/table_defs/send_description.launch
pkg/trunk/demos/plug_in_gazebo/launch/plug_outlet.launch
pkg/trunk/demos/plug_in_gazebo/launch/pr2_plug_outlet.launch
pkg/trunk/demos/plug_in_gazebo/plug_defs/send_description.launch
pkg/trunk/demos/plug_in_gazebo/robots/outlet_only.xacro.xml
pkg/trunk/demos/plug_in_gazebo/robots/plug_only.xacro.xml
pkg/trunk/demos/pr2_gazebo/coffee_cup.launch
pkg/trunk/demos/pr2_gazebo/cups.launch
pkg/trunk/demos/pr2_gazebo/cups2.launch
pkg/trunk/demos/pr2_gazebo/head_cart_simple.launch
pkg/trunk/demos/pr2_gazebo/manifest.xml
pkg/trunk/demos/pr2_gazebo/pr2.launch
pkg/trunk/demos/pr2_gazebo/prf.launch
pkg/trunk/demos/pr2_gazebo/prototype1.launch
pkg/trunk/demos/pr2_gazebo/prototype1_balcony_world.launch
pkg/trunk/demos/pr2_gazebo/prototype1_simple_office.launch
pkg/trunk/demos/pr2_gazebo/tables.launch
pkg/trunk/demos/pr2_gazebo/test_grasping.launch
pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/laser+stereo-perception.launch
pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/laser-perception.launch
pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/launch/stereo-perception.launch
pkg/trunk/demos/tabletop_manipulation/tabletop_scripts/old/gazebo/simple.world
pkg/trunk/demos/test_2dnav_gazebo/test_2dnav_empty_amcl_axis.launch
pkg/trunk/demos/test_2dnav_gazebo/test_2dnav_empty_axis.launch
pkg/trunk/demos/test_2dnav_gazebo/test_2dnav_empty_diagonal.launch
pkg/trunk/demos/test_2dnav_gazebo/test_2dnav_empty_odom.launch
pkg/trunk/demos/test_2dnav_gazebo/test_2dnav_empty_rotation.launch
pkg/trunk/demos/test_2dnav_gazebo/test_2dnav_wg.launch
pkg/trunk/drivers/cam/camera_trigger_test/scripts/runmode0.sh
pkg/trunk/drivers/cam/camera_trigger_test/testmode0.launch
pkg/trunk/drivers/cam/camera_trigger_test/testmode1.launch
pkg/trunk/drivers/robot/pr2/fingertip_pressure/demo/real_hardware_sensor.launch
pkg/trunk/drivers/simulator/gazebo_plugin/doc.dox
pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/gazebo_mechanism_control.h
pkg/trunk/drivers/simulator/gazebo_plugin/src/gazebo_mechanism_control.cpp
pkg/trunk/drivers/simulator/gazebo_plugin/src/urdf2factory.cpp
pkg/trunk/drivers/simulator/gazebo_plugin/src/xml2factory.cpp
pkg/trunk/drivers/simulator/test_gazebo_plugin/manifest.xml
pkg/trunk/drivers/simulator/test_pr2_collision_gazebo/manifest.xml
pkg/trunk/drivers/simulator/test_pr2_collision_gazebo/test_slide.launch
pkg/trunk/drivers/simulator/test_pr2_mechanism_controllers_gazebo/manifest.xml
pkg/trunk/drivers/simulator/test_pr2_sensors_gazebo/manifest.xml
pkg/trunk/drivers/simulator/test_pr2_sensors_gazebo/test_camera.launch
pkg/trunk/drivers/simulator/test_pr2_sensors_gazebo/test_scan.launch
pkg/trunk/highlevel/move_arm/launch/arm_cmd_line.launch
pkg/trunk/highlevel/move_arm/launch/move_larm.launch
pkg/trunk/highlevel/move_arm/launch/move_rarm.launch
pkg/trunk/highlevel/plugs/plugs_core/rviz/full.vcg
pkg/trunk/highlevel/plugs/plugs_core/rviz/plugging_in.vcg
pkg/trunk/highlevel/test_executive_trex_pr2/wpc_gazebo.0/launch_gazebo_prototype1_tables.xml
pkg/trunk/highlevel/test_executive_trex_pr2/wpc_gazebo.0/launch_gazebo_prototype1_wg.xml
pkg/trunk/highlevel/test_executive_trex_pr2/wpc_gazebo.1/launch_gazebo_prototype1_tables.xml
pkg/trunk/highlevel/test_executive_trex_pr2/wpc_gazebo.1/launch_gazebo_prototype1_wg_no_x.xml
pkg/trunk/motion_planning/ompl_planning/motion_planning.launch
pkg/trunk/motion_planning/planning_environment/clear_known_objects.launch
pkg/trunk/motion_planning/planning_environment/display_planner_collision_model.launch
pkg/trunk/motion_planning/planning_environment/view_state_validity.launch
pkg/trunk/motion_planning/planning_research/sbpl_arm_planner_node/launch/sbpl_arm_planner_node.launch
pkg/trunk/motion_planning/planning_research/sbpl_arm_planner_node/src/sbpl_arm_planner_node.cpp
pkg/trunk/motion_planning/planning_research/sbpl_pm_wrapper/src/pm_wrapper.cpp
pkg/trunk/pr2/dynamic_verification/tests/wrist.launch
pkg/trunk/pr2/dynamic_verification/tests/wrist_gazebo.launch
pkg/trunk/pr2/life_test/arm_life_test/full_arm.launch
pkg/trunk/pr2/life_test/arm_life_test/test_gui.launch
pkg/trunk/pr2/life_test/arm_life_test/test_gui_cb.launch
pkg/trunk/pr2/life_test/arm_life_test/test_gui_cb_forearm.launch
pkg/trunk/pr2/life_test/arm_life_test/test_roll_gui.launch
pkg/trunk/pr2/life_test/caster_life_test/send_description.launch
pkg/trunk/pr2/life_test/caster_life_test/test_cart.launch
pkg/trunk/pr2/life_test/gripper_life_test/test_cart.launch
pkg/trunk/pr2/life_test/head_test/impact_test/test_cart.launch
pkg/trunk/pr2/life_test/head_test/impact_test/test_gui.launch
pkg/trunk/pr2/life_test/head_test/life_test/test_cart.launch
pkg/trunk/pr2/life_test/head_test/life_test/test_gui.launch
pkg/trunk/pr2/life_test/laser_tilt_test/impact_test/test_cart.launch
pkg/trunk/pr2/life_test/laser_tilt_test/life_test/test_cart.launch
pkg/trunk/pr2/life_test/pr2_etherCAT.launch
pkg/trunk/pr2/life_test/wrist_test/test_cart.launch
pkg/trunk/pr2/life_test/wrist_test/test_gui.launch
pkg/trunk/pr2/qualification/onboard/visualization/view.vcg
pkg/trunk/pr2/qualification/tests/caster_test/caster.launch
pkg/trunk/pr2/qualification/tests/caster_test/caster_alpha2.launch
pkg/trunk/pr2/qualification/tests/caster_test/view.vcg
pkg/trunk/pr2/qualification/tests/forearm_cam_test/ethercat.launch
pkg/trunk/pr2/qualification/tests/full_arm_test/full_arm.launch
pkg/trunk/pr2/qualification/tests/full_arm_test/view.vcg
pkg/trunk/pr2/qualification/tests/gripper_test/gripper.launch
pkg/trunk/pr2/qualification/tests/gripper_test/view.vcg
pkg/trunk/pr2/qualification/tests/head_test/head.launch
pkg/trunk/pr2/qualification/tests/head_test/head_alpha2.launch
pkg/trunk/pr2/qualification/tests/head_test/head_alpha2a.launch
pkg/trunk/pr2/qualification/tests/head_test/head_alpha2b.launch
pkg/trunk/pr2/qualification/tests/head_test/view.vcg
pkg/trunk/pr2/qualification/tests/laser_tilt_test/laser_tilt.launch
pkg/trunk/pr2/qualification/tests/laser_tilt_test/laser_tilt_alpha2.launch
pkg/trunk/pr2/qualification/tests/laser_tilt_test/view.vcg
pkg/trunk/pr2/qualification/tests/pr2_etherCAT.launch
pkg/trunk/pr2/qualification/tests/shoulder_test/shoulder.launch
pkg/trunk/pr2/qualification/tests/shoulder_test/shoulder_visualization.launch
pkg/trunk/pr2/qualification/tests/shoulder_test/view.vcg
pkg/trunk/pr2/qualification/tests/torso_lift_test/torso.launch
pkg/trunk/pr2/qualification/tests/torso_lift_test/view.vcg
pkg/trunk/pr2/qualification/tests/upperarm_flex_only_test/upperarm.launch
pkg/trunk/pr2/qualification/tests/upperarm_flex_only_test/upperarm_visualization.launch
pkg/trunk/pr2/qualification/tests/upperarm_flex_only_test/view.vcg
pkg/trunk/pr2/qualification/tests/upperarm_test/upperarm.launch
pkg/trunk/pr2/qualification/tests/upperarm_test/view.vcg
pkg/trunk/pr2/qualification/tests/wrist_test/view.vcg
pkg/trunk/pr2/qualification/tests/wrist_test/wrist.launch
pkg/trunk/pr2/qualification/tests/wrist_test/wrist_visualization.launch
pkg/trunk/robot_descriptions/gazebo_worlds/CMakeLists.txt
pkg/trunk/robot_descriptions/gazebo_worlds/launch/checker.launch
pkg/trunk/robot_descriptions/gazebo_worlds/launch/light.launch
pkg/trunk/robot_descriptions/gazebo_worlds/manifest.xml
pkg/trunk/robot_descriptions/gazebo_worlds/worlds/floorobj.world
pkg/trunk/robot_descriptions/gazebo_worlds/worlds/simple.world
pkg/trunk/robot_descriptions/gazebo_worlds/worlds/simple_erratic.world
pkg/trunk/robot_descriptions/gazebo_worlds/worlds/tables.world
pkg/trunk/robot_descriptions/gazebo_worlds/worlds/wg.world
pkg/trunk/robot_descriptions/pr2/pr2_configurations/arm_cart/full_arm.launch
pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_arm/init.launch
pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_arm/send_description.launch
pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_head_cart/hca.launch
pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_head_cart/hcb.launch
pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_head_cart/hcc.launch
pkg/trunk/robot_descriptions/pr2/pr2_configurations/pr2_laser_tilt/init.launch
pkg/trunk/sandbox/chomp_motion_planner/launch/chomp_node.launch
pkg/trunk/sandbox/chomp_motion_planner/launch/chomp_node_debug.launch
pkg/trunk/sandbox/dynamics_estimation/dynamics_estimation.launch
pkg/trunk/sandbox/dynamics_estimation/include/dynamics_estimation/dynamics_estimation_node.h
pkg/trunk/sandbox/dynamics_estimation/r_arm.launch
pkg/trunk/sandbox/dynamics_estimation/src/dynamics_estimation_node.cpp
pkg/trunk/sandbox/fk_node/launch/fk_node.launch
pkg/trunk/sandbox/pr2_gripper_controller/launch/gripper.launch
pkg/trunk/sandbox/pr2_gripper_controller/launch/pr2_etherCAT.launch
pkg/trunk/sandbox/teleop_anti_collision/launch/test_teleop_anti_collision.xml
pkg/trunk/stacks/mechanism/robot_state_publisher/src/state_publisher.cpp
pkg/trunk/stacks/pr2/pr2_alpha/pre_ethercat_reset.launch
pkg/trunk/stacks/pr2/pr2_alpha/prf_ethercat_reset.launch
pkg/trunk/stacks/pr2/pr2_alpha/prf_manip.launch
pkg/trunk/stacks/pr2/pr2_alpha/prf_sim.launch
pkg/trunk/stacks/pr2/pr2_alpha/prg_ethercat_reset.launch
pkg/trunk/stacks/pr2/pr2_alpha/send_description.launch
pkg/trunk/stacks/pr2/pr2_defs/pr2_description.launch
pkg/trunk/stacks/simulators/gazebo/launch/balcony_world.launch
pkg/trunk/stacks/simulators/gazebo/launch/camera_world.launch
pkg/trunk/stacks/simulators/gazebo/launch/empty_world.launch
pkg/trunk/stacks/simulators/gazebo/launch/empty_world_no_x.launch
pkg/trunk/stacks/simulators/gazebo/launch/office_world.launch
pkg/trunk/stacks/simulators/gazebo/launch/scan_world.launch
pkg/trunk/stacks/simulators/gazebo/launch/simple_world.launch
pkg/trunk/stacks/simulators/gazebo/launch/slide_world.launch
pkg/trunk/stacks/simulators/gazebo/launch/wg_world.launch
pkg/trunk/stacks/simulators/gazebo/quick_gazebo.sh
pkg/trunk/stacks/simulators/gazebo/setup.bash
pkg/trunk/stacks/simulators/gazebo/setup.tcsh
pkg/trunk/stacks/trex/trex_pr2/cfg/launch_gazebo.xml
pkg/trunk/stacks/trex/trex_pr2/cfg/launch_gazebo_obstacle.xml
pkg/trunk/stacks/trex/trex_pr2/cfg/launch_gazebo_prototype1.xml
pkg/trunk/stacks/trex/trex_ros/deprecated/wpc_gazebo.0/launch_gazebo_prototype1_tables.xml
pkg/trunk/stacks/trex/trex_ros/deprecated/wpc_gazebo.0/launch_gazebo_prototype1_wg.xml
pkg/trunk/stacks/trex/trex_ros/deprecated/wpc_gazebo.1/launch_gazebo_prototype1_tables.xml
pkg/trunk/stacks/visualization/rviz/configs/pr2.vcg
pkg/trunk/util/pr2_ik/mainpage.dox
pkg/trunk/util/pr2_ik/pr2_ik_controller.launch
pkg/trunk/util/pr2_ik/src/pr2_ik_solver.cpp
pkg/trunk/util/pr2_ik/test_pr2_ik.xml
pkg/trunk/util/robot_self_filter/mainpage.dox
pkg/trunk/util/robot_self_filter/self_filter.launch
pkg/trunk/util/self_watch/self_watch.launch
Added Paths:
-----------
pkg/trunk/robot_descriptions/gazebo_worlds/
pkg/trunk/robot_descriptions/gazebo_worlds/objects/
pkg/trunk/robot_descriptions/gazebo_worlds/worlds/
Removed Paths:
-------------
pkg/trunk/robot_descriptions/gazebo_robot_description/
pkg/trunk/robot_descriptions/gazebo_worlds/gazebo_objects/
pkg/trunk/robot_descriptions/gazebo_worlds/gazebo_worlds/
pkg/trunk/robot_descriptions/gazebo_worlds/world/
Modified: pkg/trunk/calibration/kinematic_calibration/src/add_calibration_data.cpp
===================================================================
--- pkg/trunk/calibration/kinematic_calibration/src/add_calibration_data.cpp 2009-07-22 18:57:21 UTC (rev 19419)
+++ pkg/trunk/calibration/kinematic_calibration/src/add_calibration_data.cpp 2009-07-22 19:02:34 UTC (rev 19420)
@@ -35,6 +35,7 @@
#include <utility>
#include "ros/node.h"
+#include "ros/node_handle.h"
#include "mechanism_model/robot.h"
#include "tinyxml/tinyxml.h"
#include "hardware_interface/hardware_interface.h"
@@ -64,16 +65,23 @@
printf("Getting robot description from param server...") ;
fflush(stdout) ;
string robot_desc ;
+
+ // hack: create a node handle to do a searchParam for robot_description
+ // to do this properly, switch to node handles api
+ ros::NodeHandle node_handle;
+ std::string pr2_urdf_param_name;
+ node_handle.searchParam("robot_description",pr2_urdf_param_name);
+
bool success ;
- success = node_->getParam("robotdesc/pr2", robot_desc) ;
+ success = node_->getParam(pr2_urdf_param_name, robot_desc) ;
if (!success)
{
- printf("ERROR: Could not access robot_desc/pr2 from param server\n") ;
+ printf("ERROR: Could not access robot_description from param server\n") ;
}
else
printf("Success!\n") ;
- printf("Parsing robotdesc/pr2...") ;
+ printf("Parsing robot_description...") ;
fflush(stdout) ;
TiXmlDocument doc ;
doc.Parse(robot_desc.c_str()) ;
Modified: pkg/trunk/calibration/kinematic_calibration/src/arm_phasespace_grabber.cpp
===================================================================
--- pkg/trunk/calibration/kinematic_calibration/src/arm_phasespace_grabber.cpp 2009-07-22 18:57:21 UTC (rev 19419)
+++ pkg/trunk/calibration/kinematic_calibration/src/arm_phasespace_grabber.cpp 2009-07-22 19:02:34 UTC (rev 19420)
@@ -35,6 +35,7 @@
#include <stdio.h>
#include "ros/node.h"
+#include "ros/node_handle.h"
#include "boost/thread/mutex.hpp"
#include "mechanism_msgs/MechanismState.h"
#include "mocap_msgs/MocapSnapshot.h"
@@ -137,7 +138,14 @@
{
robot_kinematics::RobotKinematics robot_kinematics ;
string robot_desc ;
- param("robotdesc/pr2", robot_desc, string("")) ;
+
+ // hack: create a node handle to do a searchParam for robot_description
+ // to do this properly, switch to node handles api
+ ros::NodeHandle node_handle;
+ std::string pr2_urdf_param_name;
+ node_handle.searchParam("robot_description",pr2_urdf_param_name);
+
+ param(pr2_urdf_param_name, robot_desc, string("")) ;
printf("RobotDesc.length() = %u\n", (unsigned int)robot_desc.length()) ;
robot_kinematics.loadString(robot_desc.c_str()) ;
Modified: pkg/trunk/calibration/kinematic_calibration/src/run_chain_dumper.cpp
===================================================================
--- pkg/trunk/calibration/kinematic_calibration/src/run_chain_dumper.cpp 2009-07-22 18:57:21 UTC (rev 19419)
+++ pkg/trunk/calibration/kinematic_calibration/src/run_chain_dumper.cpp 2009-07-22 19:02:34 UTC (rev 19420)
@@ -33,6 +33,7 @@
#include <string>
#include "ros/node.h"
+#include "ros/node_handle.h"
#include "kinematic_calibration/chain_dumper.h"
#include "mechanism_model/robot.h"
#include "tinyxml/tinyxml.h"
@@ -50,7 +51,14 @@
fflush(stdout) ;
string robot_desc ;
bool success ;
- success = node.getParam("robotdesc/pr2", robot_desc) ;
+
+ // hack: create a node handle to do a searchParam for robot_description
+ // to do this properly, switch to node handles api
+ ros::NodeHandle node_handle;
+ std::string pr2_urdf_param_name;
+ node_handle.searchParam("robot_description",pr2_urdf_param_name);
+
+ success = node.getParam(pr2_urdf_param_name, robot_desc) ;
if (!success)
{
printf("ERROR: Could not access robot_desc/pr2 from param server\n") ;
@@ -69,7 +77,7 @@
{
bool success ;
- printf("Parsing robotdesc/pr2...") ;
+ printf("Parsing robot_description...") ;
fflush(stdout) ;
TiXmlDocument doc ;
doc.Parse(robot_desc.c_str()) ;
Modified: pkg/trunk/calibration/laser_cb_processing/src/pr2_tilt_laser_projector.cpp
===================================================================
--- pkg/trunk/calibration/laser_cb_processing/src/pr2_tilt_laser_projector.cpp 2009-07-22 18:57:21 UTC (rev 19419)
+++ pkg/trunk/calibration/laser_cb_processing/src/pr2_tilt_laser_projector.cpp 2009-07-22 19:02:34 UTC (rev 19420)
@@ -32,6 +32,7 @@
#include <string>
#include "ros/node.h"
+#include "ros/node_handle.h"
#include "robot_msgs/PointCloud.h"
#include "mechanism_model/robot.h"
@@ -56,7 +57,16 @@
ROS_DEBUG("Getting robot description from param server...") ;
string robot_desc ;
bool success ;
- success = node_->getParam("robotdesc/pr2", robot_desc) ;
+
+
+ // hack: create a node handle to do a searchParam for robot_description
+ // to do this properly, switch to node handles api
+ ros::NodeHandle node_handle;
+ std::string pr2_urdf_param_name;
+ node_handle.searchParam("robot_description",pr2_urdf_param_name);
+
+
+ success = node_->getParam(pr2_urdf_param_name, robot_desc) ;
if (!success)
{
ROS_ERROR("ERROR: Could not access robot_desc/pr2 from param server\n") ;
Modified: pkg/trunk/controllers/pr2_mechanism_controllers/src/base_controller.cpp
===================================================================
--- pkg/trunk/controllers/pr2_mechanism_controllers/src/base_controller.cpp 2009-07-22 18:57:21 UTC (rev 19419)
+++ pkg/trunk/controllers/pr2_mechanism_controllers/src/base_controller.cpp 2009-07-22 19:02:34 UTC (rev 19420)
@@ -36,6 +36,7 @@
#include <angles/angles.h>
#include <control_toolbox/filters.h>
#include "ros/node.h"
+#include "ros/node_handle.h"
#define NUM_TRANSFORMS 2
#define EPS 1e-5
@@ -207,14 +208,20 @@
robot_desc::URDF::Link *link;
std::string joint_name;
+ // hack: create a node handle to do a searchParam for robot_description
+ // to do this properly, switch to node handles api
+ ros::NodeHandle node_handle;
+ std::string pr2_urdf_param;
+ node_handle.searchParam("robot_description",pr2_urdf_param);
+
std::string xml_content;
- (ros::g_node)->getParam("robotdesc/pr2",xml_content);
+ (ros::g_node)->getParam(pr2_urdf_param,xml_content);
- // wait for robotdesc/pr2 on param server
+ // wait for robot_description on param server
while(!urdf_model_.loadString(xml_content.c_str()))
{
- ROS_WARN("base controller is waiting for robotdesc/pr2 in param server. run roslaunch send.xml or similar.");
- (ros::g_node)->getParam("robotdesc/pr2",xml_content);
+ ROS_WARN("base controller is waiting for robot_description in param server. run roslaunch send.xml or similar.");
+ (ros::g_node)->getParam("robot_description",xml_content);
usleep(100000);
}
Modified: pkg/trunk/controllers/pr2_mechanism_controllers/src/base_controller_pos.cpp
===================================================================
--- pkg/trunk/controllers/pr2_mechanism_controllers/src/base_controller_pos.cpp 2009-07-22 18:57:21 UTC (rev 19419)
+++ pkg/trunk/controllers/pr2_mechanism_controllers/src/base_controller_pos.cpp 2009-07-22 19:02:34 UTC (rev 19420)
@@ -38,6 +38,7 @@
#include <angles/angles.h>
#include <std_msgs/String.h>
#include "ros/node.h"
+#include "ros/node_handle.h"
#define NUM_TRANSFORMS 2
#define EPS 1e-5
@@ -167,16 +168,22 @@
robot_desc::URDF::Link *link;
std::string joint_name;
+ // hack: create a node handle to do a searchParam for robot_description
+ // to do this properly, switch to node handles api
+ ros::NodeHandle node_handle;
+ std::string pr2_urdf_param;
+ node_handle.searchParam("robot_description",pr2_urdf_param);
+
std::string xml_content;
- (ros::g_node)->getParam("robotdesc/pr2",xml_content);
+ (ros::g_node)->getParam(pr2_urdf_param,xml_content);
robot_state_ = robot_state;
- // wait for robotdesc/pr2 on param server
+ // wait for robot_description on param server
while(!urdf_model_.loadString(xml_content.c_str()))
{
- ROS_INFO("WARNING: base controller is waiting for robotdesc/pr2 in param server. run roslaunch send.xml or similar.");
- (ros::g_node)->getParam("robotdesc/pr2",xml_content);
+ ROS_INFO("WARNING: base controller is waiting for robot_description in param server. run roslaunch send.xml or similar.");
+ (ros::g_node)->getParam("robot_description",xml_content);
usleep(100000);
}
Modified: pkg/trunk/controllers/pr2_mechanism_controllers/src/pr2_arm_dynamics_controller.cpp
===================================================================
--- pkg/trunk/controllers/pr2_mechanism_controllers/src/pr2_arm_dynamics_controller.cpp 2009-07-22 18:57:21 UTC (rev 19419)
+++ pkg/trunk/controllers/pr2_mechanism_controllers/src/pr2_arm_dynamics_controller.cpp 2009-07-22 19:02:34 UTC (rev 19420)
@@ -38,6 +38,8 @@
#include "realtime_tools/realtime_publisher.h"
#include "std_msgs/String.h"
+#include "ros/node_handle.h"
+
// Math utils
#include <angles/angles.h>
@@ -343,8 +345,15 @@
std::string pr2Contents;
std::string pr2_uncompensated;
- node->getParam("robotdesc/pr2_uncompensated", pr2_uncompensated);
- node->getParam("robotdesc/pr2", pr2Contents);
+ // hack: create a node handle to do a searchParam for robot_description
+ // to do this properly, switch to node handles api
+ ros::NodeHandle node_handle;
+ std::string pr2_uncompensated_urdf_param_name;
+ node_handle.searchParam("robot_description_uncompensated",pr2_uncompensated_urdf_param_name);
+ node->getParam(pr2_uncompensated_urdf_param_name, pr2_uncompensated);
+ std::string pr2_urdf_param_name;
+ node_handle.searchParam("robot_description",pr2_urdf_param_name);
+ node->getParam(pr2_urdf_param_name, pr2Contents);
c_->pr2_kin_.loadString(pr2Contents.c_str());
c_->pr2_kin_uncompensated_.loadString(pr2_uncompensated.c_str());
Modified: pkg/trunk/demos/2dnav_gazebo/doc.dox
===================================================================
--- pkg/trunk/demos/2dnav_gazebo/doc.dox 2009-07-22 18:57:21 UTC (rev 19419)
+++ pkg/trunk/demos/2dnav_gazebo/doc.dox 2009-07-22 19:02:34 UTC (rev 19420)
@@ -26,7 +26,7 @@
<!-- start up robot -->
<include file="$(find pr2_gazebo)/pr2_simple.launch"/>
<!-- load map -->
- <node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/Media/materials/textures/map3.png 0.1" respawn="false" output="screen" />
+ <node pkg="map_server" type="map_server" args="$(find gazebo_worlds)/Media/materials/textures/map3.png 0.1" respawn="false" output="screen" />
<!-- Tug Arms For Navigation -->
<node pkg="pr2_mechanism_controllers" type="tuckarm.py" args="l" output="screen" />
<node pkg="pr2_mechanism_controllers" type="tuckarm.py" args="r" output="screen" />
Modified: pkg/trunk/demos/2dnav_gazebo/pr2-empty-amcl.launch
===================================================================
--- pkg/trunk/demos/2dnav_gazebo/pr2-empty-amcl.launch 2009-07-22 18:57:21 UTC (rev 19419)
+++ pkg/trunk/demos/2dnav_gazebo/pr2-empty-amcl.launch 2009-07-22 19:02:34 UTC (rev 19420)
@@ -11,7 +11,7 @@
<node pkg="pr2_mechanism_controllers" type="tuckarm.py" args="r" output="screen" />
<!-- load map -->
- <node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/Media/materials/textures/map_blank.png 0.1" respawn="true" machine="three" />
+ <node pkg="map_server" type="map_server" args="$(find gazebo_worlds)/Media/materials/textures/map_blank.png 0.1" respawn="true" machine="three" />
<!-- nav-stack -->
<include file="$(find 2dnav_gazebo)/2dnav-stack-amcl.launch"/>
Modified: pkg/trunk/demos/2dnav_gazebo/pr2-empty-fake_localization.launch
===================================================================
--- pkg/trunk/demos/2dnav_gazebo/pr2-empty-fake_localization.launch 2009-07-22 18:57:21 UTC (rev 19419)
+++ pkg/trunk/demos/2dnav_gazebo/pr2-empty-fake_localization.launch 2009-07-22 19:02:34 UTC (rev 19420)
@@ -11,7 +11,7 @@
<node pkg="pr2_mechanism_controllers" type="tuckarm.py" args="r" output="screen" />
<!-- load map -->
- <node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/Media/materials/textures/map_blank.png 0.1" respawn="true" machine="three" />
+ <node pkg="map_server" type="map_server" args="$(find gazebo_worlds)/Media/materials/textures/map_blank.png 0.1" respawn="true" machine="three" />
<!-- nav-stack -->
<include file="$(find 2dnav_gazebo)/2dnav-stack-fake_localization.launch"/>
Modified: pkg/trunk/demos/2dnav_gazebo/pr2-simple-fake_localization.launch
===================================================================
--- pkg/trunk/demos/2dnav_gazebo/pr2-simple-fake_localization.launch 2009-07-22 18:57:21 UTC (rev 19419)
+++ pkg/trunk/demos/2dnav_gazebo/pr2-simple-fake_localization.launch 2009-07-22 19:02:34 UTC (rev 19420)
@@ -10,7 +10,7 @@
<node pkg="pr2_mechanism_controllers" type="tuckarm.py" args="b" output="screen" />
<!-- load map -->
- <node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/Media/materials/textures/map3.png 0.1" respawn="true" machine="three" />
+ <node pkg="map_server" type="map_server" args="$(find gazebo_worlds)/Media/materials/textures/map3.png 0.1" respawn="true" machine="three" />
<!-- nav-stack -->
<include file="$(find 2dnav_gazebo)/2dnav-stack-fake_localization.launch"/>
Modified: pkg/trunk/demos/2dnav_gazebo/pr2-wg-amcl.launch
===================================================================
--- pkg/trunk/demos/2dnav_gazebo/pr2-wg-amcl.launch 2009-07-22 18:57:21 UTC (rev 19419)
+++ pkg/trunk/demos/2dnav_gazebo/pr2-wg-amcl.launch 2009-07-22 19:02:34 UTC (rev 19420)
@@ -7,7 +7,7 @@
<include file="$(find pr2_gazebo)/pr2.launch"/>
<!-- load map -->
- <node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/Media/materials/textures/willowMap.png 0.1" respawn="true" machine="three" />
+ <node pkg="map_server" type="map_server" args="$(find gazebo_worlds)/Media/materials/textures/willowMap.png 0.1" respawn="true" machine="three" />
<!-- Tug Arms For Navigation -->
<node pkg="pr2_mechanism_controllers" type="tuckarm.py" args="l" output="screen" />
Modified: pkg/trunk/demos/2dnav_gazebo/prototype1-simple-amcl.launch
===================================================================
--- pkg/trunk/demos/2dnav_gazebo/prototype1-simple-amcl.launch 2009-07-22 18:57:21 UTC (rev 19419)
+++ pkg/trunk/demos/2dnav_gazebo/prototype1-simple-amcl.lau...
[truncated message content] |
|
From: <stu...@us...> - 2009-07-22 21:38:09
|
Revision: 19440
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19440&view=rev
Author: stuglaser
Date: 2009-07-22 21:38:04 +0000 (Wed, 22 Jul 2009)
Log Message:
-----------
Experimental controllers package
Modified Paths:
--------------
pkg/trunk/controllers/robot_mechanism_controllers/CMakeLists.txt
Added Paths:
-----------
pkg/trunk/sandbox/experimental_controllers/
pkg/trunk/sandbox/experimental_controllers/CMakeLists.txt
pkg/trunk/sandbox/experimental_controllers/Makefile
pkg/trunk/sandbox/experimental_controllers/include/
pkg/trunk/sandbox/experimental_controllers/include/experimental_controllers/
pkg/trunk/sandbox/experimental_controllers/include/experimental_controllers/plug_controller.h
pkg/trunk/sandbox/experimental_controllers/mainpage.dox
pkg/trunk/sandbox/experimental_controllers/manifest.xml
pkg/trunk/sandbox/experimental_controllers/msg/
pkg/trunk/sandbox/experimental_controllers/msg/PlugInternalState.msg
pkg/trunk/sandbox/experimental_controllers/src/
pkg/trunk/sandbox/experimental_controllers/src/plug_controller.cpp
Removed Paths:
-------------
pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/plug_controller.h
pkg/trunk/controllers/robot_mechanism_controllers/msg/PlugInternalState.msg
pkg/trunk/controllers/robot_mechanism_controllers/src/plug_controller.cpp
Modified: pkg/trunk/controllers/robot_mechanism_controllers/CMakeLists.txt
===================================================================
--- pkg/trunk/controllers/robot_mechanism_controllers/CMakeLists.txt 2009-07-22 21:37:16 UTC (rev 19439)
+++ pkg/trunk/controllers/robot_mechanism_controllers/CMakeLists.txt 2009-07-22 21:38:04 UTC (rev 19440)
@@ -6,7 +6,6 @@
genmsg()
gensrv()
set(_srcs
- src/plug_controller.cpp
src/cartesian_tff_controller.cpp
src/cartesian_trajectory_controller.cpp
src/cartesian_pose_controller.cpp
Deleted: pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/plug_controller.h
===================================================================
--- pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/plug_controller.h 2009-07-22 21:37:16 UTC (rev 19439)
+++ pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/plug_controller.h 2009-07-22 21:38:04 UTC (rev 19440)
@@ -1,182 +0,0 @@
-/*
- * Copyright (c) 2008, Willow Garage, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of the Willow Garage, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Author: Melonee Wise
- */
-
-#ifndef PLUG_CONTROLLER_H
-#define PLUG_CONTROLLER_H
-
-#include <vector>
-#include "boost/scoped_ptr.hpp"
-#include "mechanism_model/chain.h"
-#include "kdl/chain.hpp"
-#include "kdl/frames.hpp"
-#include "kdl/chainfksolver.hpp"
-#include "ros/node.h"
-#include "robot_msgs/Wrench.h"
-#include "robot_msgs/PoseStamped.h"
-#include "robot_msgs/Transform.h"
-#include "robot_mechanism_controllers/PlugInternalState.h"
-#include "robot_srvs/SetPoseStamped.h"
-#include "control_toolbox/pid.h"
-#include "misc_utils/subscription_guard.h"
-#include "mechanism_model/controller.h"
-#include "tf/transform_datatypes.h"
-#include "tf/transform_listener.h"
-#include "misc_utils/advertised_service_guard.h"
-#include "realtime_tools/realtime_publisher.h"
-
-#include "Eigen/Geometry"
-#include "Eigen/LU"
-#include "Eigen/Core"
-
-#include <visualization_msgs/Marker.h>
-
-
-namespace controller {
-
-class PlugController : public Controller
-{
-public:
- EIGEN_MAKE_ALIGNED_OPERATOR_NEW;
- PlugController();
- ~PlugController();
-
- bool initXml(mechanism::RobotState *robot, TiXmlElement *config);
- void update();
- void computeConstraintJacobian();
- void computeConstraintNullSpace();
-
- void setToolOffset(const tf::Transform &);
-
- std::string root_name_;
-
- // input of the controller
- KDL::Wrench wrench_desi_;
- Eigen::Matrix<float,6,1> task_wrench_;
- Eigen::Vector3f outlet_pt_;
- Eigen::Vector3f outlet_norm_; // this must be normalized
-
- KDL::Frame endeffector_frame_;
- KDL::Frame desired_frame_;
-
- mechanism::Chain chain_;
- KDL::Chain kdl_chain_;
-
- double dist_to_line_;
- double f_r_;
- double f_roll_;
- double f_pitch_;
- double f_yaw_;
- KDL::Twist pose_error_;
-
-private:
-
- mechanism::RobotState *robot_;
- std::string controller_name_;
- boost::scoped_ptr<KDL::ChainJntToJacSolver> jnt_to_jac_solver_;
- boost::scoped_ptr<KDL::ChainFkSolverPos> jnt_to_pose_solver_;
-
- // to get joint positions, velocities, and to set joint torques
- Eigen::Matrix<float,6,5> constraint_jac_;
- Eigen::Matrix<float,6,1> constraint_wrench_;
- Eigen::Matrix<float,5,1> constraint_force_;
- // joint constraint
- Eigen::MatrixXf joint_constraint_force_;
- Eigen::MatrixXf joint_constraint_jac_;
- Eigen::MatrixXf joint_constraint_null_space_;
-
- Eigen::MatrixXf task_jac_;
- Eigen::MatrixXf identity_;
- Eigen::MatrixXf identity_joint_;
- Eigen::MatrixXf constraint_null_space_;
- Eigen::MatrixXf constraint_torq_;
- Eigen::MatrixXf joint_constraint_torq_;
- Eigen::MatrixXf task_torq_;
-
- // some parameters to define the constraint
-
- double upper_arm_limit;
- double upper_arm_dead_zone;
- double f_r_max;
- double f_pose_max;
- double f_limit_max;
- double last_time_;
- bool initialized_;
-
-
-
-
- control_toolbox::Pid roll_pid_; /**< Internal PID controller. */
- control_toolbox::Pid pitch_pid_; /**< Internal PID controller. */
- control_toolbox::Pid yaw_pid_; /**< Internal PID controller. */
- control_toolbox::Pid line_pid_; /**< Internal PID controller. */
-};
-
-
-class PlugControllerNode : public Controller
-{
- public:
- EIGEN_MAKE_ALIGNED_OPERATOR_NEW;
-
- PlugControllerNode();
- ~PlugControllerNode();
-
- bool initXml(mechanism::RobotState *robot, TiXmlElement *config);
- void update();
- void command();
- void outletPose();
-
- bool setToolFrame(robot_srvs::SetPoseStamped::Request &req,
- robot_srvs::SetPoseStamped::Response &resp);
-
- private:
- std::string topic_;
- ros::Node *node_;
- PlugController controller_;
- SubscriptionGuard guard_command_;
- SubscriptionGuard guard_outlet_pose_;
- AdvertisedServiceGuard guard_set_tool_frame_;
-
- robot_msgs::Wrench wrench_msg_;
- robot_msgs::PoseStamped outlet_pose_msg_;
- unsigned int loop_count_;
-
- tf::TransformListener TF; /**< The transform for converting from point to head and tilt frames. */
- realtime_tools::RealtimePublisher <robot_msgs::Transform>* current_frame_publisher_;
- realtime_tools::RealtimePublisher <robot_mechanism_controllers::PlugInternalState>* internal_state_publisher_;
-
-};
-
-} // namespace
-
-
-#endif
Deleted: pkg/trunk/controllers/robot_mechanism_controllers/msg/PlugInternalState.msg
===================================================================
--- pkg/trunk/controllers/robot_mechanism_controllers/msg/PlugInternalState.msg 2009-07-22 21:37:16 UTC (rev 19439)
+++ pkg/trunk/controllers/robot_mechanism_controllers/msg/PlugInternalState.msg 2009-07-22 21:38:04 UTC (rev 19440)
@@ -1,9 +0,0 @@
-float64 line_error
-float64 line_force_cmd
-float64 roll_error
-float64 roll_force_cmd
-float64 pitch_error
-float64 pitch_force_cmd
-float64 yaw_error
-float64 yaw_force_cmd
-
Deleted: pkg/trunk/controllers/robot_mechanism_controllers/src/plug_controller.cpp
===================================================================
--- pkg/trunk/controllers/robot_mechanism_controllers/src/plug_controller.cpp 2009-07-22 21:37:16 UTC (rev 19439)
+++ pkg/trunk/controllers/robot_mechanism_controllers/src/plug_controller.cpp 2009-07-22 21:38:04 UTC (rev 19440)
@@ -1,499 +0,0 @@
-/*
- * Copyright (c) 2008, Willow Garage, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of the Willow Garage, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Author: Melonee Wise
- */
-#include "robot_mechanism_controllers/plug_controller.h"
-#include <algorithm>
-#include "angles/angles.h"
-#include "urdf/parser.h"
-#include "tf_conversions/tf_kdl.h"
-#include "kdl/chainfksolverpos_recursive.hpp"
-#include "kdl/chainjnttojacsolver.hpp"
-
-#define DEBUG 0 // easy debugging
-
-static const double JOYSTICK_MAX_FORCE = 20.0;
-static const double JOYSTICK_MAX_TORQUE = 0.75;
-
-
-using namespace KDL;
-
-namespace controller {
-
-ROS_REGISTER_CONTROLLER(PlugController)
-
-PlugController::PlugController() :
- outlet_pt_(1, 0, 0),
- outlet_norm_(1,0,0),
- jnt_to_jac_solver_(NULL),
- jnt_to_pose_solver_(NULL),
- initialized_(false)
-{
- constraint_jac_.setZero();
- constraint_wrench_.setZero();
- constraint_force_.setZero();
- printf("PlugController constructor\n");
-}
-
-
-
-PlugController::~PlugController()
-{
-}
-
-
-
-bool PlugController::initXml(mechanism::RobotState *robot, TiXmlElement *config)
-{
- assert(robot);
- robot_ = robot;
-
- controller_name_ = config->Attribute("name");
-
- TiXmlElement *chain = config->FirstChildElement("chain");
- if (!chain) {
- ROS_ERROR("PlugController was not given a chain");
- return false;
- }
-
- // Gets names for the root and tip of the chain
- const char *tip_name = chain->Attribute("tip");
- if (!chain->Attribute("root")) {
- ROS_ERROR("Chain element for PlugController must specify the root");
- return false;
- }
- if (!tip_name) {
- ROS_ERROR("Chain element for PlugController must specify the tip");
- return false;
- }
-
- root_name_ = chain->Attribute("root");
- if (!chain_.init(robot->model_, root_name_, tip_name))
- return false;
- chain_.toKDL(kdl_chain_);
-
- // some parameters
- ros::Node *node = ros::Node::instance();
- assert(node);
-
- node->param(controller_name_+"/upper_arm_limit" , upper_arm_limit , -1.52 ) ; /// upper arm pose limit
-
- node->param(controller_name_+"/f_r_max" , f_r_max , 150.0) ; /// max radial force of line constraint
- node->param(controller_name_+"/f_pose_max" , f_pose_max , 40.0) ; /// max pose force
- node->param(controller_name_+"/f_limit_max" , f_limit_max , 100.0) ; /// max upper arm limit force
- node->param(controller_name_+"/upper_arm_dead_zone", upper_arm_dead_zone, 0.05);
-
- roll_pid_.initParam(controller_name_+"/pose_pid");
- pitch_pid_.initParam(controller_name_+"/pose_pid");
- yaw_pid_.initParam(controller_name_+"/pose_pid");
- line_pid_.initParam(controller_name_+"/line_pid");
- last_time_ = robot->model_->hw_->current_time_;
-
-
- // Constructs solvers and allocates matrices.
- unsigned int num_joints = kdl_chain_.getNrOfJoints();
- jnt_to_jac_solver_.reset(new ChainJntToJacSolver(kdl_chain_));
- jnt_to_pose_solver_.reset(new ChainFkSolverPos_recursive(kdl_chain_));
- task_jac_ = Eigen::MatrixXf::Zero(6, num_joints);
- identity_ = Eigen::MatrixXf::Identity(6, 6);
- identity_joint_ = Eigen::MatrixXf::Identity(num_joints, num_joints);
- constraint_null_space_ = Eigen::MatrixXf::Zero(6, 6);
- joint_constraint_force_= Eigen::MatrixXf::Zero(num_joints, 1);
- joint_constraint_jac_= Eigen::MatrixXf::Zero(num_joints, 1);
- joint_constraint_null_space_ = Eigen::MatrixXf::Zero(num_joints, num_joints);
- constraint_torq_ = Eigen::MatrixXf::Zero(num_joints, 1);
- task_torq_ = Eigen::MatrixXf::Zero(num_joints, 1);
- task_wrench_ = Eigen::Matrix<float,6,1>::Zero();
-
- // Sets desired wrench to 0
- for (unsigned int i=0; i<6; i++){
- task_wrench_(i) = 0;
- }
-
- return true;
-}
-
-
-void PlugController::update()
-{
- if (!chain_.allCalibrated(robot_->joint_states_))
- return;
-
- // Gets the joint positions
- JntArray jnt_pos(kdl_chain_.getNrOfJoints());
- chain_.getPositions(robot_->joint_states_, jnt_pos);
-
- // Grabs the inital pose of the robot for testing...
- if(!initialized_)
- {
- jnt_to_pose_solver_->JntToCart(jnt_pos, desired_frame_);
- for (unsigned int i = 0; i < 3; ++i)
- outlet_pt_[i] = desired_frame_.p[i];
- initialized_ = true;
- }
-
- Jacobian jacobian(kdl_chain_.getNrOfJoints(), kdl_chain_.getNrOfSegments());
- jnt_to_jac_solver_->JntToJac(jnt_pos, jacobian);
-
- // TODO: Write a function for doing this conversion
- //convert to eigen for easier math
- for (unsigned int i = 0; i < 6; i++)
- {
- for (unsigned int j = 0; j < kdl_chain_.getNrOfJoints(); j++)
- {
- task_jac_(i,j) = jacobian(i,j);
- }
- }
-
- // get endeffector pose
- jnt_to_pose_solver_->JntToCart(jnt_pos, endeffector_frame_);
-
- // compute the constraint jacobian and the constraint force
- computeConstraintJacobian();
-
- // compute the constraint wrench to apply
- constraint_wrench_ = constraint_jac_ * constraint_force_;
-
- // compute the constraint null space to project
- computeConstraintNullSpace();
-
- // convert the wrench into joint torques
- joint_constraint_torq_ = joint_constraint_force_;
- constraint_torq_ = joint_constraint_null_space_ * task_jac_.transpose() * constraint_wrench_;
- task_torq_ = joint_constraint_null_space_ * task_jac_.transpose() * constraint_null_space_ * task_wrench_;
-
-
-
- JntArray jnt_eff(kdl_chain_.getNrOfJoints());
- for (unsigned int i = 0; i < kdl_chain_.getNrOfJoints(); ++i)
- jnt_eff(i) = joint_constraint_torq_(i) + constraint_torq_(i) + task_torq_(i);
- if (jnt_eff.rows() != 7)
- ROS_ERROR("Wrong number of joint effort elements: %d", jnt_eff.rows());
- else
- chain_.setEfforts(jnt_eff, robot_->joint_states_);
-}
-
-
-void PlugController::computeConstraintJacobian()
-{
- double time = robot_->model_->hw_->current_time_;
- // Clear force vector
- f_r_ = 0;
- f_roll_ = 0;
- f_pitch_ = 0;
- f_yaw_ = 0;
-
- // this will be computed based on the tool position in space
- constraint_jac_(0,0) = 0; // line constraint
- constraint_jac_(1,0) = 0; // line constraint
- constraint_jac_(2,0) = 0; // line constraint
- constraint_jac_(0,1) = 0; // line constraint
- constraint_jac_(1,1) = 0; // line constraint
- constraint_jac_(2,1) = 0; // line constraint
- // the pose constraint is always on
- constraint_jac_(3,2) = 1; // roll
- constraint_jac_(4,3) = 1; // pitch
- constraint_jac_(5,4) = 1; // yaw
-
- joint_constraint_jac_(2) = 0;
-
- // put the end_effector point into eigen
- Eigen::Vector3f end_effector_pt(endeffector_frame_.p(0), endeffector_frame_.p(1), endeffector_frame_.p(2));
-
- // Vector from the outlet to the end effector position
- Eigen::Vector3f v = end_effector_pt - outlet_pt_;
-
- // Vector from the end effector position to (the closest point on ) the line constraint.
- Eigen::Vector3f r_to_line = v.dot(outlet_norm_) * outlet_norm_ - v;
- Eigen::Vector3f other_norm = r_to_line.cross(outlet_norm_);
- other_norm = other_norm.normalized();
- dist_to_line_ = r_to_line.norm();
- r_to_line = r_to_line.normalized();
-
- // update the jacobian for the line constraint
- if (dist_to_line_ > 0.1)
- {
- constraint_jac_(0,0) = r_to_line(0);
- constraint_jac_(1,0) = r_to_line(1);
- constraint_jac_(2,0) = r_to_line(2);
- constraint_jac_(0,1) = other_norm(0);
- constraint_jac_(1,1) = other_norm(1);
- constraint_jac_(2,1) = other_norm(2);
- f_r_ = line_pid_.updatePid(-dist_to_line_, time-last_time_);
- if (fabs(f_r_) > f_r_max)
- f_r_ = f_r_max * f_r_ / fabs(f_r_);
- }
- else
- {
- f_r_ = 0;
- }
-
- // compute the pose error using a twist
- pose_error_ = diff(endeffector_frame_, desired_frame_);
-
- //roll constraint
- if (fabs(pose_error_(3)) > 0)
- {
- f_roll_ = roll_pid_.updatePid(-pose_error_(3), time-last_time_);
- if (fabs(f_roll_) > f_pose_max)
- f_roll_ = f_pose_max * f_roll_ / fabs(f_roll_);
- }
- else
- {
- f_roll_ = 0;
- }
-
- //pitch constraint
- if (fabs(pose_error_(4)) > 0)
- {
- f_pitch_ = pitch_pid_.updatePid(-pose_error_(4), time-last_time_);
- if (fabs(f_pitch_) > f_pose_max)
- f_pitch_ = f_pose_max * f_pitch_ / fabs(f_pitch_);
- }
- else
- {
- f_pitch_ = 0;
- }
-
- //yaw constraint
- if (fabs(pose_error_(5)) > 0)
- {
- f_yaw_ = yaw_pid_.updatePid(-pose_error_(5), time-last_time_);
- if (fabs(f_yaw_) > f_pose_max)
- f_yaw_ = f_pose_max * f_yaw_ / fabs(f_yaw_);
- }
- else
- {
- f_yaw_ = 0;
- }
-
-
- //joint constraint force - stop the upper arm from going past -90 degrees (1.57 rad)
- JntArray jnt_pos(kdl_chain_.getNrOfJoints());
- chain_.getPositions(robot_->joint_states_, jnt_pos);
-
- double joint_e = angles::shortest_angular_distance(jnt_pos(2), upper_arm_limit);
- if(joint_e < upper_arm_dead_zone)
- {
- joint_constraint_jac_(2) = 0;//1;
- }
-
- if(joint_e < 0)
- {
- joint_constraint_force_(2) =0;// joint_e * f_limit_max;
- }
- else
- {
- joint_constraint_force_(2) = 0;
- }
-
- constraint_force_(0) = f_r_;
- constraint_force_(1) = 0;
- constraint_force_(2) = f_roll_;
- constraint_force_(3) = f_pitch_;
- constraint_force_(4) = f_yaw_;
- last_time_ = time;
-}
-
-void PlugController::computeConstraintNullSpace()
-{
- // Compute generalized inverse, this is the transpose as long as the constraints are
- // orthonormal to eachother. Will replace with QR method later.
- constraint_null_space_ = identity_ - constraint_jac_ * constraint_jac_.transpose();
- joint_constraint_null_space_ = identity_joint_ - joint_constraint_jac_ * joint_constraint_jac_.transpose();
-
-}
-
-void PlugController::setToolOffset(const tf::Transform &tool_offset)
-{
- KDL::Chain new_kdl_chain;
- chain_.toKDL(new_kdl_chain);
-
- KDL::Frame tool_frame;
- tf::TransformTFToKDL(tool_offset, tool_frame);
- new_kdl_chain.addSegment(KDL::Segment("ToolOffset", KDL::Joint("ToolOffset", KDL::Joint::None), tool_frame));
-
- kdl_chain_ = new_kdl_chain;
-
- jnt_to_jac_solver_.reset(new ChainJntToJacSolver(kdl_chain_));
- jnt_to_pose_solver_.reset(new ChainFkSolverPos_recursive(kdl_chain_));
-}
-
-
-
-ROS_REGISTER_CONTROLLER(PlugControllerNode)
-
-
-PlugControllerNode::PlugControllerNode()
-: node_(ros::Node::instance()), loop_count_(0), TF(*ros::Node::instance(),false,ros::Duration(10.0))
-{
- current_frame_publisher_=NULL;
- internal_state_publisher_=NULL;
-}
-
-
-PlugControllerNode::~PlugControllerNode()
-{
- current_frame_publisher_->stop();
- delete current_frame_publisher_;
- internal_state_publisher_->stop();
- delete internal_state_publisher_;
-}
-
-bool PlugControllerNode::initXml(mechanism::RobotState *robot, TiXmlElement *config)
-{
- // get name of topic to listen to from xml file
- topic_ = config->Attribute("name") ? config->Attribute("name") : "";
- if (topic_ == "") {
- fprintf(stderr, "No name given to PlugControllerNode\n");
- return false;
- }
-
- // initialize controller
- if (!controller_.initXml(robot, config))
- return false;
-
- assert(node_);
- // subscribe to wrench commands
- node_->subscribe(topic_ + "/command", wrench_msg_,
- &PlugControllerNode::command, this, 1);
- guard_command_.set(topic_ + "/command");
- // subscribe to outlet pose commands
- node_->subscribe(topic_ + "/outlet_pose", outlet_pose_msg_,
- &PlugControllerNode::outletPose, this, 1);
- guard_outlet_pose_.set(topic_ + "/outlet_pose");
-
- if (current_frame_publisher_ != NULL)// Make sure that we don't memory leak if initXml gets called twice
- delete current_frame_publisher_ ;
- current_frame_publisher_ = new realtime_tools::RealtimePublisher <robot_msgs::Transform> (topic_ + "/transform", 1) ;
-
- if (internal_state_publisher_ != NULL)// Make sure that we don't memory leak if initXml gets called twice
- delete internal_state_publisher_ ;
- internal_state_publisher_ = new realtime_tools::RealtimePublisher <robot_mechanism_controllers::PlugInternalState> (topic_ + "/internal_state", 1) ;
-
- node_->advertiseService(topic_ + "/set_tool_frame", &PlugControllerNode::setToolFrame, this);
- guard_set_tool_frame_.set(topic_ + "/set_tool_frame");
-
- return true;
-}
-
-
-void PlugControllerNode::update()
-{
- controller_.update();
-
- static int count =0;
- if (count % 100 == 0)
- {
- if (current_frame_publisher_->trylock())
- {
- tf::Transform transform;
- tf::TransformKDLToTF(controller_.endeffector_frame_, transform);
- tf::transformTFToMsg(transform, current_frame_publisher_->msg_);
- current_frame_publisher_->unlockAndPublish() ;
- }
- if (internal_state_publisher_->trylock())
- {
- internal_state_publisher_->msg_.line_error = controller_.dist_to_line_;
- internal_state_publisher_->msg_.line_force_cmd = controller_.f_r_;
- internal_state_publisher_->msg_.roll_error = controller_.pose_error_(3);
- internal_state_publisher_->msg_.roll_force_cmd = controller_.f_roll_;
- internal_state_publisher_->msg_.pitch_error = controller_.pose_error_(4);
- internal_state_publisher_->msg_.pitch_force_cmd = controller_.f_pitch_;
- internal_state_publisher_->msg_.yaw_error = controller_.pose_error_(5);
- internal_state_publisher_->msg_.yaw_force_cmd = controller_.f_yaw_;
- internal_state_publisher_->unlockAndPublish() ;
- }
- }
-
-}
-
-void PlugControllerNode::outletPose()
-{
- robot_msgs::PoseStamped outlet_in_root_;
- try
- {
- TF.transformPose(controller_.root_name_, outlet_pose_msg_, outlet_in_root_);
- }
- catch(tf::TransformException& ex)
- {
- ROS_WARN("Transform Exception %s", ex.what());
- return;
- }
- tf::Pose outlet;
- tf::poseMsgToTF(outlet_in_root_.pose, outlet);
-
- controller_.outlet_pt_(0) = outlet.getOrigin().x();
- controller_.outlet_pt_(1) = outlet.getOrigin().y();
- controller_.outlet_pt_(2) = outlet.getOrigin().z();
-
- tf::Vector3 norm = quatRotate(outlet.getRotation(), tf::Vector3(1.0, 0.0, 0.0));
- controller_.outlet_norm_(0) = norm.x();
- controller_.outlet_norm_(1) = norm.y();
- controller_.outlet_norm_(2) = norm.z();
-
- tf::TransformTFToKDL(outlet, controller_.desired_frame_);
-}
-
-void PlugControllerNode::command()
-{
- // convert to wrench command
- controller_.task_wrench_(0) = wrench_msg_.force.x;
- controller_.task_wrench_(1) = wrench_msg_.force.y;
- controller_.task_wrench_(2) = wrench_msg_.force.z;
- controller_.task_wrench_(3) = wrench_msg_.torque.x;
- controller_.task_wrench_(4) = wrench_msg_.torque.y;
- controller_.task_wrench_(5) = wrench_msg_.torque.z;
-
-}
-
-bool PlugControllerNode::setToolFrame(robot_srvs::SetPoseStamped::Request &req,
- robot_srvs::SetPoseStamped::Response &resp)
-{
- robot_msgs::PoseStamped tool_offset_msg;
- try
- {
- //TF.transformPose(controller_.chain_.getLinkName(), req.p, tool_offset_msg);
- TF.transformPose(controller_.kdl_chain_.getSegment(controller_.kdl_chain_.getNrOfSegments()-1).getName(), req.p, tool_offset_msg);
- }
- catch(tf::TransformException& ex)
- {
- ROS_WARN("Transform Exception %s", ex.what());
- return true;
- }
-
- tf::Transform tool_offset;
- tf::poseMsgToTF(tool_offset_msg.pose, tool_offset);
- controller_.setToolOffset(tool_offset);
- return true;
-}
-
-}; // namespace
Added: pkg/trunk/sandbox/experimental_controllers/CMakeLists.txt
===================================================================
--- pkg/trunk/sandbox/experimental_controllers/CMakeLists.txt (rev 0)
+++ pkg/trunk/sandbox/experimental_controllers/CMakeLists.txt 2009-07-22 21:38:04 UTC (rev 19440)
@@ -0,0 +1,27 @@
+cmake_minimum_required(VERSION 2.4.6)
+include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
+
+# Set the build type. Options are:
+# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage
+# Debug : w/ debug symbols, w/o optimization
+# Release : w/o debug symbols, w/ optimization
+# RelWithDebInfo : w/ debug symbols, w/ optimization
+# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries
+#set(ROS_BUILD_TYPE RelWithDebInfo)
+
+rospack(experimental_controllers)
+
+#set the default path for built executables to the "bin" directory
+set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
+#set the default path for built libraries to the "lib" directory
+set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
+
+#uncomment if you have defined messages
+genmsg()
+#uncomment if you have defined services
+gensrv()
+
+rospack_add_library(experimental_controllers
+ src/plug_controller.cpp
+)
+target_link_libraries(experimental_controllers ltdl)
Added: pkg/trunk/sandbox/experimental_controllers/Makefile
===================================================================
--- pkg/trunk/sandbox/experimental_controllers/Makefile (rev 0)
+++ pkg/trunk/sandbox/experimental_controllers/Makefile 2009-07-22 21:38:04 UTC (rev 19440)
@@ -0,0 +1 @@
+include $(shell rospack find mk)/cmake.mk
\ No newline at end of file
Copied: pkg/trunk/sandbox/experimental_controllers/include/experimental_controllers/plug_controller.h (from rev 19438, pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/plug_controller.h)
===================================================================
--- pkg/trunk/sandbox/experimental_controllers/include/experimental_controllers/plug_controller.h (rev 0)
+++ pkg/trunk/sandbox/experimental_controllers/include/experimental_controllers/plug_controller.h 2009-07-22 21:38:04 UTC (rev 19440)
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2008, Willow Garage, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Willow Garage, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Author: Melonee Wise
+ */
+
+#ifndef PLUG_CONTROLLER_H
+#define PLUG_CONTROLLER_H
+
+#include <vector>
+#include "boost/scoped_ptr.hpp"
+#include "mechanism_model/chain.h"
+#include "kdl/chain.hpp"
+#include "kdl/frames.hpp"
+#include "kdl/chainfksolver.hpp"
+#include "ros/node.h"
+#include "robot_msgs/Wrench.h"
+#include "robot_msgs/PoseStamped....
[truncated message content] |
|
From: <tf...@us...> - 2009-07-22 22:44:05
|
Revision: 19458
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19458&view=rev
Author: tfoote
Date: 2009-07-22 22:44:00 +0000 (Wed, 22 Jul 2009)
Log Message:
-----------
removing all references to sysdeps from manifests to keep people from using the wrong system
Modified Paths:
--------------
pkg/trunk/3rdparty/nepumuk/manifest.xml
pkg/trunk/3rdparty/neven/manifest.xml
pkg/trunk/3rdparty/ocl/manifest.xml
pkg/trunk/3rdparty/octave_forge/manifest.xml
pkg/trunk/3rdparty/player/manifest.xml
pkg/trunk/3rdparty/python-twitter/manifest.xml
pkg/trunk/3rdparty/wxpropgrid/manifest.xml
pkg/trunk/audio/audio_capture/manifest.xml
pkg/trunk/audio/sound_play/manifest.xml
pkg/trunk/controllers/qualification_controllers/dynamic_verification_controllers/manifest.xml
pkg/trunk/controllers/qualification_controllers/joint_qualification_controllers/manifest.xml
pkg/trunk/controllers/robot_mechanism_controllers/manifest.xml
pkg/trunk/drivers/cam/axis_cam/manifest.xml
pkg/trunk/drivers/cam/camera_focus/manifest.xml
pkg/trunk/drivers/network/wifi_ddwrt/manifest.xml
pkg/trunk/drivers/phase_space/manifest.xml
pkg/trunk/drivers/simulator/gazebo_plugin/manifest.xml
pkg/trunk/drivers/simulator/test_pr2_sensors_gazebo/manifest.xml
pkg/trunk/drivers/ups/apcupsd_node/manifest.xml
pkg/trunk/motion_planning/mpbench/manifest.xml
pkg/trunk/openrave_planning/openrave/manifest.xml
pkg/trunk/openrave_planning/soqt/manifest.xml
pkg/trunk/pr2/dynamic_verification/manifest.xml
pkg/trunk/pr2/motorconf_gui/manifest.xml
pkg/trunk/pr2/qualification/manifest.xml
pkg/trunk/sandbox/lifelong_mapping/manifest.xml
pkg/trunk/sandbox/trex_gui/manifest.xml
pkg/trunk/stacks/camera_drivers/dcam/manifest.xml
pkg/trunk/stacks/camera_drivers/libdc1394v2/manifest.xml
pkg/trunk/stacks/estimation/bfl/manifest.xml
pkg/trunk/stacks/geometry/bullet/manifest.xml
pkg/trunk/stacks/geometry/kdl/manifest.xml
pkg/trunk/stacks/geometry/tf/manifest.xml
pkg/trunk/stacks/hardware_test/diagnostic_test/manifest.xml
pkg/trunk/stacks/hardware_test/runtime_monitor/manifest.xml
pkg/trunk/stacks/nav/map_server/manifest.xml
pkg/trunk/stacks/nav/navfn/manifest.xml
pkg/trunk/stacks/opencv/opencv_latest/manifest.xml
pkg/trunk/stacks/simulators/gazebo/manifest.xml
pkg/trunk/stacks/simulators/opende/manifest.xml
pkg/trunk/stacks/simulators/stage/manifest.xml
pkg/trunk/stacks/stereo/stereo_utils/manifest.xml
pkg/trunk/stacks/trex/trex/manifest.xml
pkg/trunk/stacks/visual_feature_detectors/calonder_descriptor/manifest.xml
pkg/trunk/stacks/visual_feature_detectors/outlet_detection/manifest.xml
pkg/trunk/stacks/visual_feature_detectors/star_detector/manifest.xml
pkg/trunk/stacks/visualization/pr2_dashboard/manifest.xml
pkg/trunk/stacks/visualization/rviz/manifest.xml
pkg/trunk/stacks/visualization_core/freeimage/manifest.xml
pkg/trunk/stacks/visualization_core/ogre/manifest.xml
pkg/trunk/stacks/visualization_core/ogre_tools/manifest.xml
pkg/trunk/util/or_robot_self_filter/manifest.xml
pkg/trunk/vision/image_synthesizer/manifest.xml
pkg/trunk/vision/jpeg/manifest.xml
pkg/trunk/vision/people/manifest.xml
pkg/trunk/vision/place_recognition/manifest.xml
pkg/trunk/vision/visual_odometry/manifest.xml
pkg/trunk/vision/vslam/manifest.xml
pkg/trunk/vision/vslam_demo/manifest.xml
Modified: pkg/trunk/3rdparty/nepumuk/manifest.xml
===================================================================
--- pkg/trunk/3rdparty/nepumuk/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/3rdparty/nepumuk/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -12,10 +12,6 @@
<depend package="roscpp"/>
<depend package="std_msgs"/>
<depend package="libsunflower"/>
- <sysdepend os="debian" version="4.0-etch" package="libpng12-dev"/>
- <sysdepend os="debian" version="4.0-etch" package="autoconf"/>
- <sysdepend os="debian" version="4.0-etch" package="automake"/>
- <sysdepend os="debian" version="4.0-etch" package="libtool"/>
<rosdep name="automake"/>
<rosdep name="autoconf"/>
<rosdep name="libtool"/>
Modified: pkg/trunk/3rdparty/neven/manifest.xml
===================================================================
--- pkg/trunk/3rdparty/neven/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/3rdparty/neven/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -10,8 +10,6 @@
<doxymaker external="http://android.git.kernel.org/?p=platform/external/neven.git;a=summary"/>
</export>
- <sysdepend os="ubuntu" version="7.04-feisty" package="git"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="git"/>
<rosdep name="git"/>
<url>http://android.git.kernel.org/?p=platform/external/neven.git;a=summary</url>
<versioncontrol type="git" url="git://android.git.kernel.org/platform/external/neven.git"/>
Modified: pkg/trunk/3rdparty/ocl/manifest.xml
===================================================================
--- pkg/trunk/3rdparty/ocl/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/3rdparty/ocl/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -16,9 +16,6 @@
<doxymaker external="http://www.orocos.org/ocl" />
</export>
<depend package="rtt" />
-<sysdepend os="ubuntu" version="7.04-feisty" package="libreadline-dev"/>
-<sysdepend os="ubuntu" version="7.10-gutsy" package="libreadline-dev"/>
-<sysdepend os="ubuntu" version="8.04-hardy" package="libreadline-dev"/>
<rosdep name="libreadline"/>
<versioncontrol type="svn" url="http://svn.mech.kuleuven.be/repos/orocos/trunk/ocl"/>
</package>
Modified: pkg/trunk/3rdparty/octave_forge/manifest.xml
===================================================================
--- pkg/trunk/3rdparty/octave_forge/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/3rdparty/octave_forge/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -13,10 +13,6 @@
</export>
<versioncontrol type="svn" url="https://octave.svn.sourceforge.net/svnroot/octave/trunk/octave-forge"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="octave2.9"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="octave2.9-headers"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="octave3.0"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="octave3.0-headers"/>
<rosdep name="octave"/>
</package>
Modified: pkg/trunk/3rdparty/player/manifest.xml
===================================================================
--- pkg/trunk/3rdparty/player/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/3rdparty/player/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -17,9 +17,7 @@
<doxymaker external="http://playerstage.sourceforge.net/doc/Player-cvs/player"/>
</export>
<versioncontrol type="svn" url="https://playerstage.svn.sourceforge.net/svnroot/playerstage/code/player/trunk"/>
-<sysdepend os="ubuntu" version="8.04-hardy" package="pkg-config"/>
<rosdep name="pkg-config"/>
-<!-- <sysdepend os="debian" version="4.0-etch" package="libasound2-dev"/> -->
</package>
Modified: pkg/trunk/3rdparty/python-twitter/manifest.xml
===================================================================
--- pkg/trunk/3rdparty/python-twitter/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/3rdparty/python-twitter/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -6,7 +6,5 @@
<license>Apache License</license>
<review status="3rdparty" notes=""/>
<versioncontrol type="svn" url="http://python-twitter.googlecode.com/svn/trunk/"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="python-simplejson"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="python-simplejson"/>
<rosdep name="python-simplejson"/>
</package>
Modified: pkg/trunk/3rdparty/wxpropgrid/manifest.xml
===================================================================
--- pkg/trunk/3rdparty/wxpropgrid/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/3rdparty/wxpropgrid/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -9,8 +9,6 @@
<export>
<cpp lflags="-L${prefix}/propgrid_install/lib -l`${prefix}/find_lib`" cflags="-I${prefix}/propgrid_install/include -D__NOTWXPYTHON__"/>
</export>
-<sysdepend os="ubuntu" version="7.04-feisty" package="libwxgtk2.8-dev"/>
-<sysdepend os="ubuntu" version="8.04-hardy" package="libwxgtk2.8-dev"/>
<rosdep name="wxwidgets"/>
</package>
Modified: pkg/trunk/audio/audio_capture/manifest.xml
===================================================================
--- pkg/trunk/audio/audio_capture/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/audio/audio_capture/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -5,10 +5,6 @@
<review status="unreviewed" notes=""/>
<depend package="roscpp"/>
<depend package="audio_msgs"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="portaudio19-dev"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="portaudio19-dev"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="libsndfile1-dev"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="libsndfile1-dev"/>
<rosdep name="portaudio"/>
<rosdep name="libsndfile"/>
</package>
Modified: pkg/trunk/audio/sound_play/manifest.xml
===================================================================
--- pkg/trunk/audio/sound_play/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/audio/sound_play/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -8,12 +8,6 @@
<depend package="roscpp" />
<depend package="roslib" />
<depend package="robot_msgs" />
-<sysdepend os="ubuntu" version="8.04-hardy" package="python-pygame"/>
-<sysdepend os="ubuntu" version="8.10-hardy" package="python-pygame"/>
-<sysdepend os="ubuntu" version="8.04-hardy" package="festival"/>
-<sysdepend os="ubuntu" version="8.10-hardy" package="festival"/>
-<sysdepend os="ubuntu" version="8.04-hardy" package="festvox-don"/>
-<sysdepend os="ubuntu" version="8.10-hardy" package="festvox-don"/>
</package>
Modified: pkg/trunk/controllers/qualification_controllers/dynamic_verification_controllers/manifest.xml
===================================================================
--- pkg/trunk/controllers/qualification_controllers/dynamic_verification_controllers/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/controllers/qualification_controllers/dynamic_verification_controllers/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -12,10 +12,6 @@
<depend package="robot_msgs" />
<depend package="robot_srvs" />
<url>http://pr.willowgarage.com</url>
- <sysdepend os="ubuntu" version="7.04-feisty" package="python-wxgtk2.8"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="python-wxgtk2.8"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="libwxgtk2.8-dev"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="libwxgtk2.8-dev"/>
<rosdep name="wxwidgets"/>
<rosdep name="wxpython"/>
<repository>http://pr.willowgarage.com/repos</repository>
Modified: pkg/trunk/controllers/qualification_controllers/joint_qualification_controllers/manifest.xml
===================================================================
--- pkg/trunk/controllers/qualification_controllers/joint_qualification_controllers/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/controllers/qualification_controllers/joint_qualification_controllers/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -14,10 +14,6 @@
<depend package="robot_msgs" />
<depend package="robot_srvs" />
<url>http://pr.willowgarage.com</url>
- <sysdepend os="ubuntu" version="7.04-feisty" package="python-wxgtk2.8"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="python-wxgtk2.8"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="libwxgtk2.8-dev"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="libwxgtk2.8-dev"/>
<rosdep name="wxwidgets"/>
<rosdep name="wxpython"/>
<repository>http://pr.willowgarage.com/repos</repository>
Modified: pkg/trunk/controllers/robot_mechanism_controllers/manifest.xml
===================================================================
--- pkg/trunk/controllers/robot_mechanism_controllers/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/controllers/robot_mechanism_controllers/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -31,6 +31,5 @@
<cpp cflags="-I${prefix}/include -I${prefix}/msg/cpp -I${prefix}/srv/cpp"
lflags="-Wl,-rpath,${prefix}/lib/ -L${prefix}/lib -lrobot_mechanism_controllers" />
</export>
- <sysdepend os="ubuntu" version="8.04-hardy" package="libltdl3-dev"/>
<rosdep name="libtool"/>
</package>
Modified: pkg/trunk/drivers/cam/axis_cam/manifest.xml
===================================================================
--- pkg/trunk/drivers/cam/axis_cam/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/drivers/cam/axis_cam/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -18,9 +18,6 @@
<depend package="deprecated_srvs"/>
<depend package="image_utils"/>
<depend package="self_test"/>
-<sysdepend package="libcurl3-openssl-dev" os="ubuntu" version="7.04-feisty"/>
-<sysdepend package="libcurl4-openssl-dev" os="ubuntu" version="8.04-hardy"/>
-<sysdepend package="libcurl4-openssl-dev" os="ubuntu" version="9.04-jaunty"/>
<rosdep name="curl"/>
<export>
<cpp cflags="-I${prefix}/include -I${prefix}/msg/cpp" lflags="-L${prefix}/lib -laxis -lcurl"/>
Modified: pkg/trunk/drivers/cam/camera_focus/manifest.xml
===================================================================
--- pkg/trunk/drivers/cam/camera_focus/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/drivers/cam/camera_focus/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -9,8 +9,6 @@
<url>http://pr.willowgarage.com/wiki/camera_focus</url>
<depend package="forearm_cam"/>
<depend package="dcam"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="gnuplot"/>
- <sysdepend os="ubuntu" version="8.10-hardy" package="gnuplot"/>
</package>
Modified: pkg/trunk/drivers/network/wifi_ddwrt/manifest.xml
===================================================================
--- pkg/trunk/drivers/network/wifi_ddwrt/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/drivers/network/wifi_ddwrt/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -10,6 +10,5 @@
<depend package="std_msgs" />
<depend package="rostest" />
- <sysdepend os="ubuntu" version="8.04-hardy" package="python-mechanize"/>
<rosdep name="python-mechanize"/>
</package>
Modified: pkg/trunk/drivers/phase_space/manifest.xml
===================================================================
--- pkg/trunk/drivers/phase_space/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/drivers/phase_space/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -7,7 +7,6 @@
<depend package="std_msgs" />
<depend package="mocap_msgs" />
<depend package="rospy" />
- <sysdepend os="ubuntu" version="8.04-hardy" package="libstdc++5"/>
<rosdep name="libstdc++5"/>
<export>
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/manifest.xml
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -34,8 +34,5 @@
<export>
<cpp cflags="-I${prefix}/include" lflags="-Wl,-rpath,${prefix}/lib -L${prefix}/lib" />
</export>
- <sysdepend os="ubuntu" version="9.04-jaunty" package="python-numpy"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="python-numpy"/>
- <sysdepend os="ubuntu" version="7.10-gutsy" package="python-numpy"/>
<rosdep name="python-numpy"/>
</package>
Modified: pkg/trunk/drivers/simulator/test_pr2_sensors_gazebo/manifest.xml
===================================================================
--- pkg/trunk/drivers/simulator/test_pr2_sensors_gazebo/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/drivers/simulator/test_pr2_sensors_gazebo/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -14,5 +14,4 @@
<depend package="laser_scan" />
<depend package="sensor_msgs" />
<depend package="stereo_image_proc" />
- <sysdepend os="ubuntu" version="7.04-feisty" package="xvfb"/>
</package>
Modified: pkg/trunk/drivers/ups/apcupsd_node/manifest.xml
===================================================================
--- pkg/trunk/drivers/ups/apcupsd_node/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/drivers/ups/apcupsd_node/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -10,7 +10,6 @@
<depend package="rospy"/>
<depend package="diagnostic_msgs"/>
<depend package="robot_msgs"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="apcupsd"/>
<rosdep name="apcupsd"/>
</package>
Modified: pkg/trunk/motion_planning/mpbench/manifest.xml
===================================================================
--- pkg/trunk/motion_planning/mpbench/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/motion_planning/mpbench/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -10,6 +10,5 @@
<depend package="mpglue"/>
<depend package="costmap_2d"/>
<depend package="door_msgs"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="libexpat1-dev"/>
<rosdep name="libexpat"/>
</package>
Modified: pkg/trunk/openrave_planning/openrave/manifest.xml
===================================================================
--- pkg/trunk/openrave_planning/openrave/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/openrave_planning/openrave/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -18,10 +18,6 @@
<!-- <depend package="laser_scan"/> -->
<depend package="roscpp"/>
<versioncontrol type="svn" url="https://openrave.svn.sourceforge.net/svnroot/openrave"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="libglew-dev"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="libglew1.5-dev"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="libxml2-dev"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="libxml2-dev"/>
<rosdep name="libxml2"/>
<rosdep name="glew"/>
</package>
Modified: pkg/trunk/openrave_planning/soqt/manifest.xml
===================================================================
--- pkg/trunk/openrave_planning/soqt/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/openrave_planning/soqt/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -10,30 +10,7 @@
<!-- use soqt-config instead of exporting the flags! -->
<doxymaker external="http://developer.nvidia.com/page/documentation.html"/>
</export>
- <sysdepend os="ubuntu" version="7.04-feisty" package="libqt4-core"/>
- <sysdepend os="ubuntu" version="7.10-gutsy" package="libqt4-core=4.3.2-0ubuntu3"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="libqt4-core"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="libcoin40-dev"/>
- <sysdepend os="ubuntu" version="7.10-gutsy" package="libcoin40-dev"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="libcoin40-dev"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="qt4-dev-tools"/>
- <sysdepend os="ubuntu" version="7.10-gutsy" package="qt4-dev-tools"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="qt4-dev-tools"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="libqt4-dev"/>
- <sysdepend os="ubuntu" version="7.10-gutsy" package="libqt4-dev"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="libqt4-dev"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="wget"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="wget"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="autoconf"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="autoconf"/>
- <sysdepend os="ubuntu" version="8.10-intrepid" package="libqt4-core"/>
- <sysdepend os="ubuntu" version="8.10-intrepid" package="libcoin40-dev"/>
- <sysdepend os="ubuntu" version="8.10-intrepid" package="qt4-dev-tools"/>
- <sysdepend os="ubuntu" version="8.10-intrepid" package="libqt4-dev"/>
- <sysdepend os="ubuntu" version="8.10-intrepid" package="wget"/>
- <sysdepend os="ubuntu" version="8.10-intrepid" package="autoconf"/>
- <sysdepend os="ubuntu" version="8.10-intrepid" package="libqt4-opengl-dev"/>
<rosdep name="qt4"/>
<rosdep name="coin"/>
Modified: pkg/trunk/pr2/dynamic_verification/manifest.xml
===================================================================
--- pkg/trunk/pr2/dynamic_verification/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/pr2/dynamic_verification/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -19,12 +19,6 @@
<depend package="rviz" />
<depend package="pr2_power_board" />
<url></url>
- <sysdepend os="ubuntu" version="7.04-feisty" package="python-wxgtk2.8"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="python-wxgtk2.8"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="libwxgtk2.8-dev"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="libwxgtk2.8-dev"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="python-numpy"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="python-numpy"/>
<rosdep name="wxwidgets"/>
<rosdep name="wxpython"/>
<rosdep name="python-numpy"/>
Modified: pkg/trunk/pr2/motorconf_gui/manifest.xml
===================================================================
--- pkg/trunk/pr2/motorconf_gui/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/pr2/motorconf_gui/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -14,7 +14,5 @@
<depend package="mechanism_control" />
<depend package="mechanism_bringup" />
- <sysdepend os="ubuntu" version="7.04-feisty" package="python-wxgtk2.8"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="python-wxgtk2.8"/>
<rosdep name="wxpython"/>
</package>
Modified: pkg/trunk/pr2/qualification/manifest.xml
===================================================================
--- pkg/trunk/pr2/qualification/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/pr2/qualification/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -24,14 +24,6 @@
<depend package="forearm_cam" />
<depend package="opencv_latest" />
<url></url>
- <sysdepend os="ubuntu" version="7.04-feisty" package="python-wxgtk2.8"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="python-wxgtk2.8"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="libwxgtk2.8-dev"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="libwxgtk2.8-dev"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="python-matplotlib"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="python-matplotlib"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="libusb-dev"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="libusb-dev"/>
<rosdep name="wxwidgets"/>
<rosdep name="wxpython"/>
<rosdep name="python-matplotlib"/>
Modified: pkg/trunk/sandbox/lifelong_mapping/manifest.xml
===================================================================
--- pkg/trunk/sandbox/lifelong_mapping/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/sandbox/lifelong_mapping/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -13,6 +13,5 @@
<depend package="place_recognition"/>
<depend package="visual_odometry"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="libdb4.6++-dev"/>
</package>
Modified: pkg/trunk/sandbox/trex_gui/manifest.xml
===================================================================
--- pkg/trunk/sandbox/trex_gui/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/sandbox/trex_gui/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -12,8 +12,5 @@
<depend package="roslib"/>
<depend package="trex_ros"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="libwxgtk2.8-dev"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="libwxgtk2.8-dev"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="python-wxgtk2.8"/>
</package>
Modified: pkg/trunk/stacks/camera_drivers/dcam/manifest.xml
===================================================================
--- pkg/trunk/stacks/camera_drivers/dcam/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/stacks/camera_drivers/dcam/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -3,8 +3,6 @@
<author>Kurt Konolige, Jeremy Leibs</author>
<license>BSD</license>
<review status="unreviewed" notes=""/>
- <sysdepend os="ubuntu" package="libfltk-dev"/>
- <sysdepend os="ubuntu" package="libglut-dev"/>
<export>
<cpp cflags="-g -I${prefix}/include" lflags="-L${prefix}/lib -ldcam"/>
</export>
@@ -18,8 +16,6 @@
<depend package="diagnostic_updater"/>
<depend package="rospy"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="libfltk1.1-dev"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="libfltk1.1-dev"/>
<rosdep name="fltk"/>
<url></url>
</package>
Modified: pkg/trunk/stacks/camera_drivers/libdc1394v2/manifest.xml
===================================================================
--- pkg/trunk/stacks/camera_drivers/libdc1394v2/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/stacks/camera_drivers/libdc1394v2/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -15,12 +15,6 @@
</export>
<versioncontrol type="svn" url="https://libdc1394.svn.sourceforge.net/svnroot/libdc1394/trunk/libdc1394"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="automake"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="automake"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="autoconf"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="autoconf"/>
- <sysdepend os="ubuntu" version="7.04-feisty" package="libtool"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="libtool"/>
<rosdep name="automake"/>
<rosdep name="autoconf"/>
<rosdep name="libtool"/>
Modified: pkg/trunk/stacks/estimation/bfl/manifest.xml
===================================================================
--- pkg/trunk/stacks/estimation/bfl/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/stacks/estimation/bfl/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -17,8 +17,6 @@
<doxymaker external="http://orocos.org/bfl" />
</export>
-<sysdepend os="ubuntu" version="7.04-feisty" package="libcppunit-dev"/>
-<sysdepend os="ubuntu" version="8.04-hardy" package="libcppunit-dev"/>
<rosdep name="cppunit"/>
</package>
Modified: pkg/trunk/stacks/geometry/bullet/manifest.xml
===================================================================
--- pkg/trunk/stacks/geometry/bullet/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/stacks/geometry/bullet/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -9,15 +9,6 @@
<review status="3rdparty" notes=""/>
<url>http://code.google.com/p/bullet/</url>
<depend package="rostest"/>
-<sysdepend os="ubuntu" version="9.04-jaunty" package="libXext-dev"/>
-<sysdepend os="ubuntu" version="8.04-hardy" package="libXext-dev"/>
-<sysdepend os="ubuntu" version="7.10-gutsy" package="libXext-dev"/>
-<sysdepend os="ubuntu" version="9.04-jaunty" package="libglut3-dev"/>
-<sysdepend os="ubuntu" version="8.04-hardy" package="libglut3-dev"/>
-<sysdepend os="ubuntu" version="7.10-gutsy" package="libglut3-dev"/>
-<sysdepend os="ubuntu" version="9.04-jaunty" package="swig"/>
-<sysdepend os="ubuntu" version="8.04-hardy" package="swig"/>
-<sysdepend os="ubuntu" version="7.10-gutsy" package="swig"/>
<rosdep name="libxext"/>
<rosdep name="glut"/>
<rosdep name="swig"/>
Modified: pkg/trunk/stacks/geometry/kdl/manifest.xml
===================================================================
--- pkg/trunk/stacks/geometry/kdl/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/stacks/geometry/kdl/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -14,9 +14,6 @@
<doxymaker external="http://www.orocos.org/kdl" />
<python path="${prefix}/kdl/lib/python/site-packages" />
</export>
-<sysdepend os="ubuntu" version="7.04-feisty" package="subversion"/>
-<sysdepend os="ubuntu" version="8.04-hardy" package="subversion"/>
-<sysdepend os="ubuntu" version="8.04-hardy" package="libcppunit-dev" />
<depend package="eigen"/>
<rosdep name="cppunit"/>
<versioncontrol type="svn" url="http://svn.mech.kuleuven.be/repos/orocos/trunk/kdl"/>
Modified: pkg/trunk/stacks/geometry/tf/manifest.xml
===================================================================
--- pkg/trunk/stacks/geometry/tf/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/stacks/geometry/tf/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -20,10 +20,6 @@
<cpp cflags="-I${prefix}/include -I${prefix}/msg/cpp -I${prefix}/srv/cpp `rosboost-cfg --cflags`" lflags="-Wl,-rpath,${prefix}/lib -L${prefix}/lib -ltf `rosboost-cfg --lflags thread`"/>
<roswtf plugin="tf.tfwtf" />
</export>
- <sysdepend os="ubuntu" version="8.04-hardy" package="python-numpy"/>
- <sysdepend os="ubuntu" version="7.10-gutsy" package="python-numpy"/>
- <sysdepend os="ubuntu" version="8.04-hardy" package="graphviz"/>
- <sysdepend os="ubuntu" version="7.10-gutsy" package="graphviz"/>
<rosdep name="python-numpy"/>
<rosdep name="graphviz"/>
</package>
Modified: pkg/trunk/stacks/hardware_test/diagnostic_test/manifest.xml
===================================================================
--- pkg/trunk/stacks/hardware_test/diagnostic_test/manifest.xml 2009-07-22 22:42:21 UTC (rev 19457)
+++ pkg/trunk/stacks/hardware_test/diagnostic_test/manifest.xml 2009-07-22 22:44:00 UTC (rev 19458)
@@ -13,8 +13,4 @@
</export>
<depend package="rospy"/>
<depend package="diagnostic_msgs"/>
-<sysdepend os="ubuntu" version="7.04-feisty" package="libwxgtk2.8-dev"/>
-<sysdepend os="ubuntu" version="8.04-feisty" package="python-wxgtk2.8"/>
-<sysdepend os="ubuntu" version="8.04-hardy" package="libwxgtk2.8-dev"/>
-<sysdepend os="ubuntu" version="8.04-hardy" package="python-wxgtk2.8"/>
</package>
Modified: pkg/trunk/stacks/hardware_test/runtime_monitor/manifest.xml
==========================================...
[truncated message content] |
|
From: <hsu...@us...> - 2009-07-23 02:05:47
|
Revision: 19494
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19494&view=rev
Author: hsujohnhsu
Date: 2009-07-23 02:05:44 +0000 (Thu, 23 Jul 2009)
Log Message:
-----------
update erratic demo.
Modified Paths:
--------------
pkg/trunk/drivers/simulator/gazebo_plugin/src/ros_diffdrive.cpp
pkg/trunk/robot_descriptions/erratic/erratic_defs/robots/erratic.xml
Added Paths:
-----------
pkg/trunk/demos/erratic_gazebo/erratic_demo.launch
Removed Paths:
-------------
pkg/trunk/demos/erratic_gazebo/erratic.launch
Deleted: pkg/trunk/demos/erratic_gazebo/erratic.launch
===================================================================
--- pkg/trunk/demos/erratic_gazebo/erratic.launch 2009-07-23 02:05:17 UTC (rev 19493)
+++ pkg/trunk/demos/erratic_gazebo/erratic.launch 2009-07-23 02:05:44 UTC (rev 19494)
@@ -1,16 +0,0 @@
-<launch>
- <!-- this launch file corresponds to robot model in ros-pkg/robot_descriptions/pr2/erratic_defs/robots for full erratic -->
-
- <!-- Create a transform sender for linking these frames. -->
- <node pkg="tf" type="transform_sender" args="0 0 0 0 0 0 base_footprint base_link 40" />
-
- <!-- send pr2.xml to param server -->
- <param name="robot_description" command="$(find xacro)/xacro.py '$(find erratic_defs)/robots/erratic.xml'" />
-
- <!-- push robot_description to factory and spawn robot in gazebo -->
- <node pkg="gazebo_plugin" type="urdf2factory" args="robot_description" respawn="false" output="screen" />
-
- <!-- load controllers -->
- <node pkg="gazebo_plugin" type="ros_diffdrive" respawn="true" />
-</launch>
-
Copied: pkg/trunk/demos/erratic_gazebo/erratic_demo.launch (from rev 19422, pkg/trunk/demos/erratic_gazebo/erratic.launch)
===================================================================
--- pkg/trunk/demos/erratic_gazebo/erratic_demo.launch (rev 0)
+++ pkg/trunk/demos/erratic_gazebo/erratic_demo.launch 2009-07-23 02:05:44 UTC (rev 19494)
@@ -0,0 +1,25 @@
+<launch>
+ <!-- this launch file corresponds to robot model in ros-pkg/robot_descriptions/pr2/erratic_defs/robots for full erratic -->
+ <!-- start up empty world -->
+ <include file="$(find gazebo)/launch/wg_world.launch"/>
+
+ <!-- Create a transform sender for linking these frames. -->
+ <node pkg="tf" type="transform_sender" args="0 0 0 0 0 0 base_footprint base_link 40" />
+
+ <!-- send pr2.xml to param server -->
+ <param name="robot_description" command="$(find xacro)/xacro.py '$(find erratic_defs)/robots/erratic.xml'" />
+
+ <!-- Robot state publisher -->
+ <node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher" output="screen">
+ <param name="publish_frequency" type="double" value="50.0" />
+ <param name="tf_prefix" type="string" value="" />
+ </node>
+
+ <!-- push robot_description to factory and spawn robot in gazebo -->
+ <node pkg="gazebo_plugin" type="urdf2factory" args="robot_description" respawn="false" output="screen" />
+
+ <!-- load controllers -->
+ <node pkg="gazebo_plugin" type="ros_diffdrive" respawn="true" output="screen"/>
+
+</launch>
+
Property changes on: pkg/trunk/demos/erratic_gazebo/erratic_demo.launch
___________________________________________________________________
Added: svn:mergeinfo
+ /pkg/branches/gazebo-branch-merge/demos/erratic_gazebo/erratic.launch:15683-15684,15739-15794,15797-15820,15822-15839,15852-15870,15983-16008,16010-16016,16129-16141,16145-16169,16245-16262,16274-16334
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/src/ros_diffdrive.cpp
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/src/ros_diffdrive.cpp 2009-07-23 02:05:17 UTC (rev 19493)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/src/ros_diffdrive.cpp 2009-07-23 02:05:44 UTC (rev 19494)
@@ -27,25 +27,34 @@
#include <gazebo/gazebo.h>
#include <gazebo/GazeboError.hh>
-#include <ros/node.h>
+#include <ros/ros.h>
#include "tf/transform_broadcaster.h"
#include <robot_msgs/PoseDot.h>
#include <deprecated_msgs/RobotBase2DOdom.h>
+#include <boost/bind.hpp>
+
gazebo::PositionIface *posIface = NULL;
-robot_msgs::PoseDot cmd_msg;
class DiffDrive {
public:
gazebo::PositionIface *posIface;
- robot_msgs::PoseDot cmd_msg;
+ ros::NodeHandle* rnh_;
+ ros::Subscriber sub_;
+ ros::Publisher pub_;
- void cmdVelCallBack() {
+ void cmdVelCallBack(const robot_msgs::PoseDot::ConstPtr& cmd_msg) {
+ std::cout << " pos " << posIface
+ << " x " << cmd_msg->vel.vx
+ << " y " << cmd_msg->vel.vy
+ << " z " << cmd_msg->ang_vel.vz
+ << std::endl;
+
if (posIface) {
posIface->Lock(1);
- posIface->data->cmdVelocity.pos.x = cmd_msg.vel.vx;
- posIface->data->cmdVelocity.pos.y = cmd_msg.vel.vy;
- posIface->data->cmdVelocity.yaw = cmd_msg.ang_vel.vz;
+ posIface->data->cmdVelocity.pos.x = cmd_msg->vel.vx;
+ posIface->data->cmdVelocity.pos.y = cmd_msg->vel.vy;
+ posIface->data->cmdVelocity.yaw = cmd_msg->ang_vel.vz;
posIface->Unlock();
}
}
@@ -71,11 +80,11 @@
} catch (gazebo::GazeboError e) {
std::cout << "Gazebo error: Unable to connect to the sim interface\n" << e << "\n";
return;
- }
+ }
/// Open the Position interface
try {
- posIface->Open(client, "position_iface_0");
+ posIface->Open(client, "robot_description::position_iface_0");
} catch (std::string e) {
std::cout << "Gazebo error: Unable to connect to the position interface\n" << e << "\n";
return;
@@ -85,62 +94,68 @@
posIface->Lock(1);
posIface->data->cmdEnableMotors = 1;
posIface->Unlock();
-
- ros::Node n("gazebo_diffdrive");
- ros::Node::instance()->subscribe("/cmd_vel", cmd_msg, &DiffDrive::cmdVelCallBack, this, 10);
- ros::Node::instance()->advertise<deprecated_msgs::RobotBase2DOdom>("odom", 1);
+
+ this->rnh_ = new ros::NodeHandle();
+ this->sub_ = rnh_->subscribe<robot_msgs::PoseDot>("/cmd_vel", 100, boost::bind(&DiffDrive::cmdVelCallBack,this,_1));
+ this->pub_ = rnh_->advertise<deprecated_msgs::RobotBase2DOdom>("/odom", 1);
deprecated_msgs::RobotBase2DOdom odom;
tf::TransformBroadcaster tfb;
ros::Duration d; d.fromSec(0.01);
- while(n.ok()) {
+ while(rnh_->ok()) {
if (posIface) {
- posIface->Lock(1);
-
- btQuaternion qt; qt.setEulerZYX(posIface->data->pose.yaw, posIface->data->pose.pitch, posIface->data->pose.roll);
- btVector3 vt(posIface->data->pose.pos.x, posIface->data->pose.pos.y, posIface->data->pose.pos.z);
+ posIface->Lock(1);
+
+ btQuaternion qt; qt.setEulerZYX(posIface->data->pose.yaw, posIface->data->pose.pitch, posIface->data->pose.roll);
+ btVector3 vt(posIface->data->pose.pos.x, posIface->data->pose.pos.y, posIface->data->pose.pos.z);
- tf::Transform latest_tf(qt, vt);
+ tf::Transform latest_tf(qt, vt);
- // We want to send a transform that is good up until a
- // tolerance time so that odom can be used
- ros::Time transform_expiration = ros::Time::now();
- tf::Stamped<tf::Transform> tmp_tf_stamped(latest_tf.inverse(),
- transform_expiration,
- "base_link", "odom");
- tfb.sendTransform(tmp_tf_stamped);
-
+ // We want to send a transform that is good up until a
+ // tolerance time so that odom can be used
+ ros::Time transform_expiration = ros::Time::now();
+ tf::Stamped<tf::Transform> tmp_tf_stamped(latest_tf.inverse(),
+ transform_expiration,
+ "base_link", "odom");
+ tfb.sendTransform(tmp_tf_stamped);
+
-
- odom.pos.x = posIface->data->pose.pos.x;
- odom.pos.y = posIface->data->pose.pos.y;
- odom.pos.th = posIface->data->pose.yaw;
- odom.vel.x = posIface->data->velocity.pos.x;
- odom.vel.y = posIface->data->velocity.pos.y;
- odom.vel.th = posIface->data->velocity.yaw;
- odom.stall = 0;
-
- odom.header.frame_id = "odom";
-
- odom.header.stamp = transform_expiration;
-
- ros::Node::instance()->publish("odom", odom);
+ odom.pos.x = posIface->data->pose.pos.x;
+ odom.pos.y = posIface->data->pose.pos.y;
+ odom.pos.th = posIface->data->pose.yaw;
+ odom.vel.x = posIface->data->velocity.pos.x;
+ odom.vel.y = posIface->data->velocity.pos.y;
+ odom.vel.th = posIface->data->velocity.yaw;
+ odom.stall = 0;
+
+ odom.header.frame_id = "odom";
+
+ odom.header.stamp = transform_expiration;
+
+ this->pub_.publish(odom);
-
- posIface->Unlock();
+ posIface->Unlock();
}
d.sleep();
}
}
+ ~DiffDrive() {
+ delete this->rnh_;
+ }
};
int main(int argc, char** argv) {
- ros::init(argc, argv);
+ ros::init(argc,argv,"ros_diffdrive");
+
+ // spawn 2 threads by default, ///@todo: make this a parameter
+ ros::MultiThreadedSpinner s(1);
+ boost::thread spinner_thread( boost::bind( &ros::spin, s ) );
+
DiffDrive d;
return 0;
}
Modified: pkg/trunk/robot_descriptions/erratic/erratic_defs/robots/erratic.xml
===================================================================
--- pkg/trunk/robot_descriptions/erratic/erratic_defs/robots/erratic.xml 2009-07-23 02:05:17 UTC (rev 19493)
+++ pkg/trunk/robot_descriptions/erratic/erratic_defs/robots/erratic.xml 2009-07-23 02:05:44 UTC (rev 19494)
@@ -16,7 +16,7 @@
<map name="sensor" flag="gazebo">
<verbatim key="ros_time_controller">
- <controller:ros_time name="ros_time" plugin="libros_time.so">
+ <controller:ros_time name="ros_time_controller" plugin="libros_time.so">
<alwaysOn>true</alwaysOn>
<updateRate>1000.0</updateRate>
<interface:audio name="dummy_ros_time_iface_should_not_be_here"/>
@@ -44,7 +44,7 @@
<link name="base_link">
<parent name="world" />
<origin xyz="0 0 0.051" rpy="0 0 0" />
- <joint name="base_joint" />
+ <joint name="base_joint" type="planar" />
<inertial>
<mass value="10" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <is...@us...> - 2009-07-23 04:43:32
|
Revision: 19500
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19500&view=rev
Author: isucan
Date: 2009-07-23 04:43:29 +0000 (Thu, 23 Jul 2009)
Log Message:
-----------
parallel collision checking should work in planning
Modified Paths:
--------------
pkg/trunk/motion_planning/ompl_planning/include/ompl_planning/extensions/StateValidator.h
pkg/trunk/motion_planning/ompl_planning/src/helpers/ompl_extensions/StateValidator.cpp
pkg/trunk/sandbox/3dnav_pr2/params/planning/planning.yaml
Modified: pkg/trunk/motion_planning/ompl_planning/include/ompl_planning/extensions/StateValidator.h
===================================================================
--- pkg/trunk/motion_planning/ompl_planning/include/ompl_planning/extensions/StateValidator.h 2009-07-23 04:04:45 UTC (rev 19499)
+++ pkg/trunk/motion_planning/ompl_planning/include/ompl_planning/extensions/StateValidator.h 2009-07-23 04:43:29 UTC (rev 19500)
@@ -44,6 +44,7 @@
#include "ompl_planning/ModelBase.h"
#include "ompl_planning/extensions/SpaceInformation.h"
+#include <boost/thread.hpp>
#include <iostream>
namespace ompl_planning
@@ -56,16 +57,14 @@
{
ksi_ = si;
dsi_ = NULL;
- model_ = model;
- setupModel();
+ setupModel(model);
}
StateValidityPredicate(SpaceInformationDynamicModel *si, ModelBase *model) : ompl::base::StateValidityChecker()
{
dsi_ = si;
ksi_ = NULL;
- model_ = model;
- setupModel();
+ setupModel(model);
}
virtual ~StateValidityPredicate(void)
@@ -81,13 +80,13 @@
protected:
+ void setupModel(ModelBase *model);
bool check(const ompl::base::State *s, collision_space::EnvironmentModel *em, planning_models::KinematicModel *km,
planning_environment::KinematicConstraintEvaluatorSet *kce) const;
void useConstraints(planning_environment::KinematicConstraintEvaluatorSet *kce, planning_models::KinematicModel *km) const;
- void setupModel(void);
void clearClones(void);
-
+
ModelBase *model_;
// one of the next two will be instantiated
@@ -105,11 +104,9 @@
planning_environment::KinematicConstraintEvaluatorSet *kce;
};
- mutable std::vector<Clone> clones_;
- mutable int position_;
+ mutable std::map<boost::thread::id, Clone> clones_;
mutable boost::mutex lock_;
-
};
} // ompl_planning
Modified: pkg/trunk/motion_planning/ompl_planning/src/helpers/ompl_extensions/StateValidator.cpp
===================================================================
--- pkg/trunk/motion_planning/ompl_planning/src/helpers/ompl_extensions/StateValidator.cpp 2009-07-23 04:04:45 UTC (rev 19499)
+++ pkg/trunk/motion_planning/ompl_planning/src/helpers/ompl_extensions/StateValidator.cpp 2009-07-23 04:43:29 UTC (rev 19500)
@@ -36,6 +36,15 @@
#include "ompl_planning/extensions/StateValidator.h"
+void ompl_planning::StateValidityPredicate::setupModel(ModelBase *model)
+{
+ model_ = model;
+ boost::thread::id id = boost::this_thread::get_id();
+ clones_[id].em = model_->collisionSpace;
+ clones_[id].km = model_->kmodel;
+ clones_[id].kce = &kce_;
+}
+
bool ompl_planning::StateValidityPredicate::operator()(const ompl::base::State *s) const
{
// for dynamic state spaces, we may get outside bounds
@@ -44,31 +53,23 @@
if (!dsi_->satisfiesBounds(s))
return false;
}
+
+ boost::thread::id id = boost::this_thread::get_id();
lock_.lock();
- int p = position_++;
-
- // if this is a new thread, we create an additional clone
- if (p == (int)clones_.size())
+ if (clones_.find(id) == clones_.end())
{
- ROS_DEBUG("Cloning collision environment (index %d)", p);
- clones_.resize(p + 1);
- clones_[p].em = clones_[0].em->clone();
- clones_[p].km = clones_[p].em->getRobotModel().get();
- clones_[p].kce = new planning_environment::KinematicConstraintEvaluatorSet();
- useConstraints(clones_[p].kce, clones_[p].km);
+ ROS_DEBUG("Cloning collision environment");
+ Clone &add = clones_[id];
+ add.em = model_->collisionSpace->clone();
+ add.km = add.em->getRobotModel().get();
+ add.kce = new planning_environment::KinematicConstraintEvaluatorSet();
+ useConstraints(add.kce, add.km);
}
-
+ const Clone c = clones_[id];
lock_.unlock();
- const Clone &c = clones_[p];
- bool res = check(s, c.em, c.km, c.kce);
-
- lock_.lock();
- --position_;
- lock_.unlock();
-
- return res;
+ return check(s, c.em, c.km, c.kce);
}
void ompl_planning::StateValidityPredicate::setConstraints(const motion_planning_msgs::KinematicConstraints &kc)
@@ -108,7 +109,6 @@
{
clearConstraints();
clearClones();
- position_ = 0;
}
void ompl_planning::StateValidityPredicate::printSettings(std::ostream &out) const
@@ -132,21 +132,17 @@
return valid;
}
-void ompl_planning::StateValidityPredicate::setupModel(void)
-{
- clones_.resize(1);
- clones_[0].km = model_->kmodel;
- clones_[0].em = model_->collisionSpace;
- clones_[0].kce = &kce_;
- position_ = 0;
-}
-
void ompl_planning::StateValidityPredicate::clearClones(void)
{
- for (unsigned int i = 1 ; i < clones_.size() ; ++i)
+ boost::thread::id id = boost::this_thread::get_id();
+ Clone keep = clones_[id];
+ for (std::map<boost::thread::id, Clone>::iterator it = clones_.begin() ; it != clones_.end() ; ++it)
{
- delete clones_[i].em; // .km is owned & deleted by .em
- delete clones_[i].kce;
+ if (it->first == id)
+ continue;
+ delete it->second.em; // .km is owned & deleted by .em
+ delete it->second.kce;
}
- clones_.resize(1);
+ clones_.clear();
+ clones_[id] = keep;
}
Modified: pkg/trunk/sandbox/3dnav_pr2/params/planning/planning.yaml
===================================================================
--- pkg/trunk/sandbox/3dnav_pr2/params/planning/planning.yaml 2009-07-23 04:04:45 UTC (rev 19499)
+++ pkg/trunk/sandbox/3dnav_pr2/params/planning/planning.yaml 2009-07-23 04:43:29 UTC (rev 19500)
@@ -28,7 +28,7 @@
l_wrist_flex_link
l_wrist_roll_link
planner_configs:
- RRTkConfig2 SBLkConfig2 KPIECEkConfig1 KPIECEkConfig2l LBKPIECEkConfig2l
+ RRTkConfig2 pRRTkConfig1 SBLkConfig2 KPIECEkConfig1 KPIECEkConfig2l LBKPIECEkConfig2l
right_arm:
links:
@@ -42,7 +42,7 @@
r_wrist_flex_link
r_wrist_roll_link
planner_configs:
- RRTkConfig2 SBLkConfig2 KPIECEkConfig1 KPIECEkConfig2l LBKPIECEkConfig2l
+ RRTkConfig2 pRRTkConfig1 SBLkConfig2 KPIECEkConfig1 KPIECEkConfig2l LBKPIECEkConfig2l
arms:
links:
@@ -73,7 +73,7 @@
planner_configs:
- pRRTConfig1:
+ pRRTkConfig1:
type: kinematic::pRRT
range: 0.75
thread_count: 2
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <is...@us...> - 2009-07-23 17:07:37
|
Revision: 19515
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19515&view=rev
Author: isucan
Date: 2009-07-23 17:07:25 +0000 (Thu, 23 Jul 2009)
Log Message:
-----------
made ODE collision checker more robust wrt multiple threads
Modified Paths:
--------------
pkg/trunk/motion_planning/ompl_planning/src/helpers/RequestHandler.cpp
pkg/trunk/motion_planning/ompl_planning/src/helpers/ompl_extensions/StateValidator.cpp
pkg/trunk/motion_planning/ompl_planning/src/motion_planner.cpp
pkg/trunk/world_models/collision_space/include/collision_space/environment.h
pkg/trunk/world_models/collision_space/include/collision_space/environmentBullet.h
pkg/trunk/world_models/collision_space/include/collision_space/environmentODE.h
pkg/trunk/world_models/collision_space/src/environmentODE.cpp
pkg/trunk/world_models/test_collision_space/src/collision_test_speed.cpp
Modified: pkg/trunk/motion_planning/ompl_planning/src/helpers/RequestHandler.cpp
===================================================================
--- pkg/trunk/motion_planning/ompl_planning/src/helpers/RequestHandler.cpp 2009-07-23 13:46:02 UTC (rev 19514)
+++ pkg/trunk/motion_planning/ompl_planning/src/helpers/RequestHandler.cpp 2009-07-23 17:07:25 UTC (rev 19515)
@@ -413,7 +413,7 @@
psetup->smoother->smoothMax(path);
double tsmooth = (ros::WallTime::now() - startTime).toSec();
ROS_DEBUG(" Smoother spent %g seconds (%g seconds in total)", tsmooth, tsmooth + tsolve);
- dynamic_cast<SpaceInformationKinematicModel*>(psetup->si)->interpolatePath(path);
+ dynamic_cast<SpaceInformationKinematicModel*>(psetup->si)->interpolatePath(path, 3.0);
}
}
Modified: pkg/trunk/motion_planning/ompl_planning/src/helpers/ompl_extensions/StateValidator.cpp
===================================================================
--- pkg/trunk/motion_planning/ompl_planning/src/helpers/ompl_extensions/StateValidator.cpp 2009-07-23 13:46:02 UTC (rev 19514)
+++ pkg/trunk/motion_planning/ompl_planning/src/helpers/ompl_extensions/StateValidator.cpp 2009-07-23 17:07:25 UTC (rev 19515)
@@ -134,15 +134,20 @@
void ompl_planning::StateValidityPredicate::clearClones(void)
{
- boost::thread::id id = boost::this_thread::get_id();
- Clone keep = clones_[id];
+ std::map<boost::thread::id, Clone>::iterator keep = clones_.end();
for (std::map<boost::thread::id, Clone>::iterator it = clones_.begin() ; it != clones_.end() ; ++it)
{
- if (it->first == id)
+ if (it->second.em == model_->collisionSpace)
+ {
+ keep = it;
continue;
+ }
delete it->second.em; // .km is owned & deleted by .em
delete it->second.kce;
}
+ assert(keep != clones_.end());
+ boost::thread::id id = keep->first;
+ Clone c = keep->second;
clones_.clear();
- clones_[id] = keep;
+ clones_[id] = c;
}
Modified: pkg/trunk/motion_planning/ompl_planning/src/motion_planner.cpp
===================================================================
--- pkg/trunk/motion_planning/ompl_planning/src/motion_planner.cpp 2009-07-23 13:46:02 UTC (rev 19514)
+++ pkg/trunk/motion_planning/ompl_planning/src/motion_planner.cpp 2009-07-23 17:07:25 UTC (rev 19515)
@@ -46,7 +46,7 @@
OMPLPlanning(void)
{
// display the first 3 coordinates of states in diffusion trees
- requestHandler_.enableDebugMode(0, 1);
+ // requestHandler_.enableDebugMode(0, 1);
// register with ROS
collisionModels_ = new planning_environment::CollisionModels("robot_description");
Modified: pkg/trunk/world_models/collision_space/include/collision_space/environment.h
===================================================================
--- pkg/trunk/world_models/collision_space/include/collision_space/environment.h 2009-07-23 13:46:02 UTC (rev 19514)
+++ pkg/trunk/world_models/collision_space/include/collision_space/environment.h 2009-07-23 17:07:25 UTC (rev 19515)
@@ -183,7 +183,7 @@
/** \brief Check the state of verbosity */
bool getVerbose(void) const;
- /** \brief Clone the environment. If this clone is to be used for collision checking in another thread, the call to clone() MUST be made from that thread. */
+ /** \brief Clone the environment. */
virtual EnvironmentModel* clone(void) const = 0;
protected:
Modified: pkg/trunk/world_models/collision_space/include/collision_space/environmentBullet.h
===================================================================
--- pkg/trunk/world_models/collision_space/include/collision_space/environmentBullet.h 2009-07-23 13:46:02 UTC (rev 19514)
+++ pkg/trunk/world_models/collision_space/include/collision_space/environmentBullet.h 2009-07-23 17:07:25 UTC (rev 19515)
@@ -106,7 +106,7 @@
/** \brief Enable/Disable collision checking for specific links. Return the previous value of the state (1 or 0) if succesful; -1 otherwise */
virtual int setCollisionCheck(const std::string &link, bool state);
- /** \brief Clone the environment. If this clone is to be used for collision checking in another thread, the call to clone() MUST be made from that thread. */
+ /** \brief Clone the environment */
virtual EnvironmentModel* clone(void) const;
protected:
Modified: pkg/trunk/world_models/collision_space/include/collision_space/environmentODE.h
===================================================================
--- pkg/trunk/world_models/collision_space/include/collision_space/environmentODE.h 2009-07-23 13:46:02 UTC (rev 19514)
+++ pkg/trunk/world_models/collision_space/include/collision_space/environmentODE.h 2009-07-23 17:07:25 UTC (rev 19515)
@@ -52,17 +52,8 @@
public:
- EnvironmentModelODE(void) : EnvironmentModel()
- {
- dInitODE2(0);
- dAllocateODEDataForThread(dAllocateMaskAll);
- }
-
- virtual ~EnvironmentModelODE(void)
- {
- freeMemory();
- dCloseODE();
- }
+ EnvironmentModelODE(void);
+ virtual ~EnvironmentModelODE(void);
/** \brief Get the list of contacts (collisions) */
virtual bool getCollisionContacts(std::vector<Contact> &contacts, unsigned int max_count = 1);
@@ -105,7 +96,7 @@
/** \brief Enable/Disable collision checking for specific links. Return the previous value of the state (1 or 0) if succesful; -1 otherwise */
virtual int setCollisionCheck(const std::string &link, bool state);
- /** \brief Clone the environment. If this clone is to be used for collision checking in another thread, the call to clone() MUST be made from that thread. */
+ /** \brief Clone the environment */
virtual EnvironmentModel* clone(void) const;
protected:
@@ -325,6 +316,9 @@
void createODERobotModel(void);
dGeomID createODEGeom(dSpaceID space, ODEStorage &storage, const shapes::Shape *shape, double scale, double padding);
void updateGeom(dGeomID geom, const btTransform &pose) const;
+
+ /** \brief Check if thread-specific routines have been called */
+ void checkThreadInit(void) const;
void freeMemory(void);
ModelInfo m_modelGeom;
Modified: pkg/trunk/world_models/collision_space/src/environmentODE.cpp
===================================================================
--- pkg/trunk/world_models/collision_space/src/environmentODE.cpp 2009-07-23 13:46:02 UTC (rev 19514)
+++ pkg/trunk/world_models/collision_space/src/environmentODE.cpp 2009-07-23 17:07:25 UTC (rev 19515)
@@ -35,12 +35,52 @@
/** \author Ioan Sucan */
#include "collision_space/environmentODE.h"
+#include <boost/thread.hpp>
#include <cassert>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
+static int ODEInitCount = 0;
+static boost::mutex ODEInitCountLock;
+
+static std::map<boost::thread::id, int> ODEThreadMap;
+static boost::mutex ODEThreadMapLock;
+
+collision_space::EnvironmentModelODE::EnvironmentModelODE(void) : EnvironmentModel()
+{
+ ODEInitCountLock.lock();
+ if (ODEInitCount == 0)
+ dInitODE2(0);
+ ODEInitCount++;
+ ODEInitCountLock.unlock();
+
+ checkThreadInit();
+}
+
+collision_space::EnvironmentModelODE::~EnvironmentModelODE(void)
+{
+ freeMemory();
+ ODEInitCountLock.lock();
+ ODEInitCount--;
+ if (ODEInitCount == 0)
+ dCloseODE();
+ ODEInitCountLock.unlock();
+}
+
+void collision_space::EnvironmentModelODE::checkThreadInit(void) const
+{
+ boost::thread::id id = boost::this_thread::get_id();
+ ODEThreadMapLock.lock();
+ if (ODEThreadMap.find(id) == ODEThreadMap.end())
+ {
+ ODEThreadMap[id] = 1;
+ dAllocateODEDataForThread(dAllocateMaskAll);
+ }
+ ODEThreadMapLock.unlock();
+}
+
void collision_space::EnvironmentModelODE::freeMemory(void)
{
for (unsigned int j = 0 ; j < m_modelGeom.linkGeom.size() ; ++j)
@@ -440,6 +480,7 @@
cdata.contacts = &contacts;
cdata.max_contacts = max_count;
contacts.clear();
+ checkThreadInit();
testCollision(&cdata);
return cdata.collides;
}
@@ -448,6 +489,7 @@
{
CollisionData cdata;
cdata.selfCollisionTest = &m_selfCollisionTest;
+ checkThreadInit();
testCollision(&cdata);
return cdata.collides;
}
@@ -456,6 +498,7 @@
{
CollisionData cdata;
cdata.selfCollisionTest = &m_selfCollisionTest;
+ checkThreadInit();
testSelfCollision(&cdata);
return cdata.collides;
}
Modified: pkg/trunk/world_models/test_collision_space/src/collision_test_speed.cpp
===================================================================
--- pkg/trunk/world_models/test_collision_space/src/collision_test_speed.cpp 2009-07-23 13:46:02 UTC (rev 19514)
+++ pkg/trunk/world_models/test_collision_space/src/collision_test_speed.cpp 2009-07-23 17:07:25 UTC (rev 19515)
@@ -180,16 +180,9 @@
ROS_INFO("Thread %d: %f collision tests per second (with self collision checking)", tid, (double)K/(ros::WallTime::now() - tm).toSec());
delete em;
}
-
- void testThreads(void)
+
+ void collisionSetupThread(collision_space::EnvironmentModel *em)
{
- if (!cm_->loadedModels())
- return;
-
- collision_space::EnvironmentModel *em = cm_->getODECollisionModel().get();
- em->setSelfCollision(true);
- em->updateRobotModel();
-
const int n = 10000;
double *data = new double[n * 4];
@@ -213,8 +206,20 @@
ROS_INFO("Added %d points", n);
delete[] data;
-
+ }
+
+ void testThreads(void)
+ {
+ if (!cm_->loadedModels())
+ return;
+ collision_space::EnvironmentModel *em = cm_->getODECollisionModel().get();
+ em->setSelfCollision(true);
+ em->updateRobotModel();
+
+ boost::thread t(boost::bind(&CollisionTestSpeed::collisionSetupThread, this, em));
+ t.join();
+
int nt = 2;
std::vector<boost::thread*> th(nt);
for (int i = 0 ; i < nt ; ++i)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <is...@us...> - 2009-07-23 17:24:26
|
Revision: 19517
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19517&view=rev
Author: isucan
Date: 2009-07-23 17:24:24 +0000 (Thu, 23 Jul 2009)
Log Message:
-----------
enabling optimizations
Modified Paths:
--------------
pkg/trunk/motion_planning/planning_environment/CMakeLists.txt
pkg/trunk/motion_planning/planning_models/CMakeLists.txt
pkg/trunk/world_models/collision_space/CMakeLists.txt
pkg/trunk/world_models/test_collision_space/CMakeLists.txt
Modified: pkg/trunk/motion_planning/planning_environment/CMakeLists.txt
===================================================================
--- pkg/trunk/motion_planning/planning_environment/CMakeLists.txt 2009-07-23 17:13:55 UTC (rev 19516)
+++ pkg/trunk/motion_planning/planning_environment/CMakeLists.txt 2009-07-23 17:24:24 UTC (rev 19517)
@@ -3,7 +3,7 @@
rospack(planning_environment)
-set(ROS_BUILD_TYPE Debug)
+set(ROS_BUILD_TYPE Release)
#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
Modified: pkg/trunk/motion_planning/planning_models/CMakeLists.txt
===================================================================
--- pkg/trunk/motion_planning/planning_models/CMakeLists.txt 2009-07-23 17:13:55 UTC (rev 19516)
+++ pkg/trunk/motion_planning/planning_models/CMakeLists.txt 2009-07-23 17:24:24 UTC (rev 19517)
@@ -3,7 +3,7 @@
rospack(planning_models)
rospack_add_boost_directories()
-set(ROS_BUILD_TYPE Debug)
+set(ROS_BUILD_TYPE Release)
rospack_add_library(planning_models src/kinematic.cpp
src/kinematic_state_params.cpp
Modified: pkg/trunk/world_models/collision_space/CMakeLists.txt
===================================================================
--- pkg/trunk/world_models/collision_space/CMakeLists.txt 2009-07-23 17:13:55 UTC (rev 19516)
+++ pkg/trunk/world_models/collision_space/CMakeLists.txt 2009-07-23 17:24:24 UTC (rev 19517)
@@ -2,7 +2,7 @@
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
rospack(collision_space)
-set(ROS_BUILD_TYPE Debug)
+set(ROS_BUILD_TYPE Release)
rospack_add_boost_directories()
Modified: pkg/trunk/world_models/test_collision_space/CMakeLists.txt
===================================================================
--- pkg/trunk/world_models/test_collision_space/CMakeLists.txt 2009-07-23 17:13:55 UTC (rev 19516)
+++ pkg/trunk/world_models/test_collision_space/CMakeLists.txt 2009-07-23 17:24:24 UTC (rev 19517)
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
-set(ROS_BUILD_TYPE Debug)
+set(ROS_BUILD_TYPE Release)
rospack_add_boost_directories()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ge...@us...> - 2009-07-24 17:59:08
|
Revision: 19582
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19582&view=rev
Author: gerkey
Date: 2009-07-24 17:58:52 +0000 (Fri, 24 Jul 2009)
Log Message:
-----------
Some OSX build fixes.
Modified Paths:
--------------
pkg/trunk/3rdparty/toro/fPIC.patch
pkg/trunk/sandbox/voxel3d/src/voxel3d.cpp
pkg/trunk/stacks/semantic_mapping/point_cloud_mapping/CMakeLists.txt
pkg/trunk/util/pr2_ik/src/pr2_ik.cpp
Modified: pkg/trunk/3rdparty/toro/fPIC.patch
===================================================================
--- pkg/trunk/3rdparty/toro/fPIC.patch 2009-07-24 17:49:15 UTC (rev 19581)
+++ pkg/trunk/3rdparty/toro/fPIC.patch 2009-07-24 17:58:52 UTC (rev 19582)
@@ -1,3 +1,122 @@
+Index: trunk/treeoptimizer3_iteration.cpp
+===================================================================
+--- trunk/treeoptimizer3_iteration.cpp (revision 23)
++++ trunk/treeoptimizer3_iteration.cpp (working copy)
+@@ -87,7 +87,7 @@
+
+
+ void TreeOptimizer3::computePreconditioner(){
+- for (uint i=0; i<M.size(); i++){
++ for (unsigned int i=0; i<M.size(); i++){
+ M[i][0]=0;
+ M[i][1]=0;
+ }
+@@ -107,7 +107,7 @@
+ for (int dir=0; dir<2; dir++){
+ Vertex* n = (dir==0)? e->v1 : e->v2;
+ while (n!=top){
+- uint i=n->id;
++ unsigned int i=n->id;
+ double rW=min3(W[0][0], W[1][1], W[2][2]);
+ double tW=min3(W[3][3], W[4][4], W[5][5]);
+ M[i][0]+=rW;
+@@ -121,7 +121,7 @@
+ }
+
+ if (verboseLevel>1){
+- for (uint i=0; i<M.size(); i++){
++ for (unsigned int i=0; i<M.size(); i++){
+ cerr << "M[" << i << "]=" << M[i][0] << " " << M[i][1] << endl;
+ }
+ }
+Index: trunk/posegraph2.cpp
+===================================================================
+--- trunk/posegraph2.cpp (revision 23)
++++ trunk/posegraph2.cpp (working copy)
+@@ -109,7 +109,7 @@
+ if (!is)
+ return false;
+ EdgeList suppressed;
+- uint equivCount=0;
++ unsigned int equivCount=0;
+ while (is){
+ char buf[LINESIZE];
+ is.getline(buf, LINESIZE);
+Index: trunk/posegraph3.cpp
+===================================================================
+--- trunk/posegraph3.cpp (revision 23)
++++ trunk/posegraph3.cpp (working copy)
+@@ -154,7 +154,7 @@
+ if (!is)
+ return false;
+ EdgeList suppressed;
+- uint equivCount=0;
++ unsigned int equivCount=0;
+ while (is){
+ char buf[LINESIZE];
+ is.getline(buf, LINESIZE);
+Index: trunk/treeoptimizer2.cpp
+===================================================================
+--- trunk/treeoptimizer2.cpp (revision 23)
++++ trunk/treeoptimizer2.cpp (working copy)
+@@ -106,7 +106,7 @@
+ void TreeOptimizer2::computePreconditioner(){
+ gamma[0] = gamma[1] = gamma[2] = numeric_limits<double>::max();
+
+- for (uint i=0; i<M.size(); i++)
++ for (unsigned int i=0; i<M.size(); i++)
+ M[i]=Pose(0.,0.,0.);
+
+ int edgeCount=0;
+@@ -138,7 +138,7 @@
+ for (int dir=0; dir<2; dir++){
+ Vertex* n = (dir==0)? e->v1 : e->v2;
+ while (n!=top){
+- uint i=n->id;
++ unsigned int i=n->id;
+ M[i].values[0]+=W.values[0][0];
+ M[i].values[1]+=W.values[1][1];
+ M[i].values[2]+=W.values[2][2];
+@@ -151,7 +151,7 @@
+ }
+
+ if (verboseLevel>1){
+- for (uint i=0; i<M.size(); i++){
++ for (unsigned int i=0; i<M.size(); i++){
+ cerr << "M[" << i << "]=" << M[i].x() << " " << M[i].y() << " " << M[i].theta() <<endl;
+ }
+ }
+@@ -224,7 +224,7 @@
+ for (int dir=0; dir<2; dir++) {
+ Vertex* n = (dir==0)? v1 : v2;
+ while (n!=top){
+- uint i=n->id;
++ unsigned int i=n->id;
+ tw[0]+=1./M[i].values[0];
+ tw[1]+=1./M[i].values[1];
+ tw[2]+=1./M[i].values[2];
+@@ -244,7 +244,7 @@
+ Vertex* n = (dir==0)? v1 : v2;
+ double sign=(dir==0)? -1. : 1.;
+ while (n!=top){
+- uint i=n->id;
++ unsigned int i=n->id;
+ assert(M[i].values[0]>0);
+ assert(M[i].values[1]>0);
+ assert(M[i].values[2]>0);
+Index: trunk/treeoptimizer3.cpp
+===================================================================
+--- trunk/treeoptimizer3.cpp (revision 23)
++++ trunk/treeoptimizer3.cpp (working copy)
+@@ -95,7 +95,7 @@
+ maxRotationalErrors.push_back(mre);
+ int interval=3;
+ if ((int)maxRotationalErrors.size()>=interval){
+- uint s=maxRotationalErrors.size();
++ unsigned int s=maxRotationalErrors.size();
+ double re0 = maxRotationalErrors[s-interval];
+ double re1 = maxRotationalErrors[s-1];
+
Index: trunk/Makefile
===================================================================
--- trunk/Makefile (revision 23)
Modified: pkg/trunk/sandbox/voxel3d/src/voxel3d.cpp
===================================================================
--- pkg/trunk/sandbox/voxel3d/src/voxel3d.cpp 2009-07-24 17:49:15 UTC (rev 19581)
+++ pkg/trunk/sandbox/voxel3d/src/voxel3d.cpp 2009-07-24 17:58:52 UTC (rev 19582)
@@ -38,7 +38,9 @@
//#endif
#include <cmath>
-#include <malloc.h>
+#if ! defined(__APPLE__)
+ #include <malloc.h>
+#endif
#include <string.h> // for memset(3)
#include "visualization_msgs/MarkerArray.h"
@@ -61,7 +63,11 @@
// Constructs the kernel
//kernel_.resize(16*17*17);
+#if defined(__APPLE__)
+ kernel_ = (unsigned char*)malloc(16*17*17);
+#else
kernel_ = (unsigned char*)memalign(16, 16*17*17);
+#endif
for (int k = 0; k < 17; ++k) {
for (int j = 0; j < 17; ++j) {
for (int i = 0; i < 16; ++i) {
Modified: pkg/trunk/stacks/semantic_mapping/point_cloud_mapping/CMakeLists.txt
===================================================================
--- pkg/trunk/stacks/semantic_mapping/point_cloud_mapping/CMakeLists.txt 2009-07-24 17:49:15 UTC (rev 19581)
+++ pkg/trunk/stacks/semantic_mapping/point_cloud_mapping/CMakeLists.txt 2009-07-24 17:58:52 UTC (rev 19582)
@@ -17,6 +17,7 @@
rospack_add_library (normal_estimation_in_proc src/normal_estimation_in_proc.cpp)
rospack_add_openmp_flags (normal_estimation_in_proc)
+target_link_libraries(normal_estimation_in_proc cloud_geometry)
rospack_add_executable (bin/planar_fit_node src/planar_fit.cpp)
target_link_libraries (bin/planar_fit_node cloud_geometry cloud_kdtree sample_consensus)
Modified: pkg/trunk/util/pr2_ik/src/pr2_ik.cpp
===================================================================
--- pkg/trunk/util/pr2_ik/src/pr2_ik.cpp 2009-07-24 17:49:15 UTC (rev 19581)
+++ pkg/trunk/util/pr2_ik/src/pr2_ik.cpp 2009-07-24 17:58:52 UTC (rev 19582)
@@ -351,7 +351,7 @@
#ifdef DEBUG
std::cout << "t4 " << t4 << std::endl;
#endif
- if(isnan(t4))
+ if(std::isnan(t4))
continue;
if(!checkJointLimits(t4,3))
@@ -567,7 +567,7 @@
#ifdef DEBUG
std::cout << "t4 " << t4 << std::endl;
#endif
- if(isnan(t4))
+ if(std::isnan(t4))
continue;
at = cos(t3)*sin(t4)*(ap_[1]-ap_[3]);
bt = (ap_[0]-ap_[1]+(ap_[1]-ap_[3])*cos(t4));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hsu...@us...> - 2009-07-24 18:47:24
|
Revision: 19587
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19587&view=rev
Author: hsujohnhsu
Date: 2009-07-24 18:47:15 +0000 (Fri, 24 Jul 2009)
Log Message:
-----------
update slide test due to pr2 mass change.
Modified Paths:
--------------
pkg/trunk/drivers/simulator/test_pr2_collision_gazebo/test_slide.py
pkg/trunk/robot_descriptions/gazebo_worlds/worlds/slide.world
Modified: pkg/trunk/drivers/simulator/test_pr2_collision_gazebo/test_slide.py
===================================================================
--- pkg/trunk/drivers/simulator/test_pr2_collision_gazebo/test_slide.py 2009-07-24 18:40:27 UTC (rev 19586)
+++ pkg/trunk/drivers/simulator/test_pr2_collision_gazebo/test_slide.py 2009-07-24 18:47:15 UTC (rev 19587)
@@ -46,7 +46,7 @@
from robot_msgs.msg import *
TEST_DURATION = 90.0
-TARGET_X = -5.4 + 25.65 #contains offset specified in P3D for base, alternatively, use the gripper roll ground truths
+TARGET_X = -6.0 + 25.65 #contains offset specified in P3D for base, alternatively, use the gripper roll ground truths
TARGET_Y = 0.0 + 25.65 #contains offset specified in P3D for base, alternatively, use the gripper roll ground truths
TARGET_Z = 3.8
TARGET_RAD = 4.5
Modified: pkg/trunk/robot_descriptions/gazebo_worlds/worlds/slide.world
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_worlds/worlds/slide.world 2009-07-24 18:40:27 UTC (rev 19586)
+++ pkg/trunk/robot_descriptions/gazebo_worlds/worlds/slide.world 2009-07-24 18:47:15 UTC (rev 19587)
@@ -111,7 +111,7 @@
<model:physical name="endbin_model">
- <xyz> -5.4 0.0 2.6</xyz>
+ <xyz> -6.0 0.0 2.6</xyz>
<rpy> 90.0 0.0 90.0</rpy>
<static>true</static>
<body:trimesh name="endbin_body">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mee...@us...> - 2009-07-24 20:52:02
|
Revision: 19609
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19609&view=rev
Author: meeussen
Date: 2009-07-24 20:51:46 +0000 (Fri, 24 Jul 2009)
Log Message:
-----------
move movetopose service from robot srvs to deprecated srvs
Modified Paths:
--------------
pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/cartesian_trajectory_controller.h
pkg/trunk/controllers/robot_mechanism_controllers/manifest.xml
pkg/trunk/controllers/robot_mechanism_controllers/src/cartesian_trajectory_controller.cpp
pkg/trunk/demos/plug_in/move_to_pickup.py
pkg/trunk/demos/plug_in/plug_in.py
pkg/trunk/demos/plug_in/plug_in2.py
pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_grasp_handle.h
pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_open_door.h
pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_push_door.h
pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_release_handle.h
pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_touch_door.h
pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_unlatch_handle.h
pkg/trunk/highlevel/doors/doors_core/manifest.xml
pkg/trunk/highlevel/plugs/plugs_core/include/plugs_core/action_localize_plug_in_gripper.h
pkg/trunk/highlevel/plugs/plugs_core/include/plugs_core/action_move_and_grasp_plug.h
pkg/trunk/highlevel/plugs/plugs_core/include/plugs_core/action_stow_plug.h
pkg/trunk/highlevel/plugs/plugs_core/manifest.xml
Added Paths:
-----------
pkg/trunk/deprecated/deprecated_srvs/MoveToPose.srv
Removed Paths:
-------------
pkg/trunk/stacks/common_msgs/robot_srvs/srv/MoveToPose.srv
Modified: pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/cartesian_trajectory_controller.h
===================================================================
--- pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/cartesian_trajectory_controller.h 2009-07-24 20:41:39 UTC (rev 19608)
+++ pkg/trunk/controllers/robot_mechanism_controllers/include/robot_mechanism_controllers/cartesian_trajectory_controller.h 2009-07-24 20:51:46 UTC (rev 19609)
@@ -45,7 +45,7 @@
#include <robot_msgs/PoseStamped.h>
#include <mechanism_model/controller.h>
#include <robot_mechanism_controllers/cartesian_pose_controller.h>
-#include <robot_srvs/MoveToPose.h>
+#include <deprecated_srvs/MoveToPose.h>
#include <std_srvs/Empty.h>
#include <boost/scoped_ptr.hpp>
@@ -73,7 +73,7 @@
void command(const tf::MessageNotifier<robot_msgs::PoseStamped>::MessagePtr& pose_msg);
// service calls
- bool moveTo(robot_srvs::MoveToPose::Request &req, robot_srvs::MoveToPose::Response &resp);
+ bool moveTo(deprecated_srvs::MoveToPose::Request &req, deprecated_srvs::MoveToPose::Response &resp);
bool preempt(std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp);
ros::Node* node_;
Modified: pkg/trunk/controllers/robot_mechanism_controllers/manifest.xml
===================================================================
--- pkg/trunk/controllers/robot_mechanism_controllers/manifest.xml 2009-07-24 20:41:39 UTC (rev 19608)
+++ pkg/trunk/controllers/robot_mechanism_controllers/manifest.xml 2009-07-24 20:51:46 UTC (rev 19609)
@@ -15,6 +15,7 @@
<depend package="roscpp" />
<depend package="std_msgs" />
<depend package="robot_srvs" />
+ <depend package="deprecated_srvs" />
<depend package="robot_msgs" />
<depend package="manipulation_msgs" />
<depend package="visualization_msgs" />
Modified: pkg/trunk/controllers/robot_mechanism_controllers/src/cartesian_trajectory_controller.cpp
===================================================================
--- pkg/trunk/controllers/robot_mechanism_controllers/src/cartesian_trajectory_controller.cpp 2009-07-24 20:41:39 UTC (rev 19608)
+++ pkg/trunk/controllers/robot_mechanism_controllers/src/cartesian_trajectory_controller.cpp 2009-07-24 20:51:46 UTC (rev 19609)
@@ -284,8 +284,8 @@
}
-bool CartesianTrajectoryController::moveTo(robot_srvs::MoveToPose::Request &req,
- robot_srvs::MoveToPose::Response &resp)
+bool CartesianTrajectoryController::moveTo(deprecated_srvs::MoveToPose::Request &req,
+ deprecated_srvs::MoveToPose::Response &resp)
{
ROS_INFO("in cartesian traj move_to service");
if (!moveTo(req.pose, req.tolerance, 0.0)){
Modified: pkg/trunk/demos/plug_in/move_to_pickup.py
===================================================================
--- pkg/trunk/demos/plug_in/move_to_pickup.py 2009-07-24 20:41:39 UTC (rev 19608)
+++ pkg/trunk/demos/plug_in/move_to_pickup.py 2009-07-24 20:51:46 UTC (rev 19609)
@@ -15,6 +15,7 @@
from pr2_mechanism_controllers.srv import *
from std_msgs.msg import *
from robot_srvs.srv import *
+from deprecated_srvs.srv import *
import sys
from time import sleep
Modified: pkg/trunk/demos/plug_in/plug_in.py
===================================================================
--- pkg/trunk/demos/plug_in/plug_in.py 2009-07-24 20:41:39 UTC (rev 19608)
+++ pkg/trunk/demos/plug_in/plug_in.py 2009-07-24 20:51:46 UTC (rev 19609)
@@ -35,6 +35,7 @@
import rospy
from robot_msgs.msg import *
from robot_srvs.srv import *
+from deprecated_srvs.srv import *
CONTROLLER = 'arm_constraint'
Modified: pkg/trunk/demos/plug_in/plug_in2.py
===================================================================
--- pkg/trunk/demos/plug_in/plug_in2.py 2009-07-24 20:41:39 UTC (rev 19608)
+++ pkg/trunk/demos/plug_in/plug_in2.py 2009-07-24 20:51:46 UTC (rev 19609)
@@ -36,6 +36,7 @@
import rospy
from robot_msgs.msg import *
from robot_srvs.srv import *
+from deprecated_srvs.srv import *
import tf.transformations
import tf
Copied: pkg/trunk/deprecated/deprecated_srvs/MoveToPose.srv (from rev 19605, pkg/trunk/stacks/common_msgs/robot_srvs/srv/MoveToPose.srv)
===================================================================
--- pkg/trunk/deprecated/deprecated_srvs/MoveToPose.srv (rev 0)
+++ pkg/trunk/deprecated/deprecated_srvs/MoveToPose.srv 2009-07-24 20:51:46 UTC (rev 19609)
@@ -0,0 +1,3 @@
+robot_msgs/PoseStamped pose
+robot_msgs/Twist tolerance
+---
Property changes on: pkg/trunk/deprecated/deprecated_srvs/MoveToPose.srv
___________________________________________________________________
Added: svn:mergeinfo
+ /pkg/branches/gazebo-branch-merge/common/robot_srvs/srv/MoveToPose.srv:15683-15684,15739-15794,15797-15820,15822-15839,15852-15870,15983-16008,16010-16016,16129-16141,16145-16169,16245-16262,16274-16334
Modified: pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_grasp_handle.h
===================================================================
--- pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_grasp_handle.h 2009-07-24 20:41:39 UTC (rev 19608)
+++ pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_grasp_handle.h 2009-07-24 20:51:46 UTC (rev 19609)
@@ -46,7 +46,7 @@
#include <std_srvs/Empty.h>
#include <tf/tf.h>
#include <tf/transform_listener.h>
-#include <robot_srvs/MoveToPose.h>
+#include <deprecated_srvs/MoveToPose.h>
#include <kdl/frames.hpp>
#include <robot_actions/action.h>
@@ -66,8 +66,8 @@
tf::TransformListener& tf_;
- robot_srvs::MoveToPose::Request req_moveto;
- robot_srvs::MoveToPose::Response res_moveto;
+ deprecated_srvs::MoveToPose::Request req_moveto;
+ deprecated_srvs::MoveToPose::Response res_moveto;
};
}
Modified: pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_open_door.h
===================================================================
--- pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_open_door.h 2009-07-24 20:41:39 UTC (rev 19608)
+++ pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_open_door.h 2009-07-24 20:51:46 UTC (rev 19609)
@@ -42,7 +42,7 @@
#include <manipulation_msgs/TaskFrameFormalism.h>
#include <tf/tf.h>
#include <tf/transform_listener.h>
-#include <robot_srvs/MoveToPose.h>
+#include <deprecated_srvs/MoveToPose.h>
#include <kdl/frames.hpp>
#include <robot_actions/action.h>
#include <boost/thread/mutex.hpp>
Modified: pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_push_door.h
===================================================================
--- pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_push_door.h 2009-07-24 20:41:39 UTC (rev 19608)
+++ pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_push_door.h 2009-07-24 20:51:46 UTC (rev 19609)
@@ -46,7 +46,7 @@
#include <std_srvs/Empty.h>
#include <tf/tf.h>
#include <tf/transform_listener.h>
-#include <robot_srvs/MoveToPose.h>
+#include <deprecated_srvs/MoveToPose.h>
#include <kdl/frames.hpp>
#include <robot_actions/action.h>
#include <boost/thread/mutex.hpp>
Modified: pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_release_handle.h
===================================================================
--- pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_release_handle.h 2009-07-24 20:41:39 UTC (rev 19608)
+++ pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_release_handle.h 2009-07-24 20:51:46 UTC (rev 19609)
@@ -46,7 +46,7 @@
#include <std_srvs/Empty.h>
#include <tf/tf.h>
#include <tf/transform_listener.h>
-#include <robot_srvs/MoveToPose.h>
+#include <deprecated_srvs/MoveToPose.h>
#include <kdl/frames.hpp>
#include <robot_actions/action.h>
#include <boost/thread/mutex.hpp>
@@ -78,8 +78,8 @@
std_srvs::Empty::Request req_empty;
std_srvs::Empty::Response res_empty;
- robot_srvs::MoveToPose::Request req_moveto;
- robot_srvs::MoveToPose::Response res_moveto;
+ deprecated_srvs::MoveToPose::Request req_moveto;
+ deprecated_srvs::MoveToPose::Response res_moveto;
};
}
Modified: pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_touch_door.h
===================================================================
--- pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_touch_door.h 2009-07-24 20:41:39 UTC (rev 19608)
+++ pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_touch_door.h 2009-07-24 20:51:46 UTC (rev 19609)
@@ -46,7 +46,7 @@
#include <std_srvs/Empty.h>
#include <tf/tf.h>
#include <tf/transform_listener.h>
-#include <robot_srvs/MoveToPose.h>
+#include <deprecated_srvs/MoveToPose.h>
#include <kdl/frames.hpp>
#include <robot_actions/action.h>
@@ -65,8 +65,8 @@
ros::Publisher pub_;
tf::TransformListener& tf_;
- robot_srvs::MoveToPose::Request req_moveto;
- robot_srvs::MoveToPose::Response res_moveto;
+ deprecated_srvs::MoveToPose::Request req_moveto;
+ deprecated_srvs::MoveToPose::Response res_moveto;
};
}
Modified: pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_unlatch_handle.h
===================================================================
--- pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_unlatch_handle.h 2009-07-24 20:41:39 UTC (rev 19608)
+++ pkg/trunk/highlevel/doors/doors_core/include/doors_core/action_unlatch_handle.h 2009-07-24 20:51:46 UTC (rev 19609)
@@ -42,7 +42,7 @@
#include <manipulation_msgs/TaskFrameFormalism.h>
#include <tf/tf.h>
#include <tf/transform_listener.h>
-#include <robot_srvs/MoveToPose.h>
+#include <deprecated_srvs/MoveToPose.h>
#include <kdl/frames.hpp>
#include <robot_actions/action.h>
#include <boost/thread/mutex.hpp>
Modified: pkg/trunk/highlevel/doors/doors_core/manifest.xml
===================================================================
--- pkg/trunk/highlevel/doors/doors_core/manifest.xml 2009-07-24 20:41:39 UTC (rev 19608)
+++ pkg/trunk/highlevel/doors/doors_core/manifest.xml 2009-07-24 20:51:46 UTC (rev 19609)
@@ -18,6 +18,7 @@
<depend package="visualization_msgs"/>
<depend package="robot_srvs" />
+ <depend package="deprecated_srvs" />
<depend package="nav_srvs" />
<depend package="robot_actions" />
Modified: pkg/trunk/highlevel/plugs/plugs_core/include/plugs_core/action_localize_plug_in_gripper.h
===================================================================
--- pkg/trunk/highlevel/plugs/plugs_core/include/plugs_core/action_localize_plug_in_gripper.h 2009-07-24 20:41:39 UTC (rev 19608)
+++ pkg/trunk/highlevel/plugs/plugs_core/include/plugs_core/action_localize_plug_in_gripper.h 2009-07-24 20:51:46 UTC (rev 19609)
@@ -47,7 +47,7 @@
#include <std_msgs/Float64.h>
// Srvs
-#include <robot_srvs/MoveToPose.h>
+#include <deprecated_srvs/MoveToPose.h>
#include "robot_srvs/SetPoseStamped.h"
//TF
#include <tf/tf.h>
@@ -96,8 +96,8 @@
tf::Stamped<tf::Pose> plug_pose_;
- robot_srvs::MoveToPose::Request req_pose_;
- robot_srvs::MoveToPose::Response res_pose_;
+ deprecated_srvs::MoveToPose::Request req_pose_;
+ deprecated_srvs::MoveToPose::Response res_pose_;
};
Modified: pkg/trunk/highlevel/plugs/plugs_core/include/plugs_core/action_move_and_grasp_plug.h
===================================================================
--- pkg/trunk/highlevel/plugs/plugs_core/include/plugs_core/action_move_and_grasp_plug.h 2009-07-24 20:41:39 UTC (rev 19608)
+++ pkg/trunk/highlevel/plugs/plugs_core/include/plugs_core/action_move_and_grasp_plug.h 2009-07-24 20:51:46 UTC (rev 19609)
@@ -48,7 +48,7 @@
#include <std_msgs/Float64.h>
// Srvs
-#include <robot_srvs/MoveToPose.h>
+#include <deprecated_srvs/MoveToPose.h>
// Robot Action Stuff
#include <robot_actions/action.h>
@@ -82,8 +82,8 @@
plugs_msgs::PlugStow plug_stow_;
- robot_srvs::MoveToPose::Request req_pose_;
- robot_srvs::MoveToPose::Response res_pose_;
+ deprecated_srvs::MoveToPose::Request req_pose_;
+ deprecated_srvs::MoveToPose::Response res_pose_;
robot_mechanism_controllers::JointControllerState controller_state_msg_;
Modified: pkg/trunk/highlevel/plugs/plugs_core/include/plugs_core/action_stow_plug.h
===================================================================
--- pkg/trunk/highlevel/plugs/plugs_core/include/plugs_core/action_stow_plug.h 2009-07-24 20:41:39 UTC (rev 19608)
+++ pkg/trunk/highlevel/plugs/plugs_core/include/plugs_core/action_stow_plug.h 2009-07-24 20:51:46 UTC (rev 19609)
@@ -48,7 +48,7 @@
#include <std_msgs/Float64.h>
// Srvs
-#include <robot_srvs/MoveToPose.h>
+#include <deprecated_srvs/MoveToPose.h>
// Robot Action Stuff
#include <robot_actions/action.h>
@@ -82,8 +82,8 @@
plugs_msgs::PlugStow plug_stow_;
- robot_srvs::MoveToPose::Request req_pose_;
- robot_srvs::MoveToPose::Response res_pose_;
+ deprecated_srvs::MoveToPose::Request req_pose_;
+ deprecated_srvs::MoveToPose::Response res_pose_;
robot_mechanism_controllers::JointControllerState controller_state_msg_;
Modified: pkg/trunk/highlevel/plugs/plugs_core/manifest.xml
===================================================================
--- pkg/trunk/highlevel/plugs/plugs_core/manifest.xml 2009-07-24 20:41:39 UTC (rev 19608)
+++ pkg/trunk/highlevel/plugs/plugs_core/manifest.xml 2009-07-24 20:51:46 UTC (rev 19609)
@@ -11,6 +11,7 @@
<depend package="roscpp" />
<depend package="robot_msgs" />
<depend package="robot_srvs" />
+ <depend package="deprecated_srvs" />
<depend package="mechanism_msgs" />
<depend package="std_msgs" />
<depend package="robot_actions" />
Deleted: pkg/trunk/stacks/common_msgs/robot_srvs/srv/MoveToPose.srv
===================================================================
--- pkg/trunk/stacks/common_msgs/robot_srvs/srv/MoveToPose.srv 2009-07-24 20:41:39 UTC (rev 19608)
+++ pkg/trunk/stacks/common_msgs/robot_srvs/srv/MoveToPose.srv 2009-07-24 20:51:46 UTC (rev 19609)
@@ -1,3 +0,0 @@
-robot_msgs/PoseStamped pose
-robot_msgs/Twist tolerance
----
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ale...@us...> - 2009-07-24 21:25:29
|
Revision: 19620
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19620&view=rev
Author: alexteichman
Date: 2009-07-24 21:25:18 +0000 (Fri, 24 Jul 2009)
Log Message:
-----------
Robustifying the daisy makefile.
Modified Paths:
--------------
pkg/trunk/3rdparty/daisy/Makefile
pkg/trunk/3rdparty/daisy/manifest.xml
pkg/trunk/sandbox/image_descriptors_gpl/image_descriptors_gpl.cpp
Modified: pkg/trunk/3rdparty/daisy/Makefile
===================================================================
--- pkg/trunk/3rdparty/daisy/Makefile 2009-07-24 21:23:12 UTC (rev 19619)
+++ pkg/trunk/3rdparty/daisy/Makefile 2009-07-24 21:25:18 UTC (rev 19620)
@@ -1,16 +1,22 @@
-all: installed
+all: daisy
+ifneq ($(wildcard daisy_makefile),) #Clean up cruft from previous makefile.
+ ls | grep -v Makefile | grep -v Makefile.old | grep -v makefile.patch | grep -v manifest.xml | grep -v build | xargs rm -r; fi
+endif
+TARBALL = build/daisy-1.7.0.tar.gz
+TARBALL_URL = http://cvlab.epfl.ch/~tola/research/08/daisy/daisy-1.7.0.tar.gz
+SOURCE_DIR = build/daisy-1.7.0
+TARBALL_PATCH = makefile.patch
+include $(shell rospack find mk)/download_unpack_build.mk
-installed:
- wget http://cvlab.epfl.ch/~tola/research/08/daisy/daisy-1.7.0.tar.gz
- tar xvzf daisy-1.7.0.tar.gz
- mv daisy-1.7.0/* .
- rm -rf daisy-1.7.0
- patch makefile < makefile.patch
- mv makefile daisy_makefile
- make -f daisy_makefile slib
- touch installed
+daisy: $(SOURCE_DIR)/unpacked
+ifeq ($(wildcard $(SOURCE_DIR)/lib/libdaisy.so),)
+ cd $(SOURCE_DIR) && make -f makefile slib
+endif
clean:
- ls | grep -v Makefile | grep -v patch | grep -v manifest.xml | xargs rm -r
\ No newline at end of file
+ -rm -rf $(SOURCE_DIR)
+
+wipe: clean
+ -rm -rf build
Modified: pkg/trunk/3rdparty/daisy/manifest.xml
===================================================================
--- pkg/trunk/3rdparty/daisy/manifest.xml 2009-07-24 21:23:12 UTC (rev 19619)
+++ pkg/trunk/3rdparty/daisy/manifest.xml 2009-07-24 21:25:18 UTC (rev 19620)
@@ -9,7 +9,7 @@
<review status="unreviewed" notes=""/>
<url>http://cvlab.epfl.ch/~tola/daisy.html</url>
<export>
- <cpp cflags="-I${prefix}/include" lflags="-L${prefix}/lib -ldaisy -Wl,-rpath,${prefix}/lib" />
+ <cpp cflags="-I${prefix}/build/daisy-1.7.0/include/" lflags="-L${prefix}/build/daisy-1.7.0/lib/ -ldaisy -Wl,-rpath,${prefix}/build/daisy-1.7.0/lib/" />
</export>
</package>
Modified: pkg/trunk/sandbox/image_descriptors_gpl/image_descriptors_gpl.cpp
===================================================================
--- pkg/trunk/sandbox/image_descriptors_gpl/image_descriptors_gpl.cpp 2009-07-24 21:23:12 UTC (rev 19619)
+++ pkg/trunk/sandbox/image_descriptors_gpl/image_descriptors_gpl.cpp 2009-07-24 21:25:18 UTC (rev 19620)
@@ -23,6 +23,9 @@
dai.set_parameters(rad_, rad_q_no_, th_q_no_, hist_th_q_no_);
dai.set_normalization(NRM_FULL);
dai.initialize_single_descriptor_mode();
+ int ws = dai.compute_workspace_memory();
+ float* workspace = new float[ ws ];
+ dai.set_workspace_memory( workspace, ws);
result_size_ = dai.descriptor_size();
}
@@ -33,23 +36,23 @@
void Daisy::compute(IplImage* img, const cv::Vector<Keypoint>& points, vvf& results) {
// -- Stupid way to pass img to daisy.
+ char filename[] = "temp.pgm";
IplImage* gray = cvCreateImage(cvGetSize(img), IPL_DEPTH_8U, 1);
cvCvtColor(img, gray, CV_BGR2GRAY);
- cvSaveImage("temp.png", gray);
+ cvSaveImage(filename, gray);
uchar* im = NULL;
- load_gray_image("temp.png", im, img->height, img->width);
+ load_gray_image(filename, im, img->height, img->width);
dai.set_image(im, img->height, img->width);
results.clear();
results.resize(points.size());
- int orientation = 0;
int nValid = 0;
for(size_t i=0; i<points.size(); ++i) {
// -- Get the descriptor.
float* thor = new float[result_size_];
memset(thor, 0, sizeof(float)*result_size_);
- dai.get_descriptor(points[i].pt.y, points[i].pt.x, orientation, thor);
+ dai.get_descriptor((int)points[i].pt.y, (int)points[i].pt.x, thor);
// -- Check if it's all zeros.
bool valid = false;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ei...@us...> - 2009-07-24 22:03:56
|
Revision: 19633
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=19633&view=rev
Author: eitanme
Date: 2009-07-24 22:03:46 +0000 (Fri, 24 Jul 2009)
Log Message:
-----------
Merging the new actions from a branch back into trunk.
r28694@att (orig r19424): eitanme | 2009-07-22 13:06:07 -0700
Creating a branch for developing the new action interface
r28695@att (orig r19425): eitanme | 2009-07-22 13:09:21 -0700
Initial commit of some janky code, but we're in a branch so its ok. Don't expect it to compile though.
r28705@att (orig r19435): vijaypradeep | 2009-07-22 14:30:59 -0700
Moving old action client
r28706@att (orig r19436): vijaypradeep | 2009-07-22 14:31:48 -0700
Definitely not going to compile
r28707@att (orig r19437): vijaypradeep | 2009-07-22 14:32:05 -0700
Changed header to action_header
r28711@att (orig r19441): eitanme | 2009-07-22 14:52:18 -0700
Compiling version of a first cut at the server.
r28741@att (orig r19460): vijaypradeep | 2009-07-22 15:57:36 -0700
Lots of Message Changes
r28751@att (orig r19467): eitanme | 2009-07-22 16:49:07 -0700
Now compiles with the new messages... hooray
r28753@att (orig r19469): eitanme | 2009-07-22 16:54:27 -0700
Now publishes a StatusArray over the wire
r28757@att (orig r19473): eitanme | 2009-07-22 17:12:49 -0700
Removing the ActionHeader, GoalStatus contains a GoalID, and ActionGoals will also contain a GoalID
r28762@att (orig r19478): vijaypradeep | 2009-07-22 17:23:22 -0700
Still chugging along
r28765@att (orig r19481): eitanme | 2009-07-22 17:41:56 -0700
Support for sending results over the wire
r28767@att (orig r19483): eitanme | 2009-07-22 18:01:15 -0700
Now reads status from the parameter server
r28771@att (orig r19486): eitanme | 2009-07-22 18:16:06 -0700
Removing some unecessary includes
r28772@att (orig r19487): eitanme | 2009-07-22 18:20:32 -0700
Making all the tracking stuff private
r28811@att (orig r19518): eitanme | 2009-07-23 10:52:56 -0700
Checks for uninitialized GoalHandles
r28824@att (orig r19523): eitanme | 2009-07-23 13:15:12 -0700
Adding checks for illegal state transitions on a GoalHandle with appropriate errors
r28846@att (orig r19544): eitanme | 2009-07-23 17:54:56 -0700
Working version of the SingleGoalActionServer
r28847@att (orig r19545): eitanme | 2009-07-23 17:55:22 -0700
Working version of the new move_base with the SingleGoalActionServer
r28858@att (orig r19556): eitanme | 2009-07-23 19:29:38 -0700
Adding Doxygen so at the next api review we can just pull it up and not have to worry about writing anything
r28859@att (orig r19557): eitanme | 2009-07-23 19:32:00 -0700
Now uses move_base_new
r28861@att (orig r19559): eitanme | 2009-07-23 20:11:41 -0700
Checking in messages I missed
r28868@att (orig r19566): eitanme | 2009-07-23 20:37:07 -0700
Explicit preempt policy
r28869@att (orig r19567): vijaypradeep | 2009-07-23 21:07:47 -0700
First cut of multigoal ActionClient seems to run
r28873@att (orig r19570): vijaypradeep | 2009-07-23 23:31:18 -0700
Timers don't work yet, but the rest of the ActionClient seems to work
r28874@att (orig r19571): vijaypradeep | 2009-07-23 23:45:00 -0700
Minor fixes
r28891@att (orig r19583): eitanme | 2009-07-24 11:06:02 -0700
SingleActionGoalServer now works well with the preempt policy implemented in the ActionServer class
r28893@att (orig r19584): eitanme | 2009-07-24 11:19:58 -0700
Adding a bunch of ROS_DEBUG statements, hopefully this will help later
r28896@att (orig r19585): vijaypradeep | 2009-07-24 11:28:58 -0700
Added feedback to ActionClient. Started doxygenating
r28905@att (orig r19591): vijaypradeep | 2009-07-24 12:11:38 -0700
Started populating the mainpage
r28922@att (orig r19607): vijaypradeep | 2009-07-24 13:38:12 -0700
More dox
r28926@att (orig r19610): vijaypradeep | 2009-07-24 13:54:36 -0700
Moving action_tools to actionlib
r28927@att (orig r19611): vijaypradeep | 2009-07-24 13:57:14 -0700
Fixing move base
r28945@att (orig r19629): eitanme | 2009-07-24 14:58:38 -0700
Encapsulating result_type in its own message which holds the relevant enum so users don't have to re-create it
Modified Paths:
--------------
pkg/trunk/highlevel/move_base_stage/move_base/move_base.xml
pkg/trunk/stacks/nav/move_base/include/move_base/move_base.h
pkg/trunk/stacks/nav/move_base/manifest.xml
pkg/trunk/stacks/nav/move_base/msg/MoveBaseGoal.msg
pkg/trunk/stacks/nav/move_base/msg/MoveBaseResult.msg
pkg/trunk/stacks/nav/move_base/src/move_base.cpp
Added Paths:
-----------
pkg/trunk/sandbox/actionlib/
pkg/trunk/sandbox/actionlib/CMakeLists.txt
pkg/trunk/sandbox/actionlib/Makefile
pkg/trunk/sandbox/actionlib/include/
pkg/trunk/sandbox/actionlib/include/actionlib/
pkg/trunk/sandbox/actionlib/include/actionlib/action_client.h
pkg/trunk/sandbox/actionlib/include/actionlib/action_server.h
pkg/trunk/sandbox/actionlib/include/actionlib/client_goal_status.h
pkg/trunk/sandbox/actionlib/include/actionlib/enclosure_deleter.h
pkg/trunk/sandbox/actionlib/include/actionlib/goal_id_generator.h
pkg/trunk/sandbox/actionlib/include/actionlib/old_action_client.h
pkg/trunk/sandbox/actionlib/include/actionlib/one_shot_timer.h
pkg/trunk/sandbox/actionlib/include/actionlib/single_goal_action_server.h
pkg/trunk/sandbox/actionlib/mainpage.dox
pkg/trunk/sandbox/actionlib/manifest.xml
pkg/trunk/sandbox/actionlib/msg/
pkg/trunk/sandbox/actionlib/msg/GoalID.msg
pkg/trunk/sandbox/actionlib/msg/GoalStatus.msg
pkg/trunk/sandbox/actionlib/msg/GoalStatusArray.msg
pkg/trunk/sandbox/actionlib/msg/MoveBaseAction.msg
pkg/trunk/sandbox/actionlib/msg/MoveBaseActionFeedback.msg
pkg/trunk/sandbox/actionlib/msg/MoveBaseActionGoal.msg
pkg/trunk/sandbox/actionlib/msg/MoveBaseActionResult.msg
pkg/trunk/sandbox/actionlib/msg/MoveBaseFeedback.msg
pkg/trunk/sandbox/actionlib/msg/MoveBaseGoal.msg
pkg/trunk/sandbox/actionlib/msg/MoveBaseResult.msg
pkg/trunk/sandbox/actionlib/msg/RequestType.msg
pkg/trunk/sandbox/actionlib/msg/TestActionGoal.msg
pkg/trunk/sandbox/actionlib/msg/TestActionResult.msg
pkg/trunk/sandbox/actionlib/msg/TestGoal.msg
pkg/trunk/sandbox/actionlib/msg/TestResult.msg
pkg/trunk/sandbox/actionlib/src/
pkg/trunk/sandbox/actionlib/src/move_base_client.cpp
pkg/trunk/sandbox/actionlib/src/move_base_client_old.cpp
pkg/trunk/sandbox/actionlib/src/move_base_server.cpp
pkg/trunk/stacks/nav/move_base/msg/MoveBaseAction.msg
pkg/trunk/stacks/nav/move_base/msg/MoveBaseActionFeedback.msg
pkg/trunk/stacks/nav/move_base/msg/MoveBaseActionGoal.msg
pkg/trunk/stacks/nav/move_base/msg/MoveBaseActionResult.msg
pkg/trunk/stacks/nav/move_base/msg/MoveBaseFeedback.msg
Removed Paths:
-------------
pkg/trunk/sandbox/action_tools/CMakeLists.txt
pkg/trunk/sandbox/action_tools/Makefile
pkg/trunk/sandbox/action_tools/include/action_tools/EnclosureDeleter.h
pkg/trunk/sandbox/action_tools/include/action_tools/action_client.h
pkg/trunk/sandbox/action_tools/include/action_tools/action_server.h
pkg/trunk/sandbox/action_tools/include/action_tools/one_shot_timer.h
pkg/trunk/sandbox/action_tools/mainpage.dox
pkg/trunk/sandbox/action_tools/manifest.xml
pkg/trunk/sandbox/action_tools/msg/GoalID.msg
pkg/trunk/sandbox/action_tools/msg/GoalStatus.msg
pkg/trunk/sandbox/action_tools/msg/MoveBaseGoal.msg
pkg/trunk/sandbox/action_tools/msg/MoveBaseResult.msg
pkg/trunk/sandbox/action_tools/msg/Preempt.msg
pkg/trunk/sandbox/action_tools/msg/TestActionGoal.msg
pkg/trunk/sandbox/action_tools/msg/TestActionResult.msg
pkg/trunk/sandbox/action_tools/msg/TestGoal.msg
pkg/trunk/sandbox/action_tools/msg/TestResult.msg
pkg/trunk/sandbox/action_tools/src/move_base_client.cpp
pkg/trunk/sandbox/action_tools/src/move_base_server.cpp
Property Changed:
----------------
pkg/trunk/
Property changes on: pkg/trunk
___________________________________________________________________
Modified: svk:merge
- 637b03a7-42c1-4bbd-8d43-e365e379942c:/prfilters:13971
637b03a7-42c1-4bbd-8d43-e365e379942c:/rosTF_to_tf:9746
920d6130-5740-4ec1-bb1a-45963d5fd813:/costmap_rework_branch:20583
920d6130-5740-4ec1-bb1a-45963d5fd813:/frameidpr:7015
920d6130-5740-4ec1-bb1a-45963d5fd813:/nav_rework:21482
920d6130-5740-4ec1-bb1a-45963d5fd813:/users/josh-pr:11755
920d6130-5740-4ec1-bb1a-45963d5fd813:/wgpkgtrunk:5865
f5854215-dd47-0410-b2c4-cdd35faa7885:/pkg/branches/josh:10136
f5854215-dd47-0410-b2c4-cdd35faa7885:/pkg/branches/milestone2:16602
f5854215-dd47-0410-b2c4-cdd35faa7885:/pkg/branches/nav_rework:17337
f5854215-dd47-0410-b2c4-cdd35faa7885:/pkg/branches/rosbus:261
f5854215-dd47-0410-b2c4-cdd35faa7885:/pkg/tags/milestone2_tags/milestone2_final:16577
+ 637b03a7-42c1-4bbd-8d43-e365e379942c:/prfilters:13971
637b03a7-42c1-4bbd-8d43-e365e379942c:/rosTF_to_tf:9746
920d6130-5740-4ec1-bb1a-45963d5fd813:/costmap_rework_branch:20583
920d6130-5740-4ec1-bb1a-45963d5fd813:/frameidpr:7015
920d6130-5740-4ec1-bb1a-45963d5fd813:/nav_rework:21482
920d6130-5740-4ec1-bb1a-45963d5fd813:/users/josh-pr:11755
920d6130-5740-4ec1-bb1a-45963d5fd813:/wgpkgtrunk:5865
f5854215-dd47-0410-b2c4-cdd35faa7885:/pkg/branches/action_branch:19631
f5854215-dd47-0410-b2c4-cdd35faa7885:/pkg/branches/josh:10136
f5854215-dd47-0410-b2c4-cdd35faa7885:/pkg/branches/milestone2:16602
f5854215-dd47-0410-b2c4-cdd35faa7885:/pkg/branches/nav_rework:17337
f5854215-dd47-0410-b2c4-cdd35faa7885:/pkg/branches/rosbus:261
f5854215-dd47-0410-b2c4-cdd35faa7885:/pkg/tags/milestone2_tags/milestone2_final:16577
Modified: pkg/trunk/highlevel/move_base_stage/move_base/move_base.xml
===================================================================
--- pkg/trunk/highlevel/move_base_stage/move_base/move_base.xml 2009-07-24 22:00:51 UTC (rev 19632)
+++ pkg/trunk/highlevel/move_base_stage/move_base/move_base.xml 2009-07-24 22:03:46 UTC (rev 19633)
@@ -1,5 +1,5 @@
<launch>
- <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
+ <node pkg="move_base" type="move_base_new" respawn="false" name="move_base" output="screen">
<param name="footprint_padding" value="0.01" />
<rosparam file="$(find move_base_stage)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
Deleted: pkg/trunk/sandbox/action_tools/CMakeLists.txt
===================================================================
--- pkg/trunk/sandbox/action_tools/CMakeLists.txt 2009-07-24 22:00:51 UTC (rev 19632)
+++ pkg/trunk/sandbox/action_tools/CMakeLists.txt 2009-07-24 22:03:46 UTC (rev 19633)
@@ -1,25 +0,0 @@
-cmake_minimum_required(VERSION 2.4.6)
-include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
-
-# Set the build type. Options are:
-# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage
-# Debug : w/ debug symbols, w/o optimization
-# Release : w/o debug symbols, w/ optimization
-# RelWithDebInfo : w/ debug symbols, w/ optimization
-# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries
-#set(ROS_BUILD_TYPE RelWithDebInfo)
-
-rospack(action_tools)
-
-#set the default path for built executables to the "bin" directory
-set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
-
-#set the default path for built libraries to the "lib" directory
-set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
-
-genmsg()
-
-rospack_add_executable(move_base_server src/move_base_server.cpp)
-rospack_add_executable(move_base_client src/move_base_client.cpp)
-
-#add_subdirectory(test)
Deleted: pkg/trunk/sandbox/action_tools/Makefile
===================================================================
--- pkg/trunk/sandbox/action_tools/Makefile 2009-07-24 22:00:51 UTC (rev 19632)
+++ pkg/trunk/sandbox/action_tools/Makefile 2009-07-24 22:03:46 UTC (rev 19633)
@@ -1 +0,0 @@
-include $(shell rospack find mk)/cmake.mk
\ No newline at end of file
Deleted: pkg/trunk/sandbox/action_tools/include/action_tools/EnclosureDeleter.h
===================================================================
--- pkg/trunk/sandbox/action_tools/include/action_tools/EnclosureDeleter.h 2009-07-24 22:00:51 UTC (rev 19632)
+++ pkg/trunk/sandbox/action_tools/include/action_tools/EnclosureDeleter.h 2009-07-24 22:03:46 UTC (rev 19633)
@@ -1,70 +0,0 @@
-/*********************************************************************
-*
-* Software License Agreement (BSD License)
-*
-* Copyright (c) 2008, Willow Garage, Inc.
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions
-* are met:
-*
-* * Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-* * Redistributions in binary form must reproduce the above
-* copyright notice, this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided
-* with the distribution.
-* * Neither the name of Willow Garage, Inc. nor the names of its
-* contributors may be used to endorse or promote products derived
-* from this software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*
-* Author: Eitan Marder-Eppstein
-*********************************************************************/
-
-#include <boost/shared_ptr.hpp>
-
-#ifndef ACTION_TOOLS_ENCLOSURE_DELETER_H_
-#define ACTION_TOOLS_ENCLOSURE_DELETER_H_
-
-namespace action_tools
-{
-
-/*
- * This allows the creation of a shared pointer to a section
- * of an already reference counted structure. For example,
- * if in the following picture Enclosure is reference counted with
- * a boost::shared_ptr and you want to return a boost::shared_ptr
- * to the Member that is referenced counted along with Enclosure objects
- *
- * Enclosure --------------- <--- Already reference counted
- * -----Member <------- A member of enclosure objects, eg. Enclosure.Member
- */
-template <class Enclosure> class EnclosureDeleter {
- public:
- EnclosureDeleter(const boost::shared_ptr<Enclosure>& enc_ptr) : enc_ptr_(enc_ptr){}
-
- template<class Member> void operator()(Member* member_ptr){
- enc_ptr_.reset();
- }
-
- private:
- boost::shared_ptr<Enclosure> enc_ptr_;
-};
-
-}
-
-#endif
Deleted: pkg/trunk/sandbox/action_tools/include/action_tools/action_client.h
===================================================================
--- pkg/trunk/sandbox/action_tools/include/action_tools/action_client.h 2009-07-24 22:00:51 UTC (rev 19632)
+++ pkg/trunk/sandbox/action_tools/include/action_tools/action_client.h 2009-07-24 22:03:46 UTC (rev 19633)
@@ -1,601 +0,0 @@
-/*********************************************************************
-* Software License Agreement (BSD License)
-*
-* Copyright (c) 2008, Willow Garage, Inc.
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions
-* are met:
-*
-* * Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-* * Redistributions in binary form must reproduce the above
-* copyright notice, this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided
-* with the distribution.
-* * Neither the name of the Willow Garage nor the names of its
-* contributors may be used to endorse or promote products derived
-* from this software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*********************************************************************/
-
-#ifndef ACTION_TOOLS_ROBUST_ACTION_CLIENT_H_
-#define ACTION_TOOLS_ROBUST_ACTION_CLIENT_H_
-
-#include <boost/thread.hpp>
-#include "ros/ros.h"
-#include "action_tools/GoalStatus.h"
-#include "action_tools/Preempt.h"
-#include "action_tools/EnclosureDeleter.h"
-
-#include "action_tools/one_shot_timer.h"
-
-#define setState(next_state) \
-{ \
- ROS_DEBUG("Setting ClientState to " #next_state);\
- client_state_ = next_state;\
-}
-
-namespace action_tools
-{
-
-
-namespace TerminalStatuses
-{
- enum TerminalStatus { REJECTED, PREEMPTED, SUCCEEDED, ABORTED, TIMED_OUT, IGNORED, LOST } ;
-}
-
-
-template <class ActionGoal, class Goal, class ActionResult, class Result>
-class ActionClient
-{
-public:
- typedef boost::function<void (const TerminalStatuses::TerminalStatus&, const boost::shared_ptr<const Result>&)> CompletionCallback;
- typedef boost::function<void ()> AckTimeoutCallback;
- typedef boost::function<void ()> PreemptTimeoutCallback;
- typedef ActionClient<ActionGoal, Goal, ActionResult, Result> ActionClientT;
- typedef boost::function<void (void)> FilledCompletionCallback;
- typedef boost::shared_ptr<const ActionResult> ActionResultConstPtr;
- typedef boost::shared_ptr<const Result> ResultConstPtr;
- //typedef boost::function<void (const ros::TimerEvent& e)> AckTimeoutCallback;
-
- ActionClient(std::string name, ros::NodeHandle nh = ros::NodeHandle(),
- bool expecting_result=false,
- const ros::Duration& server_status_timeout = ros::Duration(5,0)) : nh_(nh, name)
- {
- // Initialize all One Shot Timers
- ack_timer_.registerOneShotCb(boost::bind(&ActionClientT::ackTimeoutCallback, this, _1));
- runtime_timer_.registerOneShotCb(boost::bind(&ActionClientT::runtimeTimeoutCallback, this, _1));
- wait_for_preempted_timer_.registerOneShotCb(boost::bind(&ActionClientT::waitForPreemptedTimeoutCallback, this, _1));
- comm_sync_timer_.registerOneShotCb(boost::bind(&ActionClientT::commSyncTimeoutCallback, this, _1));
-
- setState(IDLE);
- expecting_result_ = expecting_result;
-
- goal_pub_ = nh_.advertise<ActionGoal> ("goal", 1);
- preempt_pub_ = nh_.advertise<Preempt> ("preempt", 1);
- status_sub_ = nh_.subscribe("status", 1, &ActionClientT::statusCallback, this);
- result_sub_ = nh_.subscribe("result", 1, &ActionClientT::resultCallback, this);
-
- server_status_timeout_ = server_status_timeout;
- startServerStatusTimer();
- }
-
- void execute(const Goal& goal,
- CompletionCallback completion_callback = CompletionCallback(),
- const ros::Duration& runtime_timeout = ros::Duration(0,0),
- AckTimeoutCallback ack_timeout_callback = AckTimeoutCallback(),
- PreemptTimeoutCallback preempt_timeout_callback = PreemptTimeoutCallback(),
- const ros::Duration& ack_timeout = ros::Duration(5,0),
- const ros::Duration& wait_for_preempted_timeout = ros::Duration(5,0),
- const ros::Duration& comm_sync_timeout = ros::Duration(5,0))
- {
- ROS_DEBUG("Got call the execute()");
- boost::mutex::scoped_lock(client_state_mutex_);
-
- if (client_state_ == SERVER_INACTIVE)
- {
- ROS_ERROR("Trying to send an execute command to an inactive server");
- return;
- }
-
- terminal_status_ = TerminalStatuses::TIMED_OUT;
- cur_goal_.header.stamp = ros::Time::now();
- cur_goal_.goal_id.id = cur_goal_.header.stamp;
- cur_goal_.goal = goal;
- result_.reset();
- goal_pub_.publish(cur_goal_);
- setState(WAITING_FOR_ACK);
- runtime_timeout_ = runtime_timeout;
- wait_for_preempted_timeout_ = wait_for_preempted_timeout;
- comm_sync_timeout_ = comm_sync_timeout;
- completion_callback_ = completion_callback;
- ack_timeout_callback_ = ack_timeout_callback;
- preempt_timeout_callback_ = preempt_timeout_callback;
-
- // don't set an ACK timeout for the special case: duration==0
- if (ack_timeout == ros::Duration(0,0))
- ROS_DEBUG("Not setting a timeout for ACK");
- else
- {
- // Set/reset the timeout for WAITING_FOR_GOAL_ACK
- ROS_DEBUG("Starting the [%.2fs] timer for ACK timeout callback", ack_timeout.toSec());
- ack_timer_ = nh_.createTimer(ack_timeout, ack_timer_.getCb());
- }
- }
-
- TerminalStatuses::TerminalStatus waitUntilDone(ResultConstPtr& result)
- {
- ros::Duration sleep_duration = ros::Duration().fromSec(.1);
- while(true)
- {
- {
- boost::mutex::scoped_lock(client_state_mutex_);
- if (client_state_ == IDLE)
- {
- if (expecting_result_ && result_)
- {
- EnclosureDeleter<const ActionResult> d(result_);
- result = ResultConstPtr(&(result_->result), d);
- }
- else
- result = ResultConstPtr();
- return terminal_status_;
- }
- else if (client_state_ == SERVER_INACTIVE)
- {
- if (expecting_result_ && result_)
- {
- EnclosureDeleter<const ActionResult> d(result_);
- result = ResultConstPtr(&(result_->result), d);
- }
- else
- result = ResultConstPtr();
- return TerminalStatuses::TIMED_OUT;
- }
- }
- sleep_duration.sleep();
- }
- }
-
-private:
-
- boost::recursive_mutex client_state_mutex_;
- // ***** Lockset for client_state_mutex_ *****
-
- enum ClientState {SERVER_INACTIVE,IDLE, WAITING_FOR_ACK, PURSUING_GOAL, WAITING_FOR_PREEMPTED, WAITING_FOR_TERMINAL_STATE, WAITING_FOR_RESULT };
- ClientState client_state_;
- bool server_active_;
- ActionGoal cur_goal_;
- TerminalStatuses::TerminalStatus terminal_status_;
- ros::Duration runtime_timeout_; // Maximum time we're willing to stay in {PURSUING_GOAL, WAITING_FOR_TERMINAL_STATE, WAITING_FOR_RESULT} before Preempting
- ros::Duration wait_for_preempted_timeout_; // Maximum time we're willing to stay in WAITING_FOR_PREEMPTED until we release the goal as TIMED_OUT
- ros::Duration comm_sync_timeout_; // Maximum time we're willing to stay in WAITING_FOR_TERMINAL_STATE or WAITING_FOR_RESULT until we release the goal as TIMED_OUT
- bool expecting_result_;
- boost::shared_ptr<const ActionResult> result_;
- CompletionCallback completion_callback_;
- AckTimeoutCallback ack_timeout_callback_;
- PreemptTimeoutCallback preempt_timeout_callback_;
-
- // *******************************************
-
- //boost::recursive_mutex completion_cb_mutex_;
-
- // Various Timers
- OneShotTimer ack_timer_; //!< Tracks timeout in WAITING_FOR_ACK state
- OneShotTimer runtime_timer_; //!< Tracks timeout in PURSUING_GOAL state
- OneShotTimer wait_for_preempted_timer_; //!< Tracks timeout in WAITING_FOR_PREEMPTED state
- OneShotTimer comm_sync_timer_; //!< Tracks timeout in WAITING_FOR_RESULT or WAITING_FOR_TERMINAL_STATE
- ros::Timer server_status_timer_; //!< Forces client_state_ into SERVER_INACTIVE upon not getting status msgs.
- ros::Duration server_status_timeout_; //!< Duration before we decide that the server has 'died'
-
- ros::NodeHandle nh_;
- ros::Publisher goal_pub_;
- ros::Publisher preempt_pub_;
- ros::Subscriber status_sub_;
- ros::Subscriber result_sub_;
-
- void ackTimeoutCallback(const ros::TimerEvent& e)
- {
- boost::mutex::scoped_lock(client_state_mutex_);
- if ( client_state_ == WAITING_FOR_ACK )
- {
- ROS_WARN("Timed out waiting for ACK");
- terminal_status_ = TerminalStatuses::IGNORED;
- if (ack_timeout_callback_)
- ack_timeout_callback_();
- //completion_callback_(TerminalStatuses::IGNORED, ResultConstPtr());
- //setState(IDLE);
- }
- }
-
- void runtimeTimeoutCallback(const ros::TimerEvent& e)
- {
- boost::mutex::scoped_lock(client_state_mutex_);
- if ( client_state_ == PURSUING_GOAL )
- {
- ROS_WARN("Timed out waiting to finish PURSUING_GOAL");
- preemptGoal();
- }
- }
-
- void waitForPreemptedTimeoutCallback(const ros::TimerEvent& e)
- {
- boost::mutex::scoped_lock(client_state_mutex_);
- if ( client_state_ == WAITING_FOR_PREEMPTED )
- {
- ROS_WARN("Timed out waiting to finish WAITING_FOR_PREEMPTED");
- setState(IDLE);
- terminal_status_ = TerminalStatuses::TIMED_OUT;
- if (preempt_timeout_callback_)
- preempt_timeout_callback_();
- //if (completion_callback_)
- // completion_callback_(TerminalStatuses::TIMED_OUT, ResultConstPtr());
- }
- }
-
- /**
- * Handle the case when we've spent too much time in WAITING_FOR_RESULT or
- * WAITING_FOR_TERMINAL_STATE. We've timed out, but at least call the
- * completion callback with as much information as we've got.
- */
- void commSyncTimeoutCallback(const ros::TimerEvent& e)
- {
- boost::mutex::scoped_lock(client_state_mutex_);
- if (client_state_ == WAITING_FOR_TERMINAL_STATE)
- {
- if (!result_)
- ROS_ERROR("BUG: If we're waiting for a terminal state, then result_ MUST exist");
-
- setState(IDLE);
- terminal_status_ = TerminalStatuses::TIMED_OUT;
- if (completion_callback_)
- {
- EnclosureDeleter<const ActionResult> d(result_);
- completion_callback_(TerminalStatuses::TIMED_OUT, ResultConstPtr(&(result_->result), d));
- }
- }
- else if (client_state_ == WAITING_FOR_RESULT)
- {
- setState(IDLE);
- terminal_status_ = TerminalStatuses::TIMED_OUT;
- if (completion_callback_)
- completion_callback_(TerminalStatuses::TIMED_OUT, ResultConstPtr());
- }
- }
-
-
- void serverStatusTimeoutCallback(const ros::TimerEvent& e)
- {
- boost::mutex::scoped_lock(client_state_mutex_);
- if (client_state_ != SERVER_INACTIVE)
- {
- ROS_WARN("Timed out waiting on status pings from ActionServer for [%.2fs]. Assuming server is inactive", server_status_timeout_.toSec());
- setState(SERVER_INACTIVE);
- }
- }
-
- void gotStatusPing()
- {
- boost::mutex::scoped_lock(client_state_mutex_);
- startServerStatusTimer();
- if (client_state_ == SERVER_INACTIVE)
- {
- ROS_INFO("Started receiving status pings from ActionServer again");
- setState(IDLE);
- }
- }
-
- void startServerStatusTimer()
- {
- server_status_timer_ = nh_.createTimer(server_status_timeout_, boost::bind(&ActionClientT::serverStatusTimeoutCallback, this, _1));
- }
-
- void preemptGoal()
- {
- ROS_DEBUG("About to preemptGoal()");
- boost::mutex::scoped_lock(client_state_mutex_);
- if (client_state_ == PURSUING_GOAL || client_state_ == WAITING_FOR_ACK)
- {
- Preempt preempt;
- preempt.goal_id = cur_goal_.goal_id;
- preempt.header.stamp = cur_goal_.goal_id.id;
- preempt_pub_.publish(preempt);
- if (wait_for_preempted_timeout_ != ros::Duration(0,0))
- {
- ROS_DEBUG("Starting the [%.2fs] timer for the WAIT_FOR_PREEMPTED timeout", wait_for_preempted_timeout_.toSec());
- wait_for_preempted_timer_ = nh_.createTimer(wait_for_preempted_timeout_, wait_for_preempted_timer_.getCb());
- }
- else
- ROS_DEBUG("Infinte timeout for WAIT_FOR_PREEMPTED timeout");
- setState(WAITING_FOR_PREEMPTED);
- }
- else
- ROS_DEBUG("Not in a preemptable state (ClientState=%u)", client_state_);
- }
-
- void resultCallback(const ActionResultConstPtr& msg)
- {
- boost::mutex::scoped_lock(client_state_mutex_);
-
- if (client_state_ == IDLE || client_state_ == SERVER_INACTIVE)
- return;
-
- if (isCurrentGoal(msg->goal_id))
- {
- ROS_DEBUG("Got a result msg for this goal id");
- if (!expecting_result_)
- {
- ROS_WARN("ActionClient was told to not expect result msgs, yet we still got one");
- return;
- }
-
- switch(client_state_)
- {
- case WAITING_FOR_ACK:
- ack_timer_.stop();
- goToWaitingForTerminalState(msg);
- break;
- case PURSUING_GOAL:
- runtime_timer_.stop();
- goToWaitingForTerminalState(msg);
- break;
- case WAITING_FOR_PREEMPTED:
- wait_for_preempted_timer_.stop();
- goToWaitingForTerminalState(msg);
- break;
- case WAITING_FOR_RESULT:
- setState(IDLE);
- if (completion_callback_)
- {
- EnclosureDeleter<const ActionResult> d(msg);
- completion_callback_(terminal_status_, ResultConstPtr(&(msg->result), d));
- }
- break;
- case WAITING_FOR_TERMINAL_STATE:
- ROS_WARN("BUG: Got a 2nd ActionResult for the same goal");
- break;
- default:
- ROS_WARN("BUG: Should not ever get to this code");
- break;
- }
- }
- }
-
- void goToWaitingForTerminalState(const ActionResultConstPtr& result)
- {
- boost::mut...
[truncated message content] |