|
From: <is...@us...> - 2008-08-11 22:46:25
|
Revision: 2930
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=2930&view=rev
Author: isucan
Date: 2008-08-11 22:46:32 +0000 (Mon, 11 Aug 2008)
Log Message:
-----------
base class for nodes that are aware of a robot model
Modified Paths:
--------------
pkg/trunk/motion_planning/plan_kinematic_path/src/plan_kinematic_path.cpp
pkg/trunk/world_models/world_3d_map/src/world_3d_map.cpp
Added Paths:
-----------
pkg/trunk/motion_planning/planning_models/include/planning_models/node.h
Modified: pkg/trunk/motion_planning/plan_kinematic_path/src/plan_kinematic_path.cpp
===================================================================
--- pkg/trunk/motion_planning/plan_kinematic_path/src/plan_kinematic_path.cpp 2008-08-11 22:30:19 UTC (rev 2929)
+++ pkg/trunk/motion_planning/plan_kinematic_path/src/plan_kinematic_path.cpp 2008-08-11 22:46:32 UTC (rev 2930)
@@ -74,7 +74,7 @@
req.goal_state.vals[i] = m_basePos[i];
req.start_state.vals[i] = m_basePos[i];
}
- req.goal_state.vals[0] += 4.5;
+ req.goal_state.vals[0] += 2.5;
req.allowed_time = 5.0;
@@ -160,8 +160,8 @@
while (!plan.haveBasePos())
dur.sleep();
- // plan.runTestLeftArm();
- plan.runTestBase();
+ plan.runTestLeftArm();
+ // plan.runTestBase();
plan.shutdown();
Added: pkg/trunk/motion_planning/planning_models/include/planning_models/node.h
===================================================================
--- pkg/trunk/motion_planning/planning_models/include/planning_models/node.h (rev 0)
+++ pkg/trunk/motion_planning/planning_models/include/planning_models/node.h 2008-08-11 22:46:32 UTC (rev 2930)
@@ -0,0 +1,166 @@
+/*********************************************************************
+* 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.
+*********************************************************************/
+
+#include <ros/node.h>
+#include <ros/time.h>
+#include <urdf/URDF.h>
+#include <planning_models/kinematic.h>
+#include <std_msgs/RobotBase2DOdom.h>
+#include <rosTF/rosTF.h>
+
+namespace planning_models
+{
+
+ class NodeWithRobotModel : public ros::node
+ {
+
+ public:
+
+ NodeWithRobotModel(const std::string &robot_model, const std::string &name, uint32_t options = 0) : ros::node(name, options),
+ m_tf(*this, true, 1 * 1000000000ULL, 1000000000ULL)
+ {
+ m_urdf = NULL;
+ m_kmodel = NULL;
+ m_basePos[0] = m_basePos[1] = m_basePos[2] = 0.0;
+ loadRobotDescription(robot_model);
+
+ subscribe("localizedpose", m_localizedPose, &NodeWithRobotModel::localizedPoseCallback);
+ }
+
+ virtual ~NodeWithRobotModel(void)
+ {
+ if (m_urdf)
+ delete m_urdf;
+ if (m_kmodel)
+ delete m_kmodel;
+ }
+
+ void setRobotDescriptionFromData(const char *data)
+ {
+ robot_desc::URDF *file = new robot_desc::URDF();
+ if (file->loadString(data))
+ setRobotDescription(file);
+ else
+ delete file;
+ }
+
+ void setRobotDescriptionFromFile(const char *filename)
+ {
+ robot_desc::URDF *file = new robot_desc::URDF();
+ if (file->loadFile(filename))
+ setRobotDescription(file);
+ else
+ delete file;
+ }
+
+ virtual void setRobotDescription(robot_desc::URDF *file)
+ {
+ if (m_urdf)
+ delete m_urdf;
+ if (m_kmodel)
+ delete m_kmodel;
+
+ m_urdf = file;
+ m_kmodel = new planning_models::KinematicModel();
+ m_kmodel->setVerbose(false);
+ m_kmodel->build(*file);
+ }
+
+ virtual void loadRobotDescription(const std::string &robot_model)
+ {
+ if (!robot_model.empty() && robot_model != "-")
+ {
+ std::string content;
+ if (get_param(robot_model, content))
+ setRobotDescriptionFromData(content.c_str());
+ else
+ fprintf(stderr, "Robot model '%s' not found!\n", robot_model.c_str());
+ }
+ }
+
+ protected:
+
+ void localizedPoseCallback(void)
+ {
+ bool success = true;
+ libTF::TFPose2D pose;
+ pose.x = m_localizedPose.pos.x;
+ pose.y = m_localizedPose.pos.y;
+ pose.yaw = m_localizedPose.pos.th;
+ pose.time = m_localizedPose.header.stamp.to_ull();
+ pose.frame = m_localizedPose.header.frame_id;
+
+ try
+ {
+ pose = m_tf.transformPose2D("FRAMEID_MAP", pose);
+ }
+ catch(libTF::TransformReference::LookupException& ex)
+ {
+ fprintf(stderr, "Discarding pose: Transform reference lookup exception\n");
+ success = false;
+ }
+ catch(libTF::TransformReference::ExtrapolateException& ex)
+ {
+ fprintf(stderr, "Discarding pose: Extrapolation exception: %s\n", ex.what());
+ success = false;
+ }
+ catch(...)
+ {
+ fprintf(stderr, "Discarding pose: Exception in pose computation\n");
+ success = false;
+ }
+
+ if (success)
+ {
+ m_basePos[0] = pose.x;
+ m_basePos[1] = pose.y;
+ m_basePos[2] = pose.yaw;
+
+ baseUpdate();
+ }
+ }
+
+ virtual void baseUpdate(void)
+ {
+ }
+
+ rosTFClient m_tf;
+ std_msgs::RobotBase2DOdom m_localizedPose;
+ robot_desc::URDF *m_urdf;
+ planning_models::KinematicModel *m_kmodel;
+ double m_basePos[3];
+
+ };
+
+}
Modified: pkg/trunk/world_models/world_3d_map/src/world_3d_map.cpp
===================================================================
--- pkg/trunk/world_models/world_3d_map/src/world_3d_map.cpp 2008-08-11 22:30:19 UTC (rev 2929)
+++ pkg/trunk/world_models/world_3d_map/src/world_3d_map.cpp 2008-08-11 22:46:32 UTC (rev 2930)
@@ -96,30 +96,26 @@
- @b "world_3d_map/verbosity_level" : @b [int] sets the verbosity level (default 1)
**/
-#include <ros/node.h>
-#include <ros/time.h>
+#include <planning_models/node.h>
+
#include <rosthread/member_thread.h>
#include <rosthread/mutex.h>
+
#include <std_msgs/PointCloudFloat32.h>
-#include <std_msgs/RobotBase2DOdom.h>
#include <std_msgs/LaserScan.h>
#include <rostools/Log.h>
-#include <rosTF/rosTF.h>
-#include <urdf/URDF.h>
-#include <planning_models/kinematic.h>
#include <collision_space/util.h>
#include <random_utils/random_utils.h>
#include <deque>
#include <cmath>
-class World3DMap : public ros::node
+class World3DMap : public planning_models::NodeWithRobotModel
{
public:
- World3DMap(const char *robot_model) : ros::node("world_3d_map"),
- m_tf(*this, true, 1 * 1000000000ULL, 1000000000ULL)
+ World3DMap(const std::string &robot_model) : planning_models::NodeWithRobotModel(robot_model, "world_3d_map")
{
advertise<std_msgs::PointCloudFloat32>("world_3d_map");
advertise<rostools::Log>("roserr");
@@ -129,15 +125,12 @@
param("retain_pointcloud_fraction", m_retainPointcloudFraction, 0.02);
param("verbosity_level", m_verbose, 1);
- loadRobotDescription(robot_model);
-
/* create a thread that does the processing of the input data.
* and one that handles the publishing of the data */
m_active = true;
m_working = false;
m_shouldPublish = false;
random_utils::init(&m_rng);
- m_basePos[0] = m_basePos[1] = m_basePos[2] = 0.0;
m_processMutex.lock();
m_publishMutex.lock();
@@ -145,7 +138,6 @@
m_publishingThread = ros::thread::member_thread::startMemberFunctionThread<World3DMap>(this, &World3DMap::publishDataThread);
subscribe("scan", m_inputScan, &World3DMap::pointCloudCallback);
- subscribe("localizedpose", m_localizedPose, &World3DMap::localizedPoseCallback);
}
~World3DMap(void)
@@ -161,13 +153,14 @@
for (unsigned int i = 0 ; i < m_selfSeeParts.size() ; ++i)
delete m_selfSeeParts[i].body;
-
- if (m_kmodel)
- delete m_kmodel;
- if (m_urdf)
- delete m_urdf;
}
+ virtual void setRobotDescription(robot_desc::URDF *file)
+ {
+ planning_models::NodeWithRobotModel::setRobotDescription(file);
+ addSelfSeeBodies();
+ }
+
private:
struct RobotPart
@@ -176,91 +169,14 @@
planning_models::KinematicModel::Link *link;
};
- void setRobotDescriptionFromData(const char *data)
+ void baseUpdate(void)
{
- robot_desc::URDF *file = new robot_desc::URDF();
- if (file->loadString(data))
- setRobotDescription(file);
- else
- delete file;
+ planning_models::NodeWithRobotModel::baseUpdate();
+ int group = m_kmodel->getGroupID(m_urdf->getRobotName() + "::base");
+ if (group >= 0)
+ m_kmodel->computeTransforms(m_basePos, group);
}
-
- void setRobotDescription(robot_desc::URDF *file)
- {
- m_urdf = file;
- m_kmodel = new planning_models::KinematicModel();
- m_kmodel->setVerbose(false);
- m_kmodel->build(*file);
-
- addSelfSeeBodies();
- }
-
- void loadRobotDescription(const char *robot_model)
- {
- if (!robot_model || strcmp(robot_model, "-") == 0)
- {
- if (m_verbose)
- printf("No robot model will be used\n");
- }
- else
- {
- std::string content;
- if (m_verbose)
- printf("Attempting to load model '%s'\n", robot_model);
- if (get_param(robot_model, content))
- {
- setRobotDescriptionFromData(content.c_str());
- if (m_verbose)
- printf("Success!\n");
- }
- else
- fprintf(stderr, "Robot model '%s' not found!\n", robot_model);
- }
- }
- void localizedPoseCallback(void)
- {
- bool success = true;
- libTF::TFPose2D pose;
- pose.x = m_localizedPose.pos.x;
- pose.y = m_localizedPose.pos.y;
- pose.yaw = m_localizedPose.pos.th;
- pose.time = m_localizedPose.header.stamp.to_ull();
- pose.frame = m_localizedPose.header.frame_id;
-
- try
- {
- pose = m_tf.transformPose2D("FRAMEID_MAP", pose);
- }
- catch(libTF::TransformReference::LookupException& ex)
- {
- fprintf(stderr, "Discarding pose: Transform reference lookup exception\n");
- success = false;
- }
- catch(libTF::TransformReference::ExtrapolateException& ex)
- {
- fprintf(stderr, "Discarding pose: Extrapolation exception: %s\n", ex.what());
- success = false;
- }
- catch(...)
- {
- fprintf(stderr, "Discarding pose: Exception in pose computation\n");
- success = false;
- }
-
- if (success)
- {
- m_basePos[0] = pose.x;
- m_basePos[1] = pose.y;
- m_basePos[2] = pose.yaw;
-
- int group = m_kmodel->getGroupID(m_urdf->getRobotName() + "::base");
- if (group >= 0)
- m_kmodel->computeTransforms(m_basePos, group);
- }
-
- }
-
void pointCloudCallback(void)
{
/* The idea is that if processing of previous input data is
@@ -530,17 +446,9 @@
return copy;
}
- rosTFClient m_tf;
-
- robot_desc::URDF *m_urdf;
- planning_models::KinematicModel *m_kmodel;
-
std::vector<RobotPart> m_selfSeeParts;
- double m_basePos[3];
-
std::deque<std_msgs::PointCloudFloat32*> m_currentWorld;// Pointers to saved clouds
-
double m_maxPublishFrequency;
double m_retainPointcloudDuration;
@@ -549,9 +457,7 @@
std_msgs::LaserScan m_inputScan; //Buffer for recieving cloud
std_msgs::PointCloudFloat32 m_toProcess; //Buffer (size 1) for incoming cloud
- std_msgs::RobotBase2DOdom m_localizedPose;
-
-
+
pthread_t *m_processingThread;
pthread_t *m_publishingThread;
ros::thread::mutex m_processMutex, m_publishMutex, m_worldDataMutex, m_flagMutex;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hsu...@us...> - 2008-08-12 00:54:14
|
Revision: 2938
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=2938&view=rev
Author: hsujohnhsu
Date: 2008-08-12 00:54:23 +0000 (Tue, 12 Aug 2008)
Log Message:
-----------
update to fix gripper control.
Modified Paths:
--------------
pkg/trunk/drivers/simulator/gazebo_plugin/src/test_actuators.cpp
pkg/trunk/robot_descriptions/wg_robot_description/pr2/transmission_test.xml
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/src/test_actuators.cpp
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/src/test_actuators.cpp 2008-08-12 00:53:14 UTC (rev 2937)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/src/test_actuators.cpp 2008-08-12 00:54:23 UTC (rev 2938)
@@ -697,14 +697,29 @@
}
}
- if (false)
+ // -------------------------------------------------------------------------------------------------
+ // - -
+ // - test some controllers set points by hardcode for debug -
+ // - -
+ // -------------------------------------------------------------------------------------------------
+ if (true)
for (std::vector<Robot_controller_>::iterator rci = robot_controllers_.begin(); rci != robot_controllers_.end() ; rci++)
- if ((*rci).control_mode == "PD_CONTROL")
- (*rci).pcontroller.setCommand(-0.3);
- else if ((*rci).control_mode == "VELOCITY_CONTROL")
- (*rci).vcontroller.setCommand(1.0);
+ {
+ if (false)
+ if ((*rci).control_mode == "PD_CONTROL")
+ (*rci).pcontroller.setCommand(-0.3);
+ else if ((*rci).control_mode == "VELOCITY_CONTROL")
+ (*rci).vcontroller.setCommand(1.0);
+ if (true)
+ if ((*rci).gazebo_joint_type == "gripper")
+ (*rci).pcontroller.setCommand(0.2);
+ }
- // update each controller, this updates the joint that the controller was initialized with
+ // -------------------------------------------------------------------------------------------------
+ // - -
+ // - update each controller, this updates the joint that the controller was initialized with -
+ // - -
+ // -------------------------------------------------------------------------------------------------
for (std::vector<Robot_controller_>::iterator rci = robot_controllers_.begin(); rci != robot_controllers_.end() ; rci++)
{
try
@@ -725,7 +740,11 @@
}
}
- // update actuators from robot joints via forward transmission propagation
+ // -------------------------------------------------------------------------------------------------
+ // - -
+ // - update actuators from robot joints via forward transmission propagation -
+ // - -
+ // -------------------------------------------------------------------------------------------------
for (std::vector<Robot_transmission_>::iterator rti = robot_transmissions_.begin(); rti != robot_transmissions_.end(); rti++)
{
// assign actuator states
@@ -738,7 +757,11 @@
// below is when the actuator stuff goes to the hardware
//============================================================================================
- // reverse transmission, get joint data from actuators
+ // -------------------------------------------------------------------------------------------------
+ // - -
+ // - reverse transmission, get joint data from actuators -
+ // - -
+ // -------------------------------------------------------------------------------------------------
for (std::vector<Robot_transmission_>::iterator rrti = reverse_robot_transmissions_.begin(); rrti != reverse_robot_transmissions_.end(); rrti++)
{
// assign joint states
@@ -747,7 +770,11 @@
(*rrti).simple_transmission.propagateEffortBackwards();
}
- // udpate gazebo joint for this controller joint
+ // -------------------------------------------------------------------------------------------------
+ // - -
+ // - udpate gazebo joint for this controller joint -
+ // - -
+ // -------------------------------------------------------------------------------------------------
for (std::vector<Robot_controller_>::iterator rci = robot_controllers_.begin(); rci != robot_controllers_.end() ; rci++)
{
if ((*rci).gazebo_joint_type == "gripper")
@@ -765,6 +792,13 @@
gj_f_r->SetTorque( -(*rci).reverse_mech_joint_->commanded_effort_ - damp_force_f_r );
gj_f_tip_l->SetTorque(-(*rci).reverse_mech_joint_->commanded_effort_ - damp_force_f_tip_l);
gj_f_tip_r->SetTorque( (*rci).reverse_mech_joint_->commanded_effort_ - damp_force_f_tip_r);
+
+ // std::cout << " updating gripper ----------------------------- " << std::endl;
+ // std::cout << " f_l " << (*rci).reverse_mech_joint_->commanded_effort_ << " " << damp_force_f_l << std::endl;
+ // std::cout << " f_r " << -(*rci).reverse_mech_joint_->commanded_effort_ << " " << damp_force_f_r << std::endl;
+ // std::cout << " ftl " << -(*rci).reverse_mech_joint_->commanded_effort_ << " " << damp_force_f_tip_l<< std::endl;
+ // std::cout << " ftr " << (*rci).reverse_mech_joint_->commanded_effort_ << " " << damp_force_f_tip_r<< std::endl;
+
}
else if ((*rci).gazebo_joint_type == "slider")
{
Modified: pkg/trunk/robot_descriptions/wg_robot_description/pr2/transmission_test.xml
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description/pr2/transmission_test.xml 2008-08-12 00:53:14 UTC (rev 2937)
+++ pkg/trunk/robot_descriptions/wg_robot_description/pr2/transmission_test.xml 2008-08-12 00:54:23 UTC (rev 2938)
@@ -151,34 +151,13 @@
</transmission>
<!-- fingers share a single motor -->
- <transmission type="SimpleTransmission" name="finger_l_left_trans">
+ <transmission type="SimpleTransmission" name="gripper_left_trans">
<actuator name="gripper_left_motor" />
- <joint name="finger_l_left_joint" />
+ <joint name="gripper_left_joint" />
<mechanicalReduction>1</mechanicalReduction>
<motorTorqueConstant>1</motorTorqueConstant>
<pulsesPerRevolution>90000</pulsesPerRevolution>
</transmission>
- <transmission type="SimpleTransmission" name="finger_r_left_trans">
- <actuator name="gripper_left_motor" />
- <joint name="finger_r_left_joint" />
- <mechanicalReduction>-1</mechanicalReduction>
- <motorTorqueConstant>1</motorTorqueConstant>
- <pulsesPerRevolution>90000</pulsesPerRevolution>
- </transmission>
- <transmission type="SimpleTransmission" name="finger_tip_l_left_trans">
- <actuator name="gripper_left_motor" />
- <joint name="finger_tip_l_left_joint" />
- <mechanicalReduction>-1</mechanicalReduction>
- <motorTorqueConstant>1</motorTorqueConstant>
- <pulsesPerRevolution>90000</pulsesPerRevolution>
- </transmission>
- <transmission type="SimpleTransmission" name="finger_tip_r_left_trans">
- <actuator name="gripper_left_motor" />
- <joint name="finger_tip_r_left_joint" />
- <mechanicalReduction>1</mechanicalReduction>
- <motorTorqueConstant>1</motorTorqueConstant>
- <pulsesPerRevolution>90000</pulsesPerRevolution>
- </transmission>
<!-- ========================================= -->
<!-- Right Arm -->
<transmission type="SimpleTransmission" name="shoulder_pan_right_trans">
@@ -239,34 +218,13 @@
</transmission>
<!-- fingers share a single motor -->
- <transmission type="SimpleTransmission" name="finger_l_right_trans">
+ <transmission type="SimpleTransmission" name="gripper_right_trans">
<actuator name="gripper_right_motor" />
- <joint name="finger_l_right_joint" />
+ <joint name="gripper_right_joint" />
<mechanicalReduction>1</mechanicalReduction>
<motorTorqueConstant>1</motorTorqueConstant>
<pulsesPerRevolution>90000</pulsesPerRevolution>
</transmission>
- <transmission type="SimpleTransmission" name="finger_r_right_trans">
- <actuator name="gripper_right_motor" />
- <joint name="finger_r_right_joint" />
- <mechanicalReduction>-1</mechanicalReduction>
- <motorTorqueConstant>1</motorTorqueConstant>
- <pulsesPerRevolution>90000</pulsesPerRevolution>
- </transmission>
- <transmission type="SimpleTransmission" name="finger_tip_l_right_trans">
- <actuator name="gripper_right_motor" />
- <joint name="finger_tip_l_right_joint" />
- <mechanicalReduction>-1</mechanicalReduction>
- <motorTorqueConstant>1</motorTorqueConstant>
- <pulsesPerRevolution>90000</pulsesPerRevolution>
- </transmission>
- <transmission type="SimpleTransmission" name="finger_tip_r_right_trans">
- <actuator name="gripper_right_motor" />
- <joint name="finger_tip_r_right_joint" />
- <mechanicalReduction>1</mechanicalReduction>
- <motorTorqueConstant>1</motorTorqueConstant>
- <pulsesPerRevolution>90000</pulsesPerRevolution>
- </transmission>
<!-- ========================================= -->
<!-- Head -->
<transmission type="SimpleTransmission" name="head_pan_trans">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hsu...@us...> - 2008-08-12 18:21:13
|
Revision: 2948
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=2948&view=rev
Author: hsujohnhsu
Date: 2008-08-12 18:21:16 +0000 (Tue, 12 Aug 2008)
Log Message:
-----------
Moved xml files for testing single motor hardware into wg_robot_description/motor_tests.
Renamed RosGazeboNode dependent models to robot_rosgazebo.world.
New pr2_xml.model contains information for the new actuator array plugins.
Moved obsolete robot and pr2 model files into world/tests directory.
Renamed main robot description files: actuators.xml, transmissions.xml, controllers.xml, pr2.xml.
controllers_gazebo.xml : new gazebo_actuators plugin
controllers_gazebo_rosgazebo.xml : old Pr2_Actarray plugin
Updated 2dnav-gazebo demos accordingly, removed botherder starting from xmls, seems to be causing crashes.
Modified Paths:
--------------
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-test.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml
pkg/trunk/robot_descriptions/gazebo_robot_description/CMakeLists.txt
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_floorobj.world
pkg/trunk/robot_descriptions/wg_robot_description/README
pkg/trunk/robot_descriptions/wg_robot_description/pr2/controllers_gazebo_test.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2_test.xml
Added Paths:
-----------
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_rosgazebo.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_rosgazebo_wg.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/pr2-test.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/pr2.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/pr2_autogen.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/pr2_new_plugins.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/pr2_torque.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/pr2_torque_control.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/pr2_torque_position.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/pr2_tray1.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/pr2_tray2.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/pr2_tray3.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/pr2_tray_hand.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/pr2_trimesh.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/robot_controls.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/robot_new_plugins.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/robot_pioneer.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/robot_torque.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/robot_torque_control.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/robot_torque_position.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/robot_tray.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/robot_trimesh.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/walls-only.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/tests/willow-walls.model
pkg/trunk/robot_descriptions/wg_robot_description/motor_tests/
pkg/trunk/robot_descriptions/wg_robot_description/pr2/actuators.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/controller.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/controllers.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/controllers_gazebo.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/controllers_gazebo_rosgazebo.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/pr2_rosgazebo.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/transmissions.xml
Removed Paths:
-------------
pkg/trunk/robot_descriptions/gazebo_robot_description/world/pr2-test.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/pr2.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/pr2_autogen.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/pr2_new_plugins.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/pr2_torque.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/pr2_torque_control.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/pr2_torque_position.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/pr2_tray1.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/pr2_tray2.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/pr2_tray3.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/pr2_tray_hand.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/pr2_trimesh.model
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_controls.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_new_plugins.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_pioneer.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_torque.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_torque_control.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_torque_position.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_tray.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_trimesh.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_wg.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/walls-only.world
pkg/trunk/robot_descriptions/gazebo_robot_description/world/willow-walls.model
pkg/trunk/robot_descriptions/wg_robot_description/pr2/actuator_test.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/controller_test.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/controllers_gazebo.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2/transmission_test.xml
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-test.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-test.xml 2008-08-12 17:54:16 UTC (rev 2947)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-test.xml 2008-08-12 18:21:16 UTC (rev 2948)
@@ -1,5 +1,4 @@
<launch>
- <master auto="start"/>
<group name="wg">
<node pkg="namelookup" type="namelookup_server" respawn="false"/>
<include file="$(find wg_robot_description)/send.xml"/>
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg.xml 2008-08-12 17:54:16 UTC (rev 2947)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg.xml 2008-08-12 18:21:16 UTC (rev 2948)
@@ -1,9 +1,8 @@
<launch>
- <master auto="start"/>
<group name="wg">
<node pkg="namelookup" type="namelookup_server" respawn="false"/>
<include file="$(find wg_robot_description)/send.xml"/>
- <node pkg="pr2_gazebo" type="run-gazebo.sh" args="$(find gazebo_robot_description)/world/robot_wg.world" respawn="true" />
+ <node pkg="pr2_gazebo" type="run-gazebo.sh" args="$(find gazebo_robot_description)/world/robot_rosgazebo_wg.world" respawn="true" />
<node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/willowMap.png 0.1" respawn="false" />
<node pkg="pr2_gazebo" type="run-pr2_gazebo.sh" args="" respawn="true" />
<node pkg="amcl_player" type="amcl_player" args="scan:=base_scan" respawn="false" />
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml 2008-08-12 17:54:16 UTC (rev 2947)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml 2008-08-12 18:21:16 UTC (rev 2948)
@@ -1,9 +1,8 @@
<launch>
- <master auto="start"/>
<group name="wg">
<node pkg="namelookup" type="namelookup_server" respawn="false"/>
<include file="$(find wg_robot_description)/send.xml"/>
- <node pkg="pr2_gazebo" type="run-gazebo.sh" args="$(find gazebo_robot_description)/world/robot.world" respawn="true" />
+ <node pkg="pr2_gazebo" type="run-gazebo.sh" args="$(find gazebo_robot_description)/world/robot_rosgazebo.world" respawn="true" />
<node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" />
<node pkg="pr2_gazebo" type="run-pr2_gazebo.sh" args="" respawn="true" />
<node pkg="amcl_player" type="amcl_player" args="scan:=base_scan" respawn="false" />
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/CMakeLists.txt
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/CMakeLists.txt 2008-08-12 17:54:16 UTC (rev 2947)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/CMakeLists.txt 2008-08-12 18:21:16 UTC (rev 2948)
@@ -18,10 +18,16 @@
DEPENDS urdf2gazebo
COMMENT "Building Gazebo model for PR2")
-add_custom_target(pr2_gazebo_model_nolimit ALL
- COMMAND ${urdf2gazebo_exe} ${wg_robot_description_PACKAGE_PATH}/pr2/pr2.xml ${gazebo_robot_description_PACKAGE_PATH}/world/pr2_xml_nolimit.model 1
+add_custom_target(pr2_gazebo_model_nolimit_rosgazebo ALL
+ COMMAND ${urdf2gazebo_exe} ${wg_robot_description_PACKAGE_PATH}/pr2/pr2_rosgazebo.xml ${gazebo_robot_description_PACKAGE_PATH}/world/pr2_xml_nolimit.model 1
DEPENDS urdf2gazebo
COMMENT "Building Gazebo model for PR2")
+
+add_custom_target(pr2_gazebo_model_rosgazebo ALL
+ COMMAND ${urdf2gazebo_exe} ${wg_robot_description_PACKAGE_PATH}/pr2/pr2_rosgazebo.xml ${gazebo_robot_description_PACKAGE_PATH}/world/pr2_xml_rosgazebo.model
+ DEPENDS urdf2gazebo
+ COMMENT "Building Gazebo model for PR2")
+
add_custom_target(pr2_gazebo_model_test ALL
COMMAND ${urdf2gazebo_exe} ${wg_robot_description_PACKAGE_PATH}/pr2/pr2_test.xml ${gazebo_robot_description_PACKAGE_PATH}/world/pr2_xml_test.model
DEPENDS urdf2gazebo
Deleted: pkg/trunk/robot_descriptions/gazebo_robot_description/world/pr2-test.model
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/world/pr2-test.model 2008-08-12 17:54:16 UTC (rev 2947)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/world/pr2-test.model 2008-08-12 18:21:16 UTC (rev 2948)
@@ -1,2001 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- PR2 model -->
-<model:physical name="pr2_model"
- xmlns:model="http://playerstage.sourceforge.net/gazebo/xmlschema/#model"
- xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
- xmlns:body="http://playerstage.sourceforge.net/gazebo/xmlschema/#body"
- xmlns:geom="http://playerstage.sourceforge.net/gazebo/xmlschema/#geom"
- xmlns:joint="http://playerstage.sourceforge.net/gazebo/xmlschema/#joint"
- xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
- xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"
- >
-
- <xyz>0.0 0.0 0.0</xyz>
- <rpy>0.0 0.0 0.0 </rpy>
-
- <body:box name="base_body">
- <xyz>0.175 0.0 0.15 </xyz> <!-- base bottom is h/2 + some height for wheel clearance-->
- <rpy>0.0 0.0 0.0 </rpy>
-
- <!-- report when this body collides with static bodies -->
- <reportStaticCollision>true</reportStaticCollision>
-
- <geom:box name="base_body_geom">
-
- <massMatrix>true</massMatrix> <!-- user provide full mass and inertia matrix -->
- <mass>70.750964</mass>
- <ixx>5.6522326992070</ixx>
- <ixy>-0.009719934438</ixy>
- <ixz>1.2939882264230</ixz>
- <iyy>5.6694731586520</iyy>
- <iyz>-0.007379583694</iyz>
- <izz>3.6831963517260</izz>
- <cx>-0.061523</cx>
- <cy> 0.000942</cy>
- <cz> 0.293569</cz>
-
-
- <xyz> 0.0 0.00 0.000</xyz>
- <size>0.65 0.65 0.26</size>
- <mul>1</mul>
- <!--color> 0.0 1.0 0.0</color-->
- <visual>
- <xyz>0.0 0.0 -0.13</xyz> <!-- shift center of model to match the actual model -->
- <!--size>0.65 0.65 0.65</size-->
- <scale>0.001 0.001 0.001</scale>
- <rpy> 90.0 0.0 90.0 </rpy>
- <mesh>pr2/pr2_base.mesh</mesh>
- <material>Gazebo/Shell</material>
- </visual>
- </geom:box>
-
- </body:box>
-
-
- <!-- Hokuyo laser body -->
- <body:box name="base_laser_body">
- <xyz>0.45 0.0 0.27</xyz> <!-- from the robot coordinate system (center bottom of base box)-->
- <rpy>0.0 0.0 0.0</rpy>
-
- <geom:box name="base_laser_box">
- <xyz>0.0 0.0 0.02</xyz>
- <rpy>0 0 0</rpy>
- <size>0.05 0.05 0.041</size>
- <mass>0.12</mass>
-
- <visual>
- <scale>0.05 0.05 0.041</scale>
- <mesh>unit_box</mesh>
- <material>Gazebo/Blue</material>
- </visual>
-
- </geom:box>
- <geom:cylinder name="base_laser_cylinder1">
- <xyz>0.0 0.0 0.041</xyz>
- <rpy>0 0 0</rpy>
- <size>0.02 0.013</size>
- <mass>0.02</mass>
-
- <visual>
- <rpy>0 0 0</rpy>
- <scale>0.04 0.04 0.013</scale>
- <mesh>unit_cylinder</mesh>
- <material>Gazebo/Black</material>
- </visual>
-
- </geom:cylinder>
-
- <geom:cylinder name="base_laser_cylinder2">
- <xyz>0.0 0.0 0.054</xyz>
- <rpy>0 0 0</rpy>
- <size>0.018 0.009</size>
- <mass>0.02</mass>
-
- <visual>
- <rpy>0 0 0</rpy>
- <size>0.036 0.036 0.009</size>
- <mesh>unit_cylinder</mesh>
- <material>Gazebo/Black</material>
- </visual>
-
- </geom:cylinder>
-
- <geom:cylinder name="base_laser_cylinder3">
- <xyz>0.0 0.0 0.063</xyz>
- <rpy>0 0 0</rpy>
- <size>0.0175 0.008</size>
- <mass>0.02</mass>
-
- <visual>
- <rpy>0 0 0</rpy>
- <size>0.035 0.035 0.008</size>
- <mesh>unit_cylinder</mesh>
- <material>Gazebo/Shell</material>
- </visual>
-
- </geom:cylinder>
-
-
- <sensor:ray name="base_laser_1">
- <rayCount>68</rayCount>
- <rangeCount>683</rangeCount>
- <laserCount>1</laserCount>
- <origin>0.0 0.0 0.05</origin>
-
- <minAngle>-135</minAngle>
- <maxAngle>135</maxAngle>
-
- <minRange>0.05</minRange>
- <maxRange>10.0</maxRange>
- <updateRate>10.0</updateRate>
- <controller:sicklms200_laser name="base_laser_controller_1">
- <interface:laser name="base_laser_iface_1"/>
- <updateRate>10</updateRate>
- </controller:sicklms200_laser>
- </sensor:ray>
- <!--
- -->
- <!--
- <sensor:ray2 name="base_laser_1">
- <rayCount>683</rayCount>
- <rangeCount>683</rangeCount>
- <laserCount>1</laserCount>
- <origin>0.0 0.0 0.05</origin>
-
- <minAngle>-135</minAngle>
- <maxAngle>135</maxAngle>
-
- <minRange>0.05</minRange>
- <maxRange>10.0</maxRange>
- <controller:sick2lms200_laser name="base_laser_controller_1">
- <interface:laser name="base_laser_iface_1"/>
- <updateRate>10</updateRate>
- </controller:sick2lms200_laser>
- </sensor:ray2>
- -->
- </body:box>
-
- <!-- attach hokuyo to torso -->
- <joint:hinge name="base_laser_torso_attach_joint">
- <body1>base_body</body1>
- <body2>base_laser_body</body2>
- <anchor>base_laser_body</anchor>
- <axis> 1.0 0.0 0.0 </axis>
- <lowStop> 0.0 </lowStop>
- <highStop> 0.0 </highStop>
- </joint:hinge>
-
-
-
-
- <!-- ========== spine and shoulder =========== -->
-
- <body:box name="torso_body">
- <xyz>0.056 0.0 0.45</xyz>
- <rpy>0.0 0.0 0.0</rpy>
-
- <!-- report when this body collides with static bodies -->
- <reportStaticCollision>true</reportStaticCollision>
-
- <geom:box name="torso_geom">
- <xyz> 0.0 0.0 0.0 </xyz>
- <size>0.1 0.2 0.6 </size>
- <mass>1</mass>
- <visual>
- <!-- x y z -->
- <xyz> 0.1 0.0 -0.425 </xyz>
- <!--size>0.6 0.8 0.6 </size-->
- <scale>0.001 0.001 0.001</scale>
- <rpy>90.0 0.0 90.0 </rpy>
- <mesh>pr2/pr2_body.mesh</mesh>
- <material>Gazebo/PioneerBody</material>
- </visual>
- </geom:box>
-
- <geom:box name="shoulder_geom">
- <xyz> 0.1 0.00 0.54</xyz>
- <size>0.3 0.65 0.02</size>
- <mass>1</mass>
- <visual>
- <!--size>0.3 0.65 0.02</size-->
- <size>0.0 0.0 0.0</size>
- <mesh>unit_box</mesh>
- <material>Gazebo/Shell</material>
- </visual>
- </geom:box>
-
- </body:box>
-
- <joint:slider name="torso_spine_slider">
- <body1>base_body</body1>
- <body2>torso_body</body2>
- <anchor>torso_body</anchor>
- <lowStop> 0.0 </lowStop>
- <highStop> 0.5 </highStop>
- <axis>0.0 0.0 1.0 </axis>
- <axisOffset> 0.0 0.0 0.0 </axisOffset>
- </joint:slider>
-
- <!-- ========== Right Arm =========== -->
- <body:cylinder name="shoulder_pan_body_right">
- <xyz> 0.1829361 -0.1329361 0.64 </xyz>
- <rpy> 0.0 0.0 0.0 </rpy>
- <geom:cylinder name="shoulder_pan_body_right_geom">
-
- <massMatrix>true</massMatrix> <!-- user provide full mass and inertia matrix -->
- <mass> 16.29553 </mass> <!-- who would have thought we have 6 digits of precision!? -->
- <ixx> 0.793291393007 </ixx>
- <ixy> 0.003412032973 </ixy>
- <ixz> 0.0096614481 </ixz>
- <iyy> 0.818419457224</iyy>
- <iyz> -0.033999499551</iyz>
- <izz> 0.13915007406 </izz>
- <cx> -0.005215 </cx>
- <cy> -0.030552 </cy>
- <cz> -0.175743 </cz>
-
- <kp>1000000.0</kp>
- <kd>1.0</kd>
- <size> 0.13 0.60</size> <!-- radius and length -->
- <visual>
- <xyz> 0.00 0.0 0.185 </xyz>
- <rpy> 90.0 0.0 90.0 </rpy>
- <!--size> 0.26 0.6 0.36</size-->
- <scale>0.001 0.001 0.001</scale>
- <mesh>pr2/pr2_sh_turret.mesh</mesh>
- <material>Gazebo/Green</material>
- </visual>
- </geom:cylinder>
- </body:cylinder>
-
- <body:cylinder name="upperarm_joint_right">
- <xyz> 0.285 -0.15 0.8269 </xyz>
- <rpy> 90.0 0.0 0.0 </rpy>
- <geom:cylinder name="upperarm_joint_right_geom">
-
- <massMatrix>true</massMatrix> <!-- user provide full mass and inertia matrix -->
- <mass> 2.41223</mass> <!-- who would have thought we have 6 digits of precision!? -->
- <ixx> 0.016640333585 </ixx>
- <ixy> 0.002696462583 </ixy>
- <ixz> 0.001337742275 </ixz>
- <iyy> 0.017232603914 </iyy>
- <iyz> -0.003605106514 </iyz>
- <izz> 0.018723553425 </izz>
- <cx> -0.035895 </cx>
- <cy> 0.014422 </cy>
- <cz> -0.028263</cz>
-
- <kp>1000000.0</kp>
- <kd>1.0</kd>
- <size> 0.12 0.10</size> <!-- radius and length -->
- <visual>
- <xyz> 0.0 0.0 0.0 </xyz>
- <rpy> 0.0 90.0 0.0 </rpy>
- <scale>0.001 0.001 0.001</scale>
- <mesh>pr2/pr2_sh_pitch.mesh</mesh>
- <material>Gazebo/PioneerBody</material>
- </visual>
- </geom:cylinder>
- </body:cylinder>
-
- <body:box name="upperarm_right">
- <xyz> 0.575 -0.15 0.8269 </xyz>
- <rpy> 0.0 0.0 0.0 </rpy>
- <geom:box name="upperarm_right_geom">
-
- <massMatrix>true</massMatrix> <!-- user provide full mass and inertia matrix -->
- <mass> 4.9481 </mass> <!-- who would have thought we have 6 digits of precision!? -->
- <ixx> 0.073060715309 </ixx>
- <ixy> 0.000547745916 </ixy>
- <ixz> 0.000119476885 </ixz>
- <iyy> 0.072124510748 </iyy>
- <iyz> 0.001544932307 </iyz>
- <izz> 0.013383284908 </izz>
- <cx> 0.001205 </cx>
- <cy> -0.016293 </cy>
- <cz> 0.21227</cz>
-
- <kp>1000000.0</kp>
- <kd>1.0</kd>
- <size> 0.35 0.12 0.15</size>
- <visual>
- <xyz> -0.20 0.0 0.0 </xyz>
- <rpy>180.0 -90.0 0.0 </rpy>
- <scale>0.001 0.001 0.001</scale>
- <mesh>pr2/pr2_sh_roll.mesh</mesh>
- <material>Gazebo/Shell</material>
- </visual>
- </geom:box>
- </body:box>
-
- <body:cylinder name="elbow_right">
- <xyz> 0.6850 -0.15 0.8269 </xyz>
- <rpy> 90.0 0.0 0.0 </rpy>
- <geom:cylinder name="elbow_right_geom">
-
- <massMatrix>true</massMatrix> <!-- user provide full mass and inertia matrix -->
- <mass> 1.689246</mass> <!-- who would have thought we have 6 digits of precision!? -->
- <ixx> 0.003275298548 </ixx>
- <ixy> 0.000292046674 </ixy>
- <ixz> -0.000077359282 </ixz>
- <iyy> 0.003236815206 </iyy>
- <iyz> -0.000001162155 </iyz>
- <izz> 0.00410053774 </izz>
- <cx> -0.011638 </cx>
- <cy> 0.013173 </cy>
- <cz> 0.001228</cz>
-
- <kp>1000000.0</kp>
- <kd>1.0</kd>
- <size> 0.08 0.1</size> <!-- radius and length -->
- <visual>
- <xyz> -0.135 0.0 0.0 </xyz>
- <rpy> 0.0 -90.0 0.0 </rpy>
- <scale>0.001 0.001 0.001</scale>
- <mesh>pr2/pr2_elbow_pitch.mesh</mesh>
- <material>Gazebo/PioneerBody</material>
- </visual>
- </geom:cylinder>
- </body:cylinder>
-
- <body:box name="forearm_right">
- <xyz> 0.90225 -0.15 0.8269 </xyz>
- <rpy> 0.0 0.0 0.0 </rpy>
- <geom:box name="forearm_right_geom">
-
- <massMatrix>true</massMatrix> <!-- user provide full mass and inertia matrix -->
- <mass> 1.804155 </mass> <!-- who would have thought we have 6 digits of precision!? -->
- <ixx> 0.012430552544 </ixx>
- <ixy> -0.000003671102 </ixy>
- <ixz> 0.000029379389 </ixz>
- <iyy> 0.013567548848 </iyy>
- <iyz> -0.000427679042 </iyz>
- <izz> 0.001755089866 </izz>
- <cx> -0.000058 </cx>
- <cy> 0.013779 </cy>
- <cz> 0.179474 </cz>
-
- <kp>1000000.0</kp>
- <kd>1.0</kd>
- <size> 0.27 0.12 0.08</size>
- <visual>
- <xyz> 0.11 0.0 0.0 </xyz>
- <rpy> 0.0 -90.0 -90.0 </rpy>
- <scale>0.001 0.001 0.001</scale>
- <mesh>pr2/pr2_forearm_roll.mesh</mesh>
- <material>Gazebo/Shell</material>
- </visual>
- </geom:box>
- </body:box>
-
- <body:cylinder name="wrist_right">
- <xyz> 1.008 -0.15 0.8269 </xyz>
- <rpy> 90.0 0.0 0.0 </rpy>
- <geom:cylinder name="wrist_right_geom">
-
- <massMatrix>true</massMatrix> <!-- user provide full mass and inertia matrix -->
- <mass> 1.804155 </mass> <!-- who would have thought we have 6 digits of precision!? -->
- <ixx> 0.012430552544 </ixx>
- <ixy> -0.000003671102 </ixy>
- <ixz> 0.000029379389 </ixz>
- <iyy> 0.013567548848 </iyy>
- <iyz> -0.000427679042 </iyz>
- <izz> 0.001755089866 </izz>
- <cx> 0.0 </cx>
- <cy> 0.0 </cy>
- <cz> 0.0 </cz>
-
- <kp>1000000.0</kp>
- <kd>1.0</kd>
- <size> 0.031 0.1</size> <!-- radius and length -->
- <visual>
- <xyz> 0.008 0.0 0.0 </xyz>
- <rpy> 90.0 0.0 -90.0 </rpy>
- <scale>0.001 0.001 0.001</scale>
- <mesh>pr2/pr2_wrist_pitch.mesh</mesh>
- <material>Gazebo/PioneerBody</material>
- </visual>
- </geom:cylinder>
- </body:cylinder>
-
- <body:box name="palm_right">
- <xyz> 1.10 -0.15 0.8269</xyz>
- <rpy> 0.0 0.0 0.0 </rpy>
- <geom:box name="palm_right_geom">
-
- <massMatrix>true</massMatrix> <!-- user provide full mass and inertia matrix -->
- <mass> 1.804155 </mass> <!-- who would have thought we have 6 digits of precision!? -->
- <ixx> 0.012430552544 </ixx>
- <ixy> -0.000003671102 </ixy>
- <ixz> 0.000029379389 </ixz>
- <iyy> 0.013567548848 </iyy>
- <iyz> -0.000427679042 </iyz>
- <izz> 0.001755089866 </izz>
- <cx> 0.0 </cx>
- <cy> 0.0 </cy>
- <cz> 0.0 </cz>
-
- <kp>1000000.0</kp>
- <kd>1.0</kd>
- <size> 0.11 0.10 0.05</size>
- <visual>
- <xyz> -0.035 0.0 0.0 </xyz>
- <rpy> 0.0 90.0 90.0 </rpy>
- <scale>0.001 0.001 0.001</scale>
- <mesh>pr2/pr2_wrist_roll.mesh</mesh>
- <material>Gazebo/Shell</material>
- </visual>
- </geom:box>
- </body:box>
-
- <body:box name="finger_1_right">
- <xyz> 1.18 -0.17 0.8269 </xyz>
- <rpy> 0.0 0.0 0.0 </rpy>
- <geom:box name="finger_1_right_geom">
- <kp>100000000.0</kp>
- <kd>1.0</kd>
- <size> 0.05 0.01 0.025</size>
- <mass>0.1</mass>
- <visual>
- <size> 0.05 0.01 0.025</size>
- <mesh>unit_box</mesh>
- <material>Gazebo/PioneerBody</material>
- </visual>
- </geom:box>
- </body:box>
-
- <body:box name="finger_2_right">
- <xyz> 1.18 -0.13 0.8269 </xyz>
- <rpy> 0.0 0.0 0.0 </rpy>
- <geom:box name="finger_2_right_geom">
- <kp>100000000.0</kp>
- <kd>1.0</kd>
- <size> 0.05 0.01 0.025</size>
- <mass>0.1</mass>
- <visual>
- <size> 0.05 0.01 0.025</size>
- <mesh>unit_box</mesh>
- <material>Gazebo/Blue</material>
- </visual>
- </geom:box>
- </body:box>
-
-
-
-
-
-
- <joint:hinge name="shoulder_pan_right">
- <body2>shoulder_pan_body_right</body2>
- <body1>torso_body</body1>
- <anchor>shoulder_pan_body_right</anchor>
- <axis> 0.0 0.0 1.0 </axis>
- </joint:hinge>
-
- <joint:hinge name="upperarm_pitch_joint_right">
- <body1>shoulder_pan_body_right</body1>
- <body2>upperarm_joint_right</body2>
- <anchor>upperarm_joint_right</anchor>
- <axis> 0.0 1.0 0.0 </axis>
- </joint:hinge>
-
- <joint:hinge name="upperarm_roll_joint_right">
- <body1>upperarm_right</body1>
- <body2>upperarm_joint_right</body2>
- <anchor>upperarm_joint_right</anchor>
- <axis> 1.0 0.0 0.0 </axis>
- </joint:hinge>
-
- <joint:hinge name="elbow_pitch_joint_right">
- <body2>elbow_right</body2>
- <body1>upperarm_right</body1>
- <anchor>elbow_right</anchor>
- <axis> 0.0 1.0 0.0 </axis>
- </joint:hinge>
-
- <joint:hinge name="forearm_roll_joint_right">
- <body2>forearm_right</body2>
- <body1>elbow_right</body1>
- <anchor>forearm_right</anchor>
- <axis> 1.0 0.0 0.0 </axis>
- </joint:hinge>
-
- <joint:hinge name="wrist_pitch_joint_right">
- <body2>wrist_right</body2>
- <body1>forearm_right</body1>
- <anchor>wrist_right</anchor>
- <axis> 0.0 1.0 0.0 </axis>
- </joint:hinge>
-
- <joint:hinge name="palm_roll_joint_right">
- <body2>palm_right</body2>
- <body1>wrist_right</body1>
- <anchor>palm_right</anchor>
- <axis> 1.0 0.0 0.0 </axis>
- <axisOffset> 0.0 0.0 0.0 </axisOffset>
- </joint:hinge>
-
- <joint:slider name="finger_1_slider_right">
- <body2>finger_1_right</body2>
- <body1>palm_right</body1>
- <anchor>finger_1_right</anchor>
- <lowStop> -0.02 </lowStop> <!-- red close -->
- <highStop> 0.05 </highStop> <!-- red open -->
- <axis>0.0 1.0 0.0 </axis>
- </joint:slider>
-
- <joint:slider name="finger_2_slider_right">
- <body2>finger_2_right</body2>
- <body1>palm_right</body1>
- <anchor>finger_2_right</anchor>
- <lowStop> -0.05 </lowStop> <!-- white open -->
- <highStop> 0.02 </highStop> <!-- white close -->
- <axis>0.0 1.0 0.0 </axis>
- </joint:slider>
-
- <!-- ========== Left Arm =========== -->
- <body:cylinder name="shoulder_pan_body_left">
- <xyz> 0.1829361 0.1329361 0.64 </xyz>
- <rpy> 0.0 0.0 0.0 </rpy>
- <geom:cylinder name="shoulder_pan_body_left_geom">
-
- <massMatrix>true</massMatrix> <!-- user provide full mass and inertia matrix -->
- <mass> 16.29553 </mass> <!-- who would have thought we have 6 digits of precision!? -->
- <ixx> 0.793291393007 </ixx>
- <ixy> 0.003412032973 </ixy>
- <ixz> 0.0096614481 </ixz>
- <iyy> 0.818419457224</iyy>
- <iyz> -0.033999499551</iyz>
- <izz> 0.13915007406 </izz>
- <cx> -0.005215 </cx>
- <cy> -0.030552 </cy>
- <cz> -0.175743 </cz>
-
- <kp>1000000.0</kp>
- <kd>1.0</kd>
- <size> 0.13 0.6</size> <!-- radius and length -->
- <visual>
- <xyz> 0.00 0.0 0.185 </xyz>
- <rpy> 90.0 0.0 90.0 </rpy>
- <!--size> 0.26 0.6 0.36</size-->
- <scale>0.001 0.001 0.001</scale>
- <mesh>pr2/pr2_sh_turret.mesh</mesh>
- <material>Gazebo/Green</material>
- </visual>
- </geom:cylinder>
- </body:cylinder>
-
- <body:cylinder name="upperarm_joint_left">
- <xyz> 0.285 0.15 0.8269 </xyz>
- <rpy> 90.0 0.0 0.0 </rpy>
- <geom:cylinder name="upperarm_joint_left_geom">
-
- <massMatrix>true</massMatrix> <!-- user provide full mass and inertia matrix -->
- <mass> 2.41223</mass> <!-- who would have thought we have 6 digits of precision!? -->
- <ixx> 0.016640333585 </ixx>
- <ixy> 0.002696462583 </ixy>
- <ixz> 0.001337742275 </ixz>
- <iyy> 0.017232603914 </iyy>
- <iyz> -0.003605106514 </iyz>
- <izz> 0.018723553425 </izz>
- <cx> -0.035895 </cx>
- <cy> 0.014422 </cy>
- <cz> -0.028263</cz>
-
- <kp>1000000.0</kp>
- <kd>1.0</kd>
- <size> 0.12 0.10</size> <!-- radius and length -->
- <visual>
- <xyz> 0.0 0.0 0.0 </xyz>
- <rpy> 0.0 90.0 0.0 </rpy>
- <scale>0.001 0.001 0.001</scale>
- <mesh>pr2/pr2_sh_pitch.mesh</mesh>
- <material>Gazebo/PioneerBody</material>
- </visual>
- </geom:cylinder>
- </body:cylinder>
-
...
[truncated message content] |
|
From: <hsu...@us...> - 2008-08-12 20:21:45
|
Revision: 2952
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=2952&view=rev
Author: hsujohnhsu
Date: 2008-08-12 20:21:54 +0000 (Tue, 12 Aug 2008)
Log Message:
-----------
moved setup scripts inside of gazebo.
updated related run-gazebo.sh and run-rosgazebo.sh scripts.
Modified Paths:
--------------
pkg/trunk/3rdparty/gazebo/setup.bash
pkg/trunk/3rdparty/gazebo/setup.tcsh
pkg/trunk/robot_control_loops/pr2_gazebo/run-gazebo.sh
pkg/trunk/robot_control_loops/pr2_gazebo/run-pr2_gazebo.sh
pkg/trunk/simulators/rosgazebo/run-rosgazebo.sh
Removed Paths:
-------------
pkg/trunk/robot_control_loops/pr2_gazebo/setup.bash
pkg/trunk/robot_control_loops/pr2_gazebo/setup.tcsh
pkg/trunk/simulators/rosgazebo/run-gazebo.sh
Modified: pkg/trunk/3rdparty/gazebo/setup.bash
===================================================================
--- pkg/trunk/3rdparty/gazebo/setup.bash 2008-08-12 19:49:49 UTC (rev 2951)
+++ pkg/trunk/3rdparty/gazebo/setup.bash 2008-08-12 20:21:54 UTC (rev 2952)
@@ -1,19 +1,18 @@
#!/bin/bash
export GAZ_TOP=`rospack find gazebo`/gazebo
export OGRE_TOP=`rospack find ogre`/ogre
+export CG_TOP=`rospack find Cg`/Cg
export SIM_PLUGIN=`rospack find gazebo_plugin`
-export PR2API=`rospack find libpr2API`
-export PR2HW=`rospack find libpr2HW`
-export PR2MEDIA=`rospack find 2dnav-gazebo`/world
+export PR2MEDIA=`rospack find gazebo_robot_description`/world
-export LD_LIBRARY_PATH ''
-export LD_LIBRARY_PATH=$PR2API/lib:$LD_LIBRARY_PATH
-export LD_LIBRARY_PATH=$PR2HW/lib:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH=''
export LD_LIBRARY_PATH=$SIM_PLUGIN/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$GAZ_TOP/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$OGRE_TOP/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$OGRE_TOP/lib/OGRE:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH=$CG_TOP/lib:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH=$SIM_PLUGIN/lib:$LD_LIBRARY_PATH
export PATH=$GAZ_TOP/bin:$PATH
export GAZEBO_RESOURCE_PATH=$PR2MEDIA
Modified: pkg/trunk/3rdparty/gazebo/setup.tcsh
===================================================================
--- pkg/trunk/3rdparty/gazebo/setup.tcsh 2008-08-12 19:49:49 UTC (rev 2951)
+++ pkg/trunk/3rdparty/gazebo/setup.tcsh 2008-08-12 20:21:54 UTC (rev 2952)
@@ -1,19 +1,18 @@
#!/bin/tcsh
setenv GAZ_TOP `rospack find gazebo`/gazebo
setenv OGRE_TOP `rospack find ogre`/ogre
+setenv CG_TOP `rospack find Cg`/Cg
setenv SIM_PLUGIN `rospack find gazebo_plugin`
-setenv PR2API `rospack find libpr2API`
-setenv PR2HW `rospack find libpr2HW`
-setenv PR2MEDIA `rospack find 2dnav-gazebo`/world
+setenv PR2MEDIA `rospack find gazebo_robot_description`/world
if (! $?LD_LIBRARY_PATH) setenv LD_LIBRARY_PATH ''
setenv LD_LIBRARY_PATH ''
-setenv LD_LIBRARY_PATH $PR2API/lib:$LD_LIBRARY_PATH
-setenv LD_LIBRARY_PATH $PR2HW/lib:$LD_LIBRARY_PATH
setenv LD_LIBRARY_PATH $SIM_PLUGIN/lib:$LD_LIBRARY_PATH
setenv LD_LIBRARY_PATH $GAZ_TOP/lib:$LD_LIBRARY_PATH
setenv LD_LIBRARY_PATH $OGRE_TOP/lib:$LD_LIBRARY_PATH
setenv LD_LIBRARY_PATH $OGRE_TOP/lib/OGRE:$LD_LIBRARY_PATH
+setenv LD_LIBRARY_PATH $CG_TOP/lib:$LD_LIBRARY_PATH
+setenv LD_LIBRARY_PATH $SIM_PLUGIN/lib:$LD_LIBRARY_PATH
setenv PATH $GAZ_TOP/bin:$PATH
setenv GAZEBO_RESOURCE_PATH $PR2MEDIA
Modified: pkg/trunk/robot_control_loops/pr2_gazebo/run-gazebo.sh
===================================================================
--- pkg/trunk/robot_control_loops/pr2_gazebo/run-gazebo.sh 2008-08-12 19:49:49 UTC (rev 2951)
+++ pkg/trunk/robot_control_loops/pr2_gazebo/run-gazebo.sh 2008-08-12 20:21:54 UTC (rev 2952)
@@ -1,3 +1,3 @@
#!/bin/bash
-. `rospack find pr2_gazebo`/setup.bash
+. `rospack find gazebo`/setup.bash
gazebo $*
Modified: pkg/trunk/robot_control_loops/pr2_gazebo/run-pr2_gazebo.sh
===================================================================
--- pkg/trunk/robot_control_loops/pr2_gazebo/run-pr2_gazebo.sh 2008-08-12 19:49:49 UTC (rev 2951)
+++ pkg/trunk/robot_control_loops/pr2_gazebo/run-pr2_gazebo.sh 2008-08-12 20:21:54 UTC (rev 2952)
@@ -1,3 +1,3 @@
#!/bin/bash
-. `rospack find pr2_gazebo`/setup.bash
+. `rospack find gazebo`/setup.bash
`rospack find pr2_gazebo`/pr2_gazebo
Deleted: pkg/trunk/robot_control_loops/pr2_gazebo/setup.bash
===================================================================
--- pkg/trunk/robot_control_loops/pr2_gazebo/setup.bash 2008-08-12 19:49:49 UTC (rev 2951)
+++ pkg/trunk/robot_control_loops/pr2_gazebo/setup.bash 2008-08-12 20:21:54 UTC (rev 2952)
@@ -1,27 +0,0 @@
-#!/bin/bash
-export GAZ_TOP=`rospack find gazebo`/gazebo
-export OGRE_TOP=`rospack find ogre`/ogre
-export CG_TOP=`rospack find Cg`/Cg
-export SIM_PLUGIN=`rospack find gazebo_plugin`
-export PR2MEDIA=`rospack find gazebo_robot_description`/world
-
-
-export LD_LIBRARY_PATH=''
-export LD_LIBRARY_PATH=$SIM_PLUGIN/lib:$LD_LIBRARY_PATH
-export LD_LIBRARY_PATH=$GAZ_TOP/lib:$LD_LIBRARY_PATH
-export LD_LIBRARY_PATH=$OGRE_TOP/lib:$LD_LIBRARY_PATH
-export LD_LIBRARY_PATH=$OGRE_TOP/lib/OGRE:$LD_LIBRARY_PATH
-export LD_LIBRARY_PATH=$CG_TOP/lib:$LD_LIBRARY_PATH
-export LD_LIBRARY_PATH=$SIM_PLUGIN/lib:$LD_LIBRARY_PATH
-export PATH=$GAZ_TOP/bin:$PATH
-
-export GAZEBO_RESOURCE_PATH=$PR2MEDIA
-export OGRE_RESOURCE_PATH=$OGRE_TOP/lib/OGRE
-
-echo
-echo Current GAZ_TOP is set to $GAZ_TOP
-echo Paths have been set accordingly.
-echo
-echo Now run gazebo [...world file...]
-echo
-
Deleted: pkg/trunk/robot_control_loops/pr2_gazebo/setup.tcsh
===================================================================
--- pkg/trunk/robot_control_loops/pr2_gazebo/setup.tcsh 2008-08-12 19:49:49 UTC (rev 2951)
+++ pkg/trunk/robot_control_loops/pr2_gazebo/setup.tcsh 2008-08-12 20:21:54 UTC (rev 2952)
@@ -1,27 +0,0 @@
-#!/bin/tcsh
-setenv GAZ_TOP `rospack find gazebo`/gazebo
-setenv OGRE_TOP `rospack find ogre`/ogre
-setenv CG_TOP `rospack find Cg`/Cg
-setenv SIM_PLUGIN `rospack find gazebo_plugin`
-setenv PR2MEDIA `rospack find gazebo_robot_description`/world
-
-if (! $?LD_LIBRARY_PATH) setenv LD_LIBRARY_PATH ''
-setenv LD_LIBRARY_PATH ''
-setenv LD_LIBRARY_PATH $SIM_PLUGIN/lib:$LD_LIBRARY_PATH
-setenv LD_LIBRARY_PATH $GAZ_TOP/lib:$LD_LIBRARY_PATH
-setenv LD_LIBRARY_PATH $OGRE_TOP/lib:$LD_LIBRARY_PATH
-setenv LD_LIBRARY_PATH $OGRE_TOP/lib/OGRE:$LD_LIBRARY_PATH
-setenv LD_LIBRARY_PATH $CG_TOP/lib:$LD_LIBRARY_PATH
-setenv LD_LIBRARY_PATH $SIM_PLUGIN/lib:$LD_LIBRARY_PATH
-setenv PATH $GAZ_TOP/bin:$PATH
-
-setenv GAZEBO_RESOURCE_PATH $PR2MEDIA
-setenv OGRE_RESOURCE_PATH $OGRE_TOP/lib/OGRE
-
-echo
-echo Current GAZ_TOP is set to $GAZ_TOP
-echo Paths have been set accordingly.
-echo
-echo Now run gazebo [...world file...]
-echo
-
Deleted: pkg/trunk/simulators/rosgazebo/run-gazebo.sh
===================================================================
--- pkg/trunk/simulators/rosgazebo/run-gazebo.sh 2008-08-12 19:49:49 UTC (rev 2951)
+++ pkg/trunk/simulators/rosgazebo/run-gazebo.sh 2008-08-12 20:21:54 UTC (rev 2952)
@@ -1,3 +0,0 @@
-#!/bin/bash
-. ./setup.bash
-gazebo $*
Modified: pkg/trunk/simulators/rosgazebo/run-rosgazebo.sh
===================================================================
--- pkg/trunk/simulators/rosgazebo/run-rosgazebo.sh 2008-08-12 19:49:49 UTC (rev 2951)
+++ pkg/trunk/simulators/rosgazebo/run-rosgazebo.sh 2008-08-12 20:21:54 UTC (rev 2952)
@@ -1,3 +1,3 @@
#!/bin/bash
-. `rospack find rosgazebo`/setup.bash
+. `rospack find gazebo`/setup.bash
`rospack find rosgazebo`/rosgazebo $*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hsu...@us...> - 2008-08-12 20:24:31
|
Revision: 2953
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=2953&view=rev
Author: hsujohnhsu
Date: 2008-08-12 20:24:40 +0000 (Tue, 12 Aug 2008)
Log Message:
-----------
moved run-gazebo.sh into 3rdparty gazebo.
Modified Paths:
--------------
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-test.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg.xml
pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml
pkg/trunk/manip/overhead_grasp_behavior/overhead_grasp.xml
Added Paths:
-----------
pkg/trunk/3rdparty/gazebo/run-gazebo.sh
Removed Paths:
-------------
pkg/trunk/robot_control_loops/pr2_gazebo/run-gazebo.sh
Copied: pkg/trunk/3rdparty/gazebo/run-gazebo.sh (from rev 2952, pkg/trunk/robot_control_loops/pr2_gazebo/run-gazebo.sh)
===================================================================
--- pkg/trunk/3rdparty/gazebo/run-gazebo.sh (rev 0)
+++ pkg/trunk/3rdparty/gazebo/run-gazebo.sh 2008-08-12 20:24:40 UTC (rev 2953)
@@ -0,0 +1,3 @@
+#!/bin/bash
+. `rospack find gazebo`/setup.bash
+gazebo $*
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-test.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-test.xml 2008-08-12 20:21:54 UTC (rev 2952)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-test.xml 2008-08-12 20:24:40 UTC (rev 2953)
@@ -2,7 +2,7 @@
<group name="wg">
<node pkg="namelookup" type="namelookup_server" respawn="false"/>
<include file="$(find wg_robot_description)/send.xml"/>
- <node pkg="pr2_gazebo" type="run-gazebo.sh" args="$(find gazebo_robot_description)/world/robot_test.world" respawn="true" />
+ <node pkg="gazebo" type="run-gazebo.sh" args="$(find gazebo_robot_description)/world/robot_test.world" respawn="true" />
<node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" />
<node pkg="pr2_gazebo" type="run-pr2_gazebo.sh" args="" respawn="true" />
<node pkg="amcl_player" type="amcl_player" args="scan:=base_scan" respawn="false" />
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg.xml 2008-08-12 20:21:54 UTC (rev 2952)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo-wg.xml 2008-08-12 20:24:40 UTC (rev 2953)
@@ -2,7 +2,7 @@
<group name="wg">
<node pkg="namelookup" type="namelookup_server" respawn="false"/>
<include file="$(find wg_robot_description)/send.xml"/>
- <node pkg="pr2_gazebo" type="run-gazebo.sh" args="$(find gazebo_robot_description)/world/robot_rosgazebo_wg.world" respawn="true" />
+ <node pkg="gazebo" type="run-gazebo.sh" args="$(find gazebo_robot_description)/world/robot_rosgazebo_wg.world" respawn="true" />
<node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/willowMap.png 0.1" respawn="false" />
<node pkg="pr2_gazebo" type="run-pr2_gazebo.sh" args="" respawn="true" />
<node pkg="amcl_player" type="amcl_player" args="scan:=base_scan" respawn="false" />
Modified: pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml
===================================================================
--- pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml 2008-08-12 20:21:54 UTC (rev 2952)
+++ pkg/trunk/demos/2dnav-gazebo/2dnav-gazebo.xml 2008-08-12 20:24:40 UTC (rev 2953)
@@ -2,7 +2,7 @@
<group name="wg">
<node pkg="namelookup" type="namelookup_server" respawn="false"/>
<include file="$(find wg_robot_description)/send.xml"/>
- <node pkg="pr2_gazebo" type="run-gazebo.sh" args="$(find gazebo_robot_description)/world/robot_rosgazebo.world" respawn="true" />
+ <node pkg="gazebo" type="run-gazebo.sh" args="$(find gazebo_robot_description)/world/robot_rosgazebo.world" respawn="true" />
<node pkg="map_server" type="map_server" args="$(find gazebo_robot_description)/world/Media/materials/textures/map3.png 0.1" respawn="false" />
<node pkg="pr2_gazebo" type="run-pr2_gazebo.sh" args="" respawn="true" />
<node pkg="amcl_player" type="amcl_player" args="scan:=base_scan" respawn="false" />
Modified: pkg/trunk/manip/overhead_grasp_behavior/overhead_grasp.xml
===================================================================
--- pkg/trunk/manip/overhead_grasp_behavior/overhead_grasp.xml 2008-08-12 20:21:54 UTC (rev 2952)
+++ pkg/trunk/manip/overhead_grasp_behavior/overhead_grasp.xml 2008-08-12 20:24:40 UTC (rev 2953)
@@ -1,9 +1,8 @@
<launch>
- <master auto="start"/>
<group name="wg">
<node pkg="namelookup" type="namelookup_server" respawn="false"/>
<include file="$(find wg_robot_description)/send.xml"/>
- <node pkg="pr2_gazebo" type="run-gazebo.sh" args="$(find gazebo_robot_description)/world/robot_tablegrasp.world" respawn="true" />
+ <node pkg="gazebo" type="run-gazebo.sh" args="$(find gazebo_robot_description)/world/robot_tablegrasp.world" respawn="true" />
<node pkg="pr2_gazebo" type="run-pr2_gazebo.sh" args="" respawn="true" />
<node pkg="pr2_kinematic_controllers" type="pr2_kinematic_controllers" respawn="true" />
<node pkg="overhead_grasp_behavior" type="overhead_grasp" respawn="true" />
Deleted: pkg/trunk/robot_control_loops/pr2_gazebo/run-gazebo.sh
===================================================================
--- pkg/trunk/robot_control_loops/pr2_gazebo/run-gazebo.sh 2008-08-12 20:21:54 UTC (rev 2952)
+++ pkg/trunk/robot_control_loops/pr2_gazebo/run-gazebo.sh 2008-08-12 20:24:40 UTC (rev 2953)
@@ -1,3 +0,0 @@
-#!/bin/bash
-. `rospack find gazebo`/setup.bash
-gazebo $*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mm...@us...> - 2008-08-12 20:35:27
|
Revision: 2955
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=2955&view=rev
Author: mmwise
Date: 2008-08-12 20:35:34 +0000 (Tue, 12 Aug 2008)
Log Message:
-----------
adding test dir
Modified Paths:
--------------
pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_effort_controller.h
pkg/trunk/controllers/generic_controllers/src/joint_effort_controller.cpp
pkg/trunk/controllers/generic_controllers/src/joint_velocity_controller.cpp
Added Paths:
-----------
pkg/trunk/hardware_test/
pkg/trunk/hardware_test/motors/
pkg/trunk/hardware_test/motors/src/
pkg/trunk/hardware_test/motors/xml/
pkg/trunk/hardware_test/motors/xml/WG_3021.xml
Modified: pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_effort_controller.h
===================================================================
--- pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_effort_controller.h 2008-08-12 20:25:09 UTC (rev 2954)
+++ pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_effort_controller.h 2008-08-12 20:35:34 UTC (rev 2955)
@@ -94,6 +94,11 @@
double getActual();
/*!
+ * \brief Get latest time..
+ */
+ double getTime();
+
+ /*!
* \brief Issues commands to the joint. Should be called at regular intervals
*/
Modified: pkg/trunk/controllers/generic_controllers/src/joint_effort_controller.cpp
===================================================================
--- pkg/trunk/controllers/generic_controllers/src/joint_effort_controller.cpp 2008-08-12 20:25:09 UTC (rev 2954)
+++ pkg/trunk/controllers/generic_controllers/src/joint_effort_controller.cpp 2008-08-12 20:35:34 UTC (rev 2955)
@@ -78,6 +78,11 @@
return joint_->applied_effort_;
}
+double JointVelocityController::getTime()
+{
+ return robot_->hw_->current_time_;
+}
+
void JointEffortController::update()
{
Modified: pkg/trunk/controllers/generic_controllers/src/joint_velocity_controller.cpp
===================================================================
--- pkg/trunk/controllers/generic_controllers/src/joint_velocity_controller.cpp 2008-08-12 20:25:09 UTC (rev 2954)
+++ pkg/trunk/controllers/generic_controllers/src/joint_velocity_controller.cpp 2008-08-12 20:35:34 UTC (rev 2955)
@@ -95,7 +95,7 @@
// Return the measured joint velocity
double JointVelocityController::getActual()
{
- return joint_->position_;
+ return joint_->velocity_;
}
void JointVelocityController::update()
@@ -145,7 +145,7 @@
generic_controllers::GetCommand::request &req,
generic_controllers::GetCommand::response &resp)
{
- resp.command = c_->getCommand();
+ resp.command = c_->getActual();
resp.time = c_->getTime();
return true;
Added: pkg/trunk/hardware_test/motors/xml/WG_3021.xml
===================================================================
--- pkg/trunk/hardware_test/motors/xml/WG_3021.xml (rev 0)
+++ pkg/trunk/hardware_test/motors/xml/WG_3021.xml 2008-08-12 20:35:34 UTC (rev 2955)
@@ -0,0 +1,30 @@
+<robot name="WG_3021">
+
+ <actuator name="3021_motor">
+ </actuator>
+
+ <joint name="test_joint" type="revolute">
+ <limitMin>-1.48</limitMin>
+ <limitMax>1.48</limitMax>
+ <effortLimit>0.184</effortLimit>
+ <velocityLimit>1256.0</velocityLimit>
+ </joint>
+
+ <transmission type="SimpleTransmission" name="test_transmission">
+ <actuator name="3021_motor" />
+ <joint name="test_joint" />
+ <mechanicalReduction>1</mechanicalReduction>
+ <motorTorqueConstant>-.0603</motorTorqueConstant>
+ <pulsesPerRevolution>1200</pulsesPerRevolution>
+ </transmission>
+
+ <controller name="test_controller" type="JointVelocityControllerNode">
+ <joint name="test_joint">
+ <pGain>0.0006</pGain>
+ <iGain>0.01</iGain>
+ <dGain>0</dGain>
+ <windup>0.007</windup>
+ </joint>
+ </controller>
+
+</robot>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jl...@us...> - 2008-08-12 21:05:26
|
Revision: 2958
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=2958&view=rev
Author: jleibs
Date: 2008-08-12 21:05:36 +0000 (Tue, 12 Aug 2008)
Log Message:
-----------
Moving hokuyo_tester into hardware_test directory.
Added Paths:
-----------
pkg/trunk/hardware_test/sensors/
pkg/trunk/hardware_test/sensors/hokuyo_tester/
Removed Paths:
-------------
pkg/trunk/drivers/laser/hokuyo_tester/
pkg/trunk/unported/laser_viewer/rosbuild
Deleted: pkg/trunk/unported/laser_viewer/rosbuild
===================================================================
--- pkg/trunk/unported/laser_viewer/rosbuild 2008-08-12 21:01:56 UTC (rev 2957)
+++ pkg/trunk/unported/laser_viewer/rosbuild 2008-08-12 21:05:36 UTC (rev 2958)
@@ -1,2 +0,0 @@
-#!/usr/bin/env ruby
-exec("#{`#{ENV['ROS_ROOT']}/rospack find rostools`}/scripts/yamlbuild", 'build.yaml', *ARGV)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <is...@us...> - 2008-08-12 21:08:17
|
Revision: 2959
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=2959&view=rev
Author: isucan
Date: 2008-08-12 21:08:23 +0000 (Tue, 12 Aug 2008)
Log Message:
-----------
added more code to string_utils (convert anything to string using streams), swithched it to new make system and added the ability to count errors to the robot description parser
Modified Paths:
--------------
pkg/trunk/robot_descriptions/wg_robot_description_parser/include/urdf/URDF.h
pkg/trunk/robot_descriptions/wg_robot_description_parser/manifest.xml
pkg/trunk/robot_descriptions/wg_robot_description_parser/src/urdf/URDF.cpp
pkg/trunk/robot_descriptions/wg_robot_description_parser/src/urdf/parse.cpp
pkg/trunk/robot_descriptions/wg_robot_description_parser/test/data/test1.xml
pkg/trunk/robot_descriptions/wg_robot_description_parser/test/test_cpp_parser.cpp
pkg/trunk/util/string_utils/Makefile
pkg/trunk/util/string_utils/include/string_utils/string_utils.h
pkg/trunk/util/string_utils/manifest.xml
Added Paths:
-----------
pkg/trunk/util/string_utils/CMakeLists.txt
pkg/trunk/util/string_utils/src/string_utils.cpp
Removed Paths:
-------------
pkg/trunk/util/string_utils/src/Makefile
pkg/trunk/util/string_utils/src/libstring_utils/
Modified: pkg/trunk/robot_descriptions/wg_robot_description_parser/include/urdf/URDF.h
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description_parser/include/urdf/URDF.h 2008-08-12 21:05:36 UTC (rev 2958)
+++ pkg/trunk/robot_descriptions/wg_robot_description_parser/include/urdf/URDF.h 2008-08-12 21:08:23 UTC (rev 2959)
@@ -478,6 +478,7 @@
URDF(const char *filename = NULL)
{
m_paths.push_back("");
+ m_errorCount = 0;
if (filename)
loadFile(filename);
}
@@ -560,6 +561,9 @@
/** Get the data that was defined at top level */
const Data& getData(void) const;
+ /** Return the number of encountered errors */
+ unsigned int getErrorCount(void) const;
+
protected:
/** Free the memory allocated in this class */
@@ -636,6 +640,9 @@
/** Print the error location, if known */
void errorLocation(const TiXmlNode* node = NULL) const;
+ /** Output an error message */
+ void errorMessage(const std::string& msg) const;
+
/** Compute the easy-access pointers inside the parsed datastructures */
void linkDatastructure(void);
@@ -669,6 +676,9 @@
/** Additional datastructure containing a list links that are connected to the environment */
std::vector<Link*> m_linkRoots;
+ /** Counter for errors */
+ mutable unsigned int m_errorCount;
+
private:
/** Temporary datastructure for keeping track link collision components */
Modified: pkg/trunk/robot_descriptions/wg_robot_description_parser/manifest.xml
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description_parser/manifest.xml 2008-08-12 21:05:36 UTC (rev 2958)
+++ pkg/trunk/robot_descriptions/wg_robot_description_parser/manifest.xml 2008-08-12 21:08:23 UTC (rev 2959)
@@ -11,6 +11,7 @@
<depend package="tinyxml"/>
<depend package="math_utils"/>
+ <depend package="string_utils"/>
<depend package="gtest"/>
<export>
Modified: pkg/trunk/robot_descriptions/wg_robot_description_parser/src/urdf/URDF.cpp
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description_parser/src/urdf/URDF.cpp 2008-08-12 21:05:36 UTC (rev 2958)
+++ pkg/trunk/robot_descriptions/wg_robot_description_parser/src/urdf/URDF.cpp 2008-08-12 21:08:23 UTC (rev 2959)
@@ -34,6 +34,7 @@
#include <urdf/URDF.h>
#include <math_utils/MathExpression.h>
+#include <string_utils/string_utils.h>
#include <cstring>
#include <fstream>
#include <sstream>
@@ -46,7 +47,8 @@
#define MARK_SET(node, owner, variable) \
{ \
if (owner->isSet[#variable]) { \
- fprintf(stderr, "'%s' already set\n", #variable); \
+ errorMessage("'" + std::string(#variable) + \
+ "' already set"); \
errorLocation(node); } \
else \
owner->isSet[#variable] = true; \
@@ -94,8 +96,14 @@
m_paths.push_back("");
m_linkRoots.clear();
clearTemporaryData();
+ m_errorCount = 0;
}
+ unsigned int URDF::getErrorCount(void) const
+ {
+ return m_errorCount;
+ }
+
const std::string& URDF::getRobotName(void) const
{
return m_name;
@@ -517,10 +525,21 @@
return false;
}
+ void URDF::errorMessage(const std::string &msg) const
+ {
+ std::cerr << msg << std::endl;
+ m_errorCount++;
+ }
+
void URDF::errorLocation(const TiXmlNode* node) const
{
if (!m_location.empty())
- fprintf(stderr, " ... at %s%s", m_location.c_str(), node ? "" : "\n");
+ {
+ std::cerr << " ... at " << m_location;
+ if (!node)
+ std::cerr << std::endl;
+ }
+
if (node)
{
/* find the document the node is part of */
@@ -528,11 +547,10 @@
while (doc && doc->Type() != TiXmlNode::DOCUMENT)
doc = doc->Parent();
const char *filename = doc ? reinterpret_cast<const char*>(doc->GetUserData()) : NULL;
- fprintf(stderr, "%s line %d, column %d", m_location.empty() ? " ..." : ",", node->Row(), node->Column());
+ std::cerr << (m_location.empty() ? " ..." : ",") << " line " << node->Row() << ", column " << node->Column();
if (filename)
- fprintf(stderr, " (%s)\n", filename);
- else
- fprintf(stderr, "\n");
+ std::cerr << " (" << filename << ")";
+ std::cerr << std::endl;
}
}
@@ -541,11 +559,11 @@
switch (node->Type())
{
case TiXmlNode::ELEMENT:
- fprintf(stderr, "Ignoring element node '%s'\n", node->Value());
+ errorMessage("Ignoring element node '" + node->ValueStr() + "'");
errorLocation(node);
break;
case TiXmlNode::TEXT:
- fprintf(stderr, "Ignoring text node with content '%s'\n", node->Value());
+ errorMessage("Ignoring text node with content '" + node->ValueStr() + "'");
errorLocation(node);
break;
case TiXmlNode::COMMENT:
@@ -553,7 +571,7 @@
break;
case TiXmlNode::UNKNOWN:
default:
- fprintf(stderr, "Ignoring unknown node '%s'\n", node->Value());
+ errorMessage("Ignoring unknown node '" + node->ValueStr() + "'");
errorLocation(node);
break;
}
@@ -572,7 +590,7 @@
std::map<std::string, const TiXmlNode*>::const_iterator pos = m_templates.find(attr->ValueStr());
if (pos == m_templates.end())
{
- fprintf(stderr, "Template '%s' is not defined\n", attr->Value());
+ errorMessage("Template '" + attr->ValueStr() + "' is not defined");
errorLocation(node);
}
else
@@ -649,7 +667,7 @@
result = parse(dynamic_cast<const TiXmlNode*>(doc));
}
else
- fprintf(stderr, "%s\n", doc->ErrorDesc());
+ errorMessage(doc->ErrorDesc());
return result;
}
@@ -668,7 +686,7 @@
result = parse(dynamic_cast<const TiXmlNode*>(doc));
}
else
- fprintf(stderr, "%s\n", doc->ErrorDesc());
+ errorMessage(doc->ErrorDesc());
return result;
}
@@ -689,7 +707,7 @@
result = parse(dynamic_cast<const TiXmlNode*>(doc));
}
else
- fprintf(stderr, "%s\n", doc->ErrorDesc());
+ errorMessage(doc->ErrorDesc());
return result;
}
@@ -741,17 +759,28 @@
struct getConstantData
{
+ getConstantData(void)
+ {
+ m = NULL;
+ errorCount = 0;
+ }
+
std::map<std::string, std::string> *m;
std::map<std::string, bool> s;
+
+ unsigned int errorCount;
+ std::vector<std::string> errorMsg;
};
static double getConstant(void *data, std::string &name)
{
getConstantData *d = reinterpret_cast<getConstantData*>(data);
std::map<std::string, std::string> *m = d->m;
+ assert(m);
if (m->find(name) == m->end())
{
- fprintf(stderr, "Request for undefined constant: '%s'\n", name.c_str());
+ d->errorMsg.push_back("Request for undefined constant: '" + name + "'");
+ d->errorCount++;
return 0.0;
}
else
@@ -761,7 +790,8 @@
std::map<std::string, bool>::iterator pos = d->s.find((*m)[name]);
if (pos != d->s.end() && pos->second == true)
{
- fprintf(stderr, "Recursive definition of constant '%s'\n", name.c_str());
+ d->errorMsg.push_back("Recursive definition of constant '" + name + "'");
+ d->errorCount++;
return 0.0;
}
d->s[(*m)[name]] = true;
@@ -797,6 +827,13 @@
data.m = &m_constants;
vals[i] = meval::EvaluateMathExpression(value, &getConstant, reinterpret_cast<void*>(&data));
read++;
+ for (unsigned int k = 0 ; k < data.errorMsg.size() ; ++k)
+ errorMessage(data.errorMsg[k]);
+ if (data.errorCount)
+ {
+ m_errorCount += data.errorCount;
+ errorLocation(node);
+ }
}
if (ss.good())
@@ -812,14 +849,14 @@
}
if (!extra.empty())
{
- fprintf(stderr, "More data available (%u read, rest is ignored): '%s'\n", read, data.c_str());
+ errorMessage("More data available (" + string_utils::convert2str(read) + " read, rest is ignored): '" + data + "'");
errorLocation(node);
}
}
if (read != count)
{
- fprintf(stderr, "Not all values were read: '%s'\n", data.c_str());
+ errorMessage("Not all values were read: '" + data + "'");
errorLocation(node);
}
@@ -864,15 +901,15 @@
break;
}
if (!extra.empty())
- {
- fprintf(stderr, "More data available (%u read, rest is ignored): '%s'\n", read, data.c_str());
+ {
+ errorMessage("More data available (" + string_utils::convert2str(read) + " read, rest is ignored): '" + data + "'");
errorLocation(node);
}
}
if (read != count)
{
- fprintf(stderr, "Not all values were read: '%s'\n", data.c_str());
+ errorMessage("Not all values were read: '" + data + "'");
errorLocation(node);
}
@@ -889,7 +926,10 @@
Transmission *transmission = (m_transmissions.find(name) != m_transmissions.end()) ? m_transmissions[name] : new Transmission();
transmission->name = name;
if (transmission->name.empty())
- fprintf(stderr, "No transmission name given\n");
+ {
+ errorMessage("No transmission name given");
+ errorLocation(node);
+ }
else
MARK_SET(node, transmission, name);
@@ -920,7 +960,10 @@
Actuator *actuator = (m_actuators.find(name) != m_actuators.end()) ? m_actuators[name] : new Actuator();
actuator->name = name;
if (actuator->name.empty())
- fprintf(stderr, "No actuator name given\n");
+ {
+ errorMessage("No actuator name given");
+ errorLocation(node);
+ }
else
MARK_SET(node, actuator, name);
@@ -951,7 +994,10 @@
Frame *frame = (m_frames.find(name) != m_frames.end()) ? m_frames[name] : new Frame();
frame->name = name;
if (frame->name.empty())
- fprintf(stderr, "No frame name given\n");
+ {
+ errorMessage("No frame name given");
+ errorLocation(node);
+ }
else
MARK_SET(node, frame, name);
@@ -977,7 +1023,7 @@
frame->linkName = node->FirstChild()->ValueStr();
MARK_SET(node, frame, parent);
if (frame->type == Frame::CHILD)
- fprintf(stderr, "Frame '%s' can only have either a child or a parent link\n", frame->name.c_str());
+ errorMessage("Frame '" + frame->name + "' can only have either a child or a parent link");
frame->type = Frame::PARENT;
}
else if (node->ValueStr() == "child" && node->FirstChild() && node->FirstChild()->Type() == TiXmlNode::TEXT)
@@ -985,7 +1031,7 @@
frame->linkName = node->FirstChild()->ValueStr();
MARK_SET(node, frame, child);
if (frame->type == Frame::PARENT)
- fprintf(stderr, "Frame '%s' can only have either a child or a parent link\n", frame->name.c_str());
+ errorMessage("Frame '" + frame->name + "' can only have either a child or a parent link");
frame->type = Frame::CHILD;
}
else
@@ -1013,7 +1059,7 @@
{
if (m_joints.find(name) == m_joints.end())
{
- fprintf(stderr, "Attempting to add information to an undefined joint: '%s'\n", name.c_str());
+ errorMessage("Attempting to add information to an undefined joint: '" + name + "'");
errorLocation(node);
return;
}
@@ -1041,7 +1087,7 @@
joint->type = Link::Joint::PLANAR;
else
{
- fprintf(stderr, "Unknown joint type: '%s'\n", attr->Value());
+ errorMessage("Unknown joint type: '" + attr->ValueStr() + "'");
errorLocation(node);
}
MARK_SET(node, joint, type);
@@ -1110,7 +1156,7 @@
{
if (m_geoms.find(name) == m_geoms.end())
{
- fprintf(stderr, "Attempting to add information to an undefined geometry: '%s'\n", name.c_str());
+ errorMessage("Attempting to add information to an undefined geometry: '" + name + "'");
errorLocation(node);
return;
}
@@ -1148,7 +1194,7 @@
}
else
{
- fprintf(stderr, "Unknown geometry type: '%s'\n", attr->Value());
+ errorMessage("Unknown geometry type: '" + attr->ValueStr() + "'");
errorLocation(node);
}
MARK_SET(node, geometry, type);
@@ -1197,7 +1243,7 @@
{
if (m_collision.find(name) == m_collision.end())
{
- fprintf(stderr, "Attempting to add information to an undefined collision: '%s'\n", name.c_str());
+ errorMessage("Attempting to add information to an undefined collision: '" + name + "'");
errorLocation(node);
return;
}
@@ -1262,7 +1308,7 @@
{
if (m_visual.find(name) == m_visual.end())
{
- fprintf(stderr, "Attempting to add information to an undefined visual: '%s'\n", name.c_str());
+ errorMessage("Attempting to add information to an undefined visual: '" + name + "'");
errorLocation(node);
return;
}
@@ -1327,7 +1373,7 @@
{
if (m_inertial.find(name) == m_inertial.end())
{
- fprintf(stderr, "Attempting to add information to an undefined inertial component: '%s'\n", name.c_str());
+ errorMessage("Attempting to add information to an undefined inertial component: '" + name + "'");
errorLocation(node);
return;
}
@@ -1378,13 +1424,16 @@
Link *link = (m_links.find(name) != m_links.end()) ? m_links[name] : new Link();
link->name = name;
if (link->name.empty())
- fprintf(stderr, "No link name given\n");
+ {
+ errorMessage("No link name given");
+ errorLocation(node);
+ }
else
MARK_SET(node, link, name);
m_links[link->name] = link;
if (link->canSense())
- fprintf(stderr, "Link '%s' was already defined as a sensor\n", link->name.c_str());
+ errorMessage("Link '" + link->name + "' was already defined as a sensor");
std::string currentLocation = m_location;
m_location = "link '" + name + "'";
@@ -1451,17 +1500,17 @@
Sensor *sensor = (m_links.find(name) != m_links.end()) ? dynamic_cast<Sensor*>(m_links[name]) : new Sensor();
if (!sensor)
{
- fprintf(stderr, "Link with name '%s' has already been defined\n", name.c_str());
+ errorMessage("Link with name '" + name + "' has already been defined");
sensor = new Sensor();
}
sensor->name = name;
if (sensor->name.empty())
- fprintf(stderr, "No sensor name given\n");
+ errorMessage("No sensor name given");
else
MARK_SET(node, sensor, name);
if (m_links.find(sensor->name) != m_links.end())
- fprintf(stderr, "Sensor '%s' redefined\n", sensor->name.c_str());
+ errorMessage("Sensor '" + sensor->name + "' redefined");
m_links[sensor->name] = dynamic_cast<Link*>(sensor);
std::string currentLocation = m_location;
@@ -1480,7 +1529,7 @@
sensor->type = Sensor::STEREO_CAMERA;
else
{
- fprintf(stderr, "Unknown sensor type: '%s'\n", attr->Value());
+ errorMessage("Unknown sensor type: '" + attr->ValueStr() + "'");
errorLocation(node);
}
MARK_SET(node, sensor, type);
@@ -1564,12 +1613,12 @@
}
}
else
- fprintf(stderr, "Unable to load %s\n", filename);
+ errorMessage("Unable to load " + std::string(filename));
delete doc;
free(filename);
}
else
- fprintf(stderr, "Unable to find %s\n", elem->FirstChild()->Value());
+ errorMessage("Unable to find " + elem->FirstChild()->ValueStr());
if (change)
return true;
}
@@ -1651,10 +1700,9 @@
continue;
}
if (i->second->joint->type == Link::Joint::FLOATING || i->second->joint->type == Link::Joint::PLANAR)
- fprintf(stderr, "Link '%s' uses a free joint (floating or planar) but its parent is not the environment!\n", i->second->name.c_str());
+ errorMessage("Link '" + i->second->name + "' uses a free joint (floating or planar) but its parent is not the environment!");
if (m_links.find(i->second->parentName) == m_links.end())
- fprintf(stderr, "Parent of link '%s' is undefined: '%s'\n", i->second->name.c_str(),
- i->second->parentName.c_str());
+ errorMessage("Parent of link '" + i->second->name + "' is undefined: '" + i->second->parentName + "'");
else
{
Link *parent = m_links[i->second->parentName];
@@ -1669,7 +1717,7 @@
if (m_links.find(i->second->linkName) != m_links.end())
i->second->link = m_links[i->second->linkName];
else
- fprintf(stderr, "Frame '%s' refers to unknown link ('%s')\n", i->first.c_str(), i->second->linkName.c_str());
+ errorMessage("Frame '" + i->first + "' refers to unknown link ('" + i->second->linkName + "')");
}
/* for each group, compute the pointers to the links they contain, and for every link,
@@ -1683,7 +1731,7 @@
if (m_links.find(i->second->linkNames[j]) == m_links.end())
{
if (m_frames.find(i->second->linkNames[j]) == m_frames.end())
- fprintf(stderr, "Group '%s': '%s' is not defined as a link or frame\n", i->first.c_str(), i->second->linkNames[j].c_str());
+ errorMessage("Group '" + i->first + "': '" + i->second->linkNames[j] + "' is not defined as a link or frame");
else
{
/* name is a frame */
@@ -1697,7 +1745,7 @@
{
/* name is a link */
if (m_frames.find(i->second->linkNames[j]) != m_frames.end())
- fprintf(stderr, "Name '%s' is used both for a link and a frame\n", i->second->linkNames[j].c_str());
+ errorMessage("Name '" + i->second->linkNames[j] + "' is used both for a link and a frame");
Link* l = m_links[i->second->linkNames[j]];
l->groups.push_back(i->second);
@@ -1765,7 +1813,7 @@
{
case TiXmlNode::DOCUMENT:
if (dynamic_cast<const TiXmlDocument*>(node)->RootElement()->ValueStr() != "robot")
- fprintf(stderr, "File '%s' does not start with the <robot> tag\n", m_source.c_str());
+ errorMessage("File '" + m_source + "' does not start with the <robot> tag");
/* stage 1: extract templates, constants, groups */
parse(dynamic_cast<const TiXmlNode*>(dynamic_cast<const TiXmlDocument*>(node)->RootElement()));
@@ -1776,7 +1824,7 @@
{
const TiXmlElement *elem = m_stage2[i]->ToElement();
if (!elem)
- fprintf(stderr, "Non-element node found in second stage of parsing. This should NOT happen\n");
+ errorMessage("Non-element node found in second stage of parsing. This should NOT happen");
else
{
std::string name = elem->ValueStr();
@@ -1822,7 +1870,7 @@
{
std::string nameStr = name;
if (!m_name.empty() && nameStr != m_name)
- fprintf(stderr, "Loading a file with contradicting robot name: '%s' - '%s'\n", m_name.c_str(), name);
+ errorMessage("Loading a file with contradicting robot name: '" + m_name + "' - '" + name + "'");
m_name = nameStr;
}
for (const TiXmlNode *child = node->FirstChild() ; child ; child = child->NextSibling())
@@ -1843,15 +1891,15 @@
{
addPath(filename);
if (doc->RootElement()->ValueStr() != "robot")
- fprintf(stderr, "Included file '%s' does not start with the <robot> tag\n", filename);
-
+ errorMessage("Included file '" + std::string(filename) + "' does not start with the <robot> tag");
+
parse(dynamic_cast<const TiXmlNode*>(doc->RootElement()));
}
else
- fprintf(stderr, "Unable to load %s\n", filename);
+ errorMessage("Unable to load " + std::string(filename));
}
else
- fprintf(stderr, "Unable to find %s\n", node->FirstChild()->Value());
+ errorMessage("Unable to find " + node->FirstChild()->ValueStr());
}
else
ignoreNode(node);
@@ -1871,7 +1919,10 @@
}
if (!node->NoChildren())
- fprintf(stderr, "Constant '%s' appears to contain tags. This should not be the case.\n", name.c_str());
+ {
+ errorMessage("Constant '" + name + "' appears to contain tags. This should not be the case.");
+ errorLocation(node);
+ }
m_constants[name] = value;
}
@@ -1930,7 +1981,7 @@
if (g->linkNames.empty())
{
- fprintf(stderr, "Group '%s' is empty. Not adding to list of groups.\n", g->name.c_str());
+ errorMessage("Group '" + g->name + "' is empty. Not adding to list of groups.");
m_groups.erase(m_groups.find(g->name));
delete g;
}
@@ -1956,37 +2007,37 @@
Link::Joint *joint = links[i]->joint;
if (joint->type == Link::Joint::UNKNOWN)
- fprintf(stderr, "Joint '%s' in link '%s' is of unknown type\n", joint->name.c_str(), links[i]->name.c_str());
+ errorMessage("Joint '" + joint->name + "' in link '" + links[i]->name + "' is of unknown type");
if (joint->type == Link::Joint::REVOLUTE || joint->type == Link::Joint::PRISMATIC)
{
if (joint->axis[0] == 0.0 && joint->axis[1] == 0.0 && joint->axis[2] == 0.0)
- fprintf(stderr, "Joint '%s' in link '%s' does not seem to have its axis properly set\n", joint->name.c_str(), links[i]->name.c_str());
+ errorMessage("Joint '" + joint->name + "' in link '" + links[i]->name + "' does not seem to have its axis properly set");
if ((joint->isSet["limit"] || joint->type == Link::Joint::PRISMATIC) && joint->limit[0] == 0.0 && joint->limit[1] == 0.0)
- fprintf(stderr, "Joint '%s' in link '%s' does not seem to have its limits properly set\n", joint->name.c_str(), links[i]->name.c_str());
+ errorMessage("Joint '" + joint->name + "' in link '" + links[i]->name + "' does not seem to have its limits properly set");
}
Link::Geometry *cgeom = links[i]->collision->geometry;
if (cgeom->type == Link::Geometry::UNKNOWN)
- fprintf(stderr, "Collision geometry '%s' in link '%s' is of unknown type\n", cgeom->name.c_str(), links[i]->name.c_str());
+ errorMessage("Collision geometry '" + cgeom->name + "' in link '" + links[i]->name + "' is of unknown type");
if (cgeom->type != Link::Geometry::UNKNOWN && cgeom->type != Link::Geometry::MESH)
{
int nzero = 0;
for (int k = 0 ; k < cgeom->nsize ; ++k)
nzero += cgeom->size[k] == 0.0 ? 1 : 0;
if (nzero > 0)
- fprintf(stderr, "Collision geometry '%s' in link '%s' does not seem to have its size properly set\n", cgeom->name.c_str(), links[i]->name.c_str());
+ errorMessage("Collision geometry '" + cgeom->name + "' in link '" + links[i]->name + "' does not seem to have its size properly set");
}
Link::Geometry *vgeom = links[i]->visual->geometry;
if (vgeom->type == Link::Geometry::UNKNOWN)
- fprintf(stderr, "Visual geometry '%s' in link '%s' is of unknown type\n", vgeom->name.c_str(), links[i]->name.c_str());
+ errorMessage("Visual geometry '" + vgeom->name + "' in link '" + links[i]->name + "' is of unknown type");
if (vgeom->type != Link::Geometry::UNKNOWN && vgeom->type != Link::Geometry::MESH)
{
int nzero = 0;
for (int k = 0 ; k < vgeom->nsize ; ++k)
nzero += vgeom->size[k] == 0.0 ? 1 : 0;
if (nzero > 0)
- fprintf(stderr, "Visual geometry '%s' in link '%s' does not seem to have its size properly set\n", vgeom->name.c_str(), links[i]->name.c_str());
+ errorMessage("Visual geometry '" + vgeom->name + "' in link '" + links[i]->name + "' does not seem to have its size properly set");
}
}
}
Modified: pkg/trunk/robot_descriptions/wg_robot_description_parser/src/urdf/parse.cpp
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description_parser/src/urdf/parse.cpp 2008-08-12 21:05:36 UTC (rev 2958)
+++ pkg/trunk/robot_descriptions/wg_robot_description_parser/src/urdf/parse.cpp 2008-08-12 21:08:23 UTC (rev 2959)
@@ -1,4 +1,5 @@
#include <urdf/URDF.h>
+#include <cstdio>
int main(int argc, char **argv)
{
@@ -7,7 +8,8 @@
robot_desc::URDF file(argv[1]);
if (argc >= 3)
file.print();
- file.sanityCheck();
+ file.sanityCheck();
+ printf("%u errors\n", file.getErrorCount());
}
return 0;
Modified: pkg/trunk/robot_descriptions/wg_robot_description_parser/test/data/test1.xml
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description_parser/test/data/test1.xml 2008-08-12 21:05:36 UTC (rev 2958)
+++ pkg/trunk/robot_descriptions/wg_robot_description_parser/test/data/test1.xml 2008-08-12 21:08:23 UTC (rev 2959)
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+
+<robot name="robot">
+
+</robot>
Modified: pkg/trunk/robot_descriptions/wg_robot_description_parser/test/test_cpp_parser.cpp
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description_parser/test/test_cpp_parser.cpp 2008-08-12 21:05:36 UTC (rev 2958)
+++ pkg/trunk/robot_descriptions/wg_robot_description_parser/test/test_cpp_parser.cpp 2008-08-12 21:08:23 UTC (rev 2959)
@@ -1,11 +1,18 @@
#include <urdf/URDF.h>
#include <gtest/gtest.h>
#include <cstdlib>
+#include <string>
using namespace robot_desc;
+int runExternalProcess(const std::string &executable, const std::string &args)
+{
+ return system((executable + " " + args).c_str());
+}
+
TEST(URDF, EmptyFile)
{
- EXPECT_TRUE(true);
+ URDF file;
+ EXPECT_TRUE(file.loadFile("test/data/test1.xml"));
}
int main(int argc, char **argv)
Added: pkg/trunk/util/string_utils/CMakeLists.txt
===================================================================
--- pkg/trunk/util/string_utils/CMakeLists.txt (rev 0)
+++ pkg/trunk/util/string_utils/CMakeLists.txt 2008-08-12 21:08:23 UTC (rev 2959)
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 2.6)
+include(rosbuild)
+rospack(string_utils)
+rospack_add_library(string_utils src/string_utils.cpp)
Modified: pkg/trunk/util/string_utils/Makefile
===================================================================
--- pkg/trunk/util/string_utils/Makefile 2008-08-12 21:05:36 UTC (rev 2958)
+++ pkg/trunk/util/string_utils/Makefile 2008-08-12 21:08:23 UTC (rev 2959)
@@ -1,3 +1 @@
-SUBDIRS = src
-include $(shell rospack find mk)/recurse_subdirs.mk
-
+include $(shell rospack find mk)/cmake.mk
Modified: pkg/trunk/util/string_utils/include/string_utils/string_utils.h
===================================================================
--- pkg/trunk/util/string_utils/include/string_utils/string_utils.h 2008-08-12 21:05:36 UTC (rev 2958)
+++ pkg/trunk/util/string_utils/include/string_utils/string_utils.h 2008-08-12 21:08:23 UTC (rev 2959)
@@ -3,13 +3,21 @@
#include <string>
#include <vector>
+#include <sstream>
namespace string_utils
{
-void split(const std::string &str,
- std::vector<std::string> &token_vec,
- const std::string &delim);
+ void split(const std::string &str,
+ std::vector<std::string> &token_vec,
+ const std::string &delim);
+
+ template<typename T>
+ static inline std::string convert2str(const T &value)
+ {
+ std::stringstream ss;
+ ss << value;
+ return ss.str();
+ }
}
#endif
-
Modified: pkg/trunk/util/string_utils/manifest.xml
===================================================================
--- pkg/trunk/util/string_utils/manifest.xml 2008-08-12 21:05:36 UTC (rev 2958)
+++ pkg/trunk/util/string_utils/manifest.xml 2008-08-12 21:08:23 UTC (rev 2959)
@@ -1,18 +1,17 @@
<package>
<description brief="String Utilities">
- This package provides a simple static library which makes dealing
+ This package provides a simple library which makes dealing
with strings in C++ a bit less of a headache. This includes tokenizer
wrappers, etc. I suppose we could add utilities for other languages
in here, but most modern languages seem to have nice string stuff
provided already.
</description>
- <author>Morgan Quigley (email: mqu...@cs...)</author>
+ <author>Morgan Quigley (email: mqu...@cs...), Ioan Sucan</author>
<license>BSD</license>
<url>http://stair.stanford.edu</url>
<export>
- <cpp cflags="-I${prefix}/include" lflags="-L${prefix}/lib -lstring_utils"/>
+ <cpp cflags="-I${prefix}/include" lflags="-Wl,-rpath,${prefix}/lib -L${prefix}/lib -lstring_utils"/>
</export>
</package>
-
Deleted: pkg/trunk/util/string_utils/src/Makefile
===================================================================
--- pkg/trunk/util/string_utils/src/Makefile 2008-08-12 21:05:36 UTC (rev 2958)
+++ pkg/trunk/util/string_utils/src/Makefile 2008-08-12 21:08:23 UTC (rev 2959)
@@ -1,3 +0,0 @@
-SUBDIRS = libstring_utils
-include $(shell rospack find mk)/recurse_subdirs.mk
-
Added: pkg/trunk/util/string_utils/src/string_utils.cpp
===================================================================
--- pkg/trunk/util/string_utils/src/string_utils.cpp (rev 0)
+++ pkg/trunk/util/string_utils/src/string_utils.cpp 2008-08-12 21:08:23 UTC (rev 2959)
@@ -0,0 +1,13 @@
+#include <string_utils/string_utils.h>
+
+void string_utils::split(const std::string &s, std::vector<std::string> &t, const std::string &d)
+{
+ t.clear();
+ std::size_t start = 0, end;
+ while ((end = s.find_first_of(d, start)) != std::string::npos)
+ {
+ t.push_back(s.substr(start, end-start));
+ start = end + 1;
+ }
+ t.push_back(s.substr(start));
+}
This was sent by the SourceForge.net collaborative devel...
[truncated message content] |
|
From: <adv...@us...> - 2008-08-12 21:54:11
|
Revision: 2963
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=2963&view=rev
Author: advaitjain
Date: 2008-08-12 21:54:20 +0000 (Tue, 12 Aug 2008)
Log Message:
-----------
overhead_grasp_behavior uses gmmseg to segment the object,
find orientation and refine object's position.
fixed some minor bugs in gmmseg.
Modified Paths:
--------------
pkg/trunk/manip/overhead_grasp_behavior/CMakeLists.txt
pkg/trunk/manip/overhead_grasp_behavior/manifest.xml
pkg/trunk/manip/overhead_grasp_behavior/overhead_grasp.xml
pkg/trunk/manip/overhead_grasp_behavior/src/overhead_grasp.cc
pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_tablegrasp.world
pkg/trunk/util/pyrob/src/pyrob/util.py
pkg/trunk/vision/gmmseg/manifest.xml
pkg/trunk/vision/gmmseg/nodes/gmm_client.py
pkg/trunk/vision/gmmseg/nodes/gmm_segment.py
Modified: pkg/trunk/manip/overhead_grasp_behavior/CMakeLists.txt
===================================================================
--- pkg/trunk/manip/overhead_grasp_behavior/CMakeLists.txt 2008-08-12 21:51:50 UTC (rev 2962)
+++ pkg/trunk/manip/overhead_grasp_behavior/CMakeLists.txt 2008-08-12 21:54:20 UTC (rev 2963)
@@ -1,8 +1,10 @@
cmake_minimum_required(VERSION 2.6)
include(rosbuild)
add_definitions(-Wall)
+
rospack(overhead_grasp_behavior)
+set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
-rospack_add_executable(bin/overhead_grasp src/overhead_grasp.cc)
+rospack_add_executable(overhead_grasp src/overhead_grasp.cc)
Modified: pkg/trunk/manip/overhead_grasp_behavior/manifest.xml
===================================================================
--- pkg/trunk/manip/overhead_grasp_behavior/manifest.xml 2008-08-12 21:51:50 UTC (rev 2962)
+++ pkg/trunk/manip/overhead_grasp_behavior/manifest.xml 2008-08-12 21:54:20 UTC (rev 2963)
@@ -10,4 +10,5 @@
<depend package="libpr2API"/>
<depend package="pr2_gazebo"/>
<depend package="pr2_kinematic_controllers"/>
+<depend package="gmmseg" />
</package>
Modified: pkg/trunk/manip/overhead_grasp_behavior/overhead_grasp.xml
===================================================================
--- pkg/trunk/manip/overhead_grasp_behavior/overhead_grasp.xml 2008-08-12 21:51:50 UTC (rev 2962)
+++ pkg/trunk/manip/overhead_grasp_behavior/overhead_grasp.xml 2008-08-12 21:54:20 UTC (rev 2963)
@@ -6,6 +6,7 @@
<node pkg="pr2_gazebo" type="run-pr2_gazebo.sh" args="" respawn="true" />
<node pkg="pr2_kinematic_controllers" type="pr2_kinematic_controllers" respawn="true" />
<node pkg="overhead_grasp_behavior" type="overhead_grasp" respawn="true" />
+ <node pkg="gmmseg" type="gmm_segment.py" args="image:=image_wrist_right" respawn="true" />
</group>
</launch>
Modified: pkg/trunk/manip/overhead_grasp_behavior/src/overhead_grasp.cc
===================================================================
--- pkg/trunk/manip/overhead_grasp_behavior/src/overhead_grasp.cc 2008-08-12 21:51:50 UTC (rev 2962)
+++ pkg/trunk/manip/overhead_grasp_behavior/src/overhead_grasp.cc 2008-08-12 21:54:20 UTC (rev 2963)
@@ -16,7 +16,9 @@
#include <rosgazebo/GripperCmd.h>
#include <std_msgs/PR2Arm.h>
+#include <gmmseg/hrl_grasp.h>
+
using namespace KDL;
class OverheadGrasper : public ros::node
@@ -28,7 +30,7 @@
pr2_msgs::EndEffectorState rightEndEffectorMsg;
Frame right_tooltip_frame;
Vector objectPosition;
- const static double PR2_GRIPPER_LENGTH = 0.155;
+ const static double PR2_GRIPPER_LENGTH = 0.16;
Vector CAMERA_ENDEFFECTOR; // position of camera relative to end effector in end effector frame.
public:
@@ -113,20 +115,25 @@
void moveArmSegmentation()
{
-// gmmseg::hrl_grasp:request req;
-// gmmseg::hrl_grasp:response res;
-// req.height = right_tooltip_frame.p[2] - objectPosition[2] - CAMERA_ENDEFFECTOR[0];
-// if (ros::service::call("hrl_grasp", req, res)==false)
-// {
-// printf("[overhead_grasp_behavior] <overhead_grasp.cpp> {segmentObject} hrl_grasp service failed.\nExiting..\n");
-// exit(0);
-// }
-// Vector move(-1*res.y, -1*res.x, 0);
-// Rotation r = Rotation::RotY(deg2rad*90)*Rotation::RotX(res.theta); // look down vertically, with correct wrist roll
+ gmmseg::hrl_grasp::request req;
+ gmmseg::hrl_grasp::response res;
+ req.height = right_tooltip_frame.p[2] - objectPosition[2] - CAMERA_ENDEFFECTOR[0];
+ if (ros::service::call("hrl_grasp", req, res)==false)
+ {
+ printf("[overhead_grasp_behavior] <overhead_grasp.cpp> {segmentObject} hrl_grasp service failed.\nExiting..\n");
+ exit(0);
+ }
+ Vector move(-1*res.y, -1*res.x, 0);
+ cout<<"move: "<<move<<"\n";
- Vector move(0,0,0);
move += Rotation::RotY(deg2rad*90)*CAMERA_ENDEFFECTOR;
- Rotation r = Rotation::RotY(deg2rad*90)*Rotation::RotY(deg2rad*90); // look down vertically, with correct wrist roll
+
+ if (res.theta>0)
+ res.theta = deg2rad*90-res.theta;
+ else
+ res.theta = -1*(res.theta+deg2rad*90);
+
+ Rotation r = Rotation::RotY(deg2rad*90)*Rotation::RotY(deg2rad*90)*Rotation::RotZ(res.theta); // look down vertically, with correct wrist roll
Vector goto_point = right_tooltip_frame.p+move;
cout<<"Going to: "<<goto_point<<endl;
positionArmCartesian(goto_point, r);
Modified: pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_tablegrasp.world
===================================================================
--- pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_tablegrasp.world 2008-08-12 21:51:50 UTC (rev 2962)
+++ pkg/trunk/robot_descriptions/gazebo_robot_description/world/robot_tablegrasp.world 2008-08-12 21:54:20 UTC (rev 2963)
@@ -151,18 +151,18 @@
<!-- The small box "cup" -->
<model:physical name="object1_model">
<xyz> 0.620 -0.45 0.65</xyz>
- <rpy> 0.0 0.0 0.0</rpy>
+ <rpy> 0.0 0.0 -30.0</rpy>
<body:box name="object1_body">
<geom:box name="object1_geom">
<kp>100000000.0</kp>
<kd>0.1</kd>
<mesh>default</mesh>
- <size>0.1 0.03 0.03</size>
+ <size>0.1 0.03 0.06</size>
<mass> 0.05</mass>
<mu1> 500.0 </mu1>
<mu2> 500.0 </mu2>
<visual>
- <size> 0.1 0.030 0.03</size>
+ <size> 0.1 0.030 0.06</size>
<material>Gazebo/PioneerBody</material>
<mesh>unit_box</mesh>
</visual>
Modified: pkg/trunk/util/pyrob/src/pyrob/util.py
===================================================================
--- pkg/trunk/util/pyrob/src/pyrob/util.py 2008-08-12 21:51:50 UTC (rev 2962)
+++ pkg/trunk/util/pyrob/src/pyrob/util.py 2008-08-12 21:54:20 UTC (rev 2963)
@@ -159,12 +159,10 @@
cv.CV_8UC4 : (np.uint8, 4)}
def ros2cv(image):
- if image.colorspace == 'rgb24':
- format = 'RGB'
- elif image.colorspace == 'mono8':
+ if image.colorspace == 'mono8':
format = 'L'
else:
- raise RuntimeError('ros2cv: invalid colorspace in ROS image\'s im.colorspace.')
+ format = 'RGB'
pil_image = Image.fromstring(format, (image.width, image.height), image.data)
pil_image.save('ros2cv.bmp', 'BMP')
Modified: pkg/trunk/vision/gmmseg/manifest.xml
===================================================================
--- pkg/trunk/vision/gmmseg/manifest.xml 2008-08-12 21:51:50 UTC (rev 2962)
+++ pkg/trunk/vision/gmmseg/manifest.xml 2008-08-12 21:54:20 UTC (rev 2963)
@@ -10,5 +10,8 @@
<depend package="pyrob"/>
<depend package="numpy"/>
<depend package="rospy"/>
- <depend package="std_msgs"/>
+ <depend package="std_msgs"/>
+ <export>
+ <cpp cflags="-I${prefix}/srv/cpp" />
+ </export>
</package>
Modified: pkg/trunk/vision/gmmseg/nodes/gmm_client.py
===================================================================
--- pkg/trunk/vision/gmmseg/nodes/gmm_client.py 2008-08-12 21:51:50 UTC (rev 2962)
+++ pkg/trunk/vision/gmmseg/nodes/gmm_client.py 2008-08-12 21:54:20 UTC (rev 2963)
@@ -10,8 +10,8 @@
import rospy
import sys
-rospy.wait_for_service('gmm_segment')
-segment_proxy = rospy.ServiceProxy('gmm_segment', srv.hrl_grasp)
-result = segment_proxy.call(srv.hrl_graspRequest(float(sys.argv[0])))
+rospy.wait_for_service('hrl_grasp')
+segment_proxy = rospy.ServiceProxy('hrl_grasp', srv.hrl_grasp)
+result = segment_proxy.call(srv.hrl_graspRequest(float(sys.argv[1])))
print result.x, result.y, result.z, result.theta
Modified: pkg/trunk/vision/gmmseg/nodes/gmm_segment.py
===================================================================
--- pkg/trunk/vision/gmmseg/nodes/gmm_segment.py 2008-08-12 21:51:50 UTC (rev 2962)
+++ pkg/trunk/vision/gmmseg/nodes/gmm_segment.py 2008-08-12 21:54:20 UTC (rev 2963)
@@ -1,3 +1,4 @@
+#!/usr/bin/python
'''
@package gmm_segment
Provides Gaussian mixture segmentation service.
@@ -13,6 +14,7 @@
import pyrob.util as ut
import sys, time, math
import opencv.highgui as hg
+import time
CAMERA_FOV = 60.0
CAMERA_WIDTH = 640
@@ -27,19 +29,40 @@
self.fy = CAMERA_HEIGHT / t30
def segment(self, request):
+ print 'Hey Advait, I want to segment the image'
while self.image == None:
time.sleep(0.1)
self.lock.acquire()
- sego = tg.segment_center_object(self.image)
+ sego = tg.segment_center_object(self.image, display_on=False)
self.lock.release()
z = request.height
- u = sego.fg_object_ellipse.center[0]
- v = sego.fg_object_ellipse.center[1]
+ u = sego.fg_object_ellipse.center[0] - (CAMERA_WIDTH / 2.0)
+ v = sego.fg_object_ellipse.center[1] - (CAMERA_HEIGHT / 2.0)
x = u * z / self.fx
y = v * z / self.fy
theta = sego.fg_object_ellipse.angle
+
+ if theta > 90:
+ theta = theta - 180
+ if theta < -90:
+ theta = theta + 180
+
+ theta = math.radians(theta)
+
+# if True:
+# image_list = sego.get_images_for_display()
+# image_list.append( cvimg )
+#
+# curtime = time.localtime()
+# date_name = time.strftime('%Y%m%d%I%M', curtime)
+#
+# for i,img in enumerate(image_list):
+# fname = date_name+'_image%d.png'%(i)
+# hg.cvSaveImage( fname, img )
+
+
return srv.hrl_graspResponse(x, y, request.height, theta)
def set_image(self, image):
@@ -55,7 +78,7 @@
rospy.TopicSub('image', RImage, sn.set_image)
rospy.ready(sys.argv[0])
- segment_service = rospy.Service('gmm_segment', srv.hrl_grasp, sn.segment)
+ segment_service = rospy.Service('hrl_grasp', srv.hrl_grasp, sn.segment)
segment_service.register()
rospy.spin()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jl...@us...> - 2008-08-13 02:00:30
|
Revision: 2989
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=2989&view=rev
Author: jleibs
Date: 2008-08-13 02:00:36 +0000 (Wed, 13 Aug 2008)
Log Message:
-----------
Changed hokuyo self test over to use new DiagnosticStatus version in robot_srvs.
Modified Paths:
--------------
pkg/trunk/drivers/laser/hokuyourg_player/hokuyourg_player.cc
pkg/trunk/drivers/laser/hokuyourg_player/manifest.xml
pkg/trunk/hardware_test/sensors/hokuyo_tester/CMakeLists.txt
pkg/trunk/hardware_test/sensors/hokuyo_tester/manifest.xml
pkg/trunk/hardware_test/sensors/hokuyo_tester/src/hokuyo_tester/hokuyo_tester.cpp
pkg/trunk/hardware_test/sensors/hokuyo_tester/src/hokuyo_tester/hokuyo_tester.h
pkg/trunk/hardware_test/sensors/hokuyo_tester/src/standalone/standalone.cpp
pkg/trunk/robot_msgs/msg/DiagnosticStatus.msg
Modified: pkg/trunk/drivers/laser/hokuyourg_player/hokuyourg_player.cc
===================================================================
--- pkg/trunk/drivers/laser/hokuyourg_player/hokuyourg_player.cc 2008-08-13 01:49:54 UTC (rev 2988)
+++ pkg/trunk/drivers/laser/hokuyourg_player/hokuyourg_player.cc 2008-08-13 02:00:36 UTC (rev 2989)
@@ -75,15 +75,22 @@
<hr>
+@section services
+
+
+
@section parameters ROS parameters
Reads the following parameters from the parameter server
-- @b "~min_ang" : @b [double] the angle of the first range measurement in degrees (Default: -90.0)
-- @b "~max_ang" : @b [double] the angle of the last range measurement in degrees (Default: 90.0)
-- @b "~cluster" : @b [int] the number of adjascent range measurements to cluster into a single reading (Default: 1)
-- @b "~skip" : @b [int] the number of scans to skip between each measured scan (Default: 1)
-- @b "~port" : @b [string] the port where the hokuyo device can be found (Default: "/dev/ttyACM0")
+- @b "~min_ang" : @b [double] the angle of the first range measurement in degrees (Default: -90.0)
+- @b "~max_ang" : @b [double] the angle of the last range measurement in degrees (Default: 90.0)
+- @b "~cluster" : @b [int] the number of adjascent range measurements to cluster into a single reading (Default: 1)
+- @b "~skip" : @b [int] the number of scans to skip between each measured scan (Default: 1)
+- @b "~port" : @b [string] the port where the hokuyo device can be found (Default: "/dev/ttyACM0")
+- @b "~autostart : @b [bool] whether the node should automatically start the hokuyo (Default: true)
+- @b "~calibrate_time : @b [bool] whether the node should calibrate the hokuyo's time offset (Default: true)
+- @b "~frame_id : @b [string] the frame in which laser scans will be returned (Default: "FRAMEID_LASER")
**/
@@ -92,20 +99,19 @@
#include <iostream>
#include <sstream>
#include <iomanip>
+#include <pthread.h>
-//#include <libstandalone_drivers/urg_laser.h>
-#include "urg_laser.h"
+#include "ros/node.h"
+#include "rosthread/mutex.h"
+#include "ros/time.h"
-#include <ros/node.h>
-#include <std_msgs/LaserScan.h>
-#include <std_srvs/SelfTest.h>
-#include "ros/time.h"
+#include "std_msgs/LaserScan.h"
+#include "robot_srvs/SelfTest.h"
+
#include "namelookup/nameLookupClient.hh"
-#include "rosthread/mutex.h"
+#include "urg_laser.h"
-#include <pthread.h>
-
using namespace std;
class HokuyoNode: public ros::node
@@ -138,6 +144,8 @@
string frameid;
+ string id;
+
HokuyoNode() : ros::node("urglaser"), running(false), count(0), lookup_client(*this)
{
advertise<std_msgs::LaserScan>("scan");
@@ -175,7 +183,8 @@
{
urg.open(port.c_str());
- printf("Connected to URG with ID: %s\n", urg.get_ID().c_str());
+ string id = urg.get_ID();
+ printf("Connected to URG with ID: %s\n", id.c_str());
urg.laser_on();
@@ -299,214 +308,289 @@
stop();
return true;
- };
+ }
- bool SelfTest(std_srvs::SelfTest::request &req,
- std_srvs::SelfTest::response &res)
+
+ bool SelfTest(robot_srvs::SelfTest::request &req,
+ robot_srvs::SelfTest::response &res)
{
testing_mutex.lock();
printf("Entering self test. Other operation suspended\n");
- std::ostringstream oss;
-
- if (num_subscribers("scan") != 0)
- oss << "(WARNING: There were active subscribers. Running of self test interrupted operations.)" << std::endl;
-
- int passed = 0;
- int total = 0;
-
// Stop for good measure.
try
{
urg.close();
} catch (URG::exception& e) {
- oss << "(WARNING: Exception thrown while trying to close: " << e.what() << ")" << std::endl;
}
- // Actually conduct tests
+ std::vector<robot_msgs::DiagnosticStatus> status_vec;
+ std::vector<void (HokuyoNode::*)(robot_msgs::DiagnosticStatus&)> test_fncs;
- //Test: Connect
- total++;
- oss << "Test " << total << ": Opening connection" << std::endl;
- try {
- urg.open(port.c_str());
- passed++;
- oss << " [PASSED]";
- } catch (URG::exception& e) {
- oss << " [FAILED]" << std::endl << " " << e.what();
- }
- oss << std::endl;
+ test_fncs.push_back( &HokuyoNode::InterruptionTest );
+ test_fncs.push_back( &HokuyoNode::ConnectTest );
+ test_fncs.push_back( &HokuyoNode::IDTest );
+ test_fncs.push_back( &HokuyoNode::StatusTest );
+ test_fncs.push_back( &HokuyoNode::LaserTest );
+ test_fncs.push_back( &HokuyoNode::PolledDataTest );
+ test_fncs.push_back( &HokuyoNode::StreamedDataTest );
+ test_fncs.push_back( &HokuyoNode::StreamedIntensityDataTest );
+ test_fncs.push_back( &HokuyoNode::LaserOffTest );
+ test_fncs.push_back( &HokuyoNode::DisconnectTest );
+ test_fncs.push_back( &HokuyoNode::ResumeTest );
- //Test: Get ID
- total++;
- oss << "Test " << total << ": Getting ID" << std::endl;
- try {
- res.id = urg.get_ID();
- passed++;
- oss << " [PASSED]" << std::endl << " ID is: " << res.id;
+ for (std::vector<void (HokuyoNode::*)(robot_msgs::DiagnosticStatus&)>::iterator test_fncs_iter = test_fncs.begin();
+ test_fncs_iter != test_fncs.end();
+ test_fncs_iter++)
+ {
+ robot_msgs::DiagnosticStatus status;
- if (res.id == std::string("H0000000"))
+ status.name = "None";
+ status.level = 2;
+ status.message = "No message was set";
+
+ try {
+
+ (*this.*(*test_fncs_iter))(status);
+
+ } catch (URG::exception& e)
{
- oss << std::endl << " (WARNING: ID 0 is indication of failure.)";
+ status.level = 2;
+ status.message = std::string("Caught exception: ") + e.what();
}
- } catch (URG::exception& e) {
- oss << " [FAILED]" << std::endl << " " << e.what();
+
+ status_vec.push_back(status);
}
- oss << std::endl;
- //Test: Get status
- total++;
- oss << "Test " << total << ": Getting Status" << std::endl;
- try {
- std::string stat = urg.get_status();
- if (stat != std::string("Sensor works well."))
+ res.id = id;
+
+ res.passed = true;
+ for (std::vector<robot_msgs::DiagnosticStatus>::iterator status_iter = status_vec.begin();
+ status_iter != status_vec.end();
+ status_iter++)
+ {
+ if (status_iter->level >= 2)
{
- oss << " [FAILED]" << std::endl << " Status: " << stat;
- } else {
- passed++;
- oss << " [PASSED]";
+ res.passed = false;
}
- } catch (URG::exception& e) {
- oss << " [FAILED]" << std::endl << " " << e.what();
}
- oss << std::endl;
- //Test: Laser on
- total++;
- oss << "Test " << total << ": Turning on laser" << std::endl;
- try {
- urg.laser_on();
- passed++;
- oss << " [PASSED]";
- } catch (URG::exception& e) {
- oss << " [FAILED]" << std::endl << " " << e.what();
+ res.set_status_vec(status_vec);
+
+ printf("Self test completed\n");
+
+ testing_mutex.unlock();
+ return true;
+ }
+
+ void InterruptionTest(robot_msgs::DiagnosticStatus& status)
+ {
+ status.name = "Interruption Test";
+
+ if (num_subscribers("scan") == 0)
+ {
+ status.level = 0;
+ status.message = "No operation interrupted.";
}
- oss << std::endl;
+ else
+ {
+ status.level = 1;
+ status.message = "There were active subscribers. Running of self test interrupted operations.";
+ }
+ }
-
+ void ConnectTest(robot_msgs::DiagnosticStatus& status)
+ {
+ status.name = "Connection Test";
+
+ urg.open(port.c_str());
+
+ status.level = 0;
+ status.message = "Connected successfully.";
+ }
+
+ void IDTest(robot_msgs::DiagnosticStatus& status)
+ {
+ status.name = "ID Test";
+
+ id = urg.get_ID();
+
+ if (id == std::string("H0000000"))
+ {
+ status.level = 1;
+ status.message = id + std::string(" is indication of failure.");
+ }
+ else
+ {
+ status.level = 0;
+ status.message = id;
+ }
+ }
+
+ void StatusTest(robot_msgs::DiagnosticStatus& status)
+ {
+ status.name = "ID Test";
+
+ std::string stat = urg.get_status();
+
+ if (stat != std::string("Sensor works well."))
+ {
+ status.level = 2;
+ } else {
+ status.level = 0;
+ }
+
+ status.message = stat;
+ }
+
+ void LaserTest(robot_msgs::DiagnosticStatus& status)
+ {
+ status.name = "Laser Test";
+
+ urg.laser_on();
+
+ status.level = 0;
+ status.message = "Laser turned on successfully.";
+ }
+
+ void PolledDataTest(robot_msgs::DiagnosticStatus& status)
+ {
+ status.name = "Polled Data Test";
+
URG::laser_scan_t scan;
- //Test: Polled Data
- total++;
- oss << "Test " << total << ": Polled data" << std::endl;
- try {
- int res = urg.poll_scan(&scan, min_ang, max_ang, cluster, 1000);
- if (res != 0)
+ int res = urg.poll_scan(&scan, min_ang, max_ang, cluster, 1000);
+
+ if (res != 0)
+ {
+ status.level = 2;
+ ostringstream oss;
+ oss << "Hokuyo error code: " << res << ". Consult manual for meaning.";
+ status.message = oss.str();
+
+ } else {
+ status.level = 0;
+ status.message = "Polled Hokuyo for data successfully.";
+ }
+ }
+
+ void StreamedDataTest(robot_msgs::DiagnosticStatus& status)
+ {
+ status.name = "Streamed Data Test";
+
+ URG::laser_scan_t scan;
+
+ int res = urg.request_scans(false, min_ang, max_ang, cluster, skip, 99, 1000);
+
+ if (res != 0)
+ {
+ status.level = 2;
+ ostringstream oss;
+ oss << "Hokuyo error code: " << res << ". Consult manual for meaning.";
+ status.message = oss.str();
+
+ } else {
+
+ for (int i = 0; i < 99; i++)
{
- oss << " [FAILED]" << std::endl << " Hokuyo error code: " << res << ". Consult manual for meaning.";
- } else {
- passed++;
- oss << " [PASSED]";
+ urg.service_scan(&scan, 1000);
}
- } catch (URG::exception& e) {
- oss << " [FAILED]" << std::endl << " " << e.what();
+
+ status.level = 0;
+ status.message = "Streamed data from Hokuyo successfully.";
+
}
- oss << std::endl;
+ }
- //Test: Streamed data with no intensity
- total++;
- oss << "Test " << total << ": Streamed data" << std::endl;
- try {
- int res = urg.request_scans(false, min_ang, max_ang, cluster, skip, 99, 1000);
- if (res != 0)
+ void StreamedIntensityDataTest(robot_msgs::DiagnosticStatus& status)
+ {
+ status.name = "Streamed Intensity Data Test";
+
+ URG::laser_scan_t scan;
+
+ int res = urg.request_scans(false, min_ang, max_ang, cluster, skip, 99, 1000);
+
+ if (res != 0)
+ {
+ status.level = 2;
+ ostringstream oss;
+ oss << "Hokuyo error code: " << res << ". Consult manual for meaning.";
+ status.message = oss.str();
+
+ } else {
+
+ int corrupted_data = 0;
+
+ for (int i = 0; i < 99; i++)
{
- oss << " [FAILED]" << std::endl << " Hokuyo error code: " << res << ". Consult manual for meaning.";
- } else {
-
- for (int i = 0; i < 99; i++)
- {
+ try {
urg.service_scan(&scan, 1000);
+ } catch (URG::corrupted_data_exception &e) {
+ corrupted_data++;
}
- passed++;
- oss << " [PASSED]]";
}
- } catch (URG::exception& e) {
- oss << " [FAILED]" << std::endl << " " << e.what();
- }
- oss << std::endl;
-
- //Test: Streamed data with intensity
- total++;
- oss << "Test " << total << ": Streamed intensity data" << std::endl;
- try {
- int res = urg.request_scans(true, min_ang, max_ang, cluster, skip, 99, 1000);
- if (res != 0)
+ if (corrupted_data == 1)
{
- oss << " [FAILED]" << std::endl << " Hokuyo error code: " << res << ". Consult manual for meaning.";
- } else {
- int passable = 1;
- for (int i = 0; i < 99; i++)
- {
- try {
- urg.service_scan(&scan, 1000);
- } catch (URG::corrupted_data_exception &e) {
- passable = 0;
- }
- }
- if (passable)
- {
- passed++;
- oss << " [PASSED]";
- }
+ status.level = 1;
+ status.message = "Single corrupted message. This is acceptable and unavoidable";
+ } else if (corrupted_data > 1)
+ {
+ status.level = 2;
+ ostringstream oss;
+ oss << corrupted_data << " corrupted messages.";
+ status.message = oss.str();
+ } else
+ {
+ status.level = 0;
+ status.message = "Stramed data with intensity from Hokuyo successfully.";
}
- } catch (URG::exception& e) {
- oss << " [FAILED]" << std::endl << " " << e.what();
}
- oss << std::endl;
+ }
- //Test: Laser off
- total++;
- oss << "Test " << total << ":Turning off laser" << std::endl;
- try {
- urg.laser_off();
- passed++;
- oss << " [PASSED]";
- } catch (URG::exception& e) {
- oss << " [FAILED]" << std::endl << " " << e.what();
- }
- oss << std::endl;
+ void LaserOffTest(robot_msgs::DiagnosticStatus& status)
+ {
+ status.name = "Laser Off Test";
- //Test: Disconnect
- total++;
- oss << "Test " << total << ": Disconnecting" << std::endl;
- try {
- urg.close();
- passed++;
- oss << " [PASSED]";
- } catch (URG::exception& e) {
- oss << " [FAILED]" << std::endl << " " << e.what();
- }
- oss << std::endl;
+ urg.laser_off();
- if (total == passed)
- res.passed = true;
- else
- res.passed = false;
+ status.level = 0;
+ status.message = "Laser turned off successfully.";
+ }
- oss << passed << "/" << total << " tests passed";
+ void DisconnectTest(robot_msgs::DiagnosticStatus& status)
+ {
+ status.name = "Disconnect Test";
- printf("Self test completed\n");
+ urg.close();
+ status.level = 0;
+ status.message = "Disconnected successfully.";
+ }
+
+ void ResumeTest(robot_msgs::DiagnosticStatus& status)
+ {
+ status.name = "Resume Test";
+
if (running)
{
- printf("Trying to restart urg\n");
- try {
- urg.open(port.c_str());
- urg.laser_on();
- int status = urg.request_scans(true, min_ang, max_ang, cluster, skip);
- if (status != 0)
- oss << "WARNING: Requesting scans from URG Failed when trying to resume operation" << std::endl;
- } catch (URG::exception &e) {
- oss << "WARNING: Exception caught when resuming operation! Driver is most likely in a bad state." << std::endl;
+ urg.open(port.c_str());
+ urg.laser_on();
+
+ int res = urg.request_scans(true, min_ang, max_ang, cluster, skip);
+
+ if (res != 0)
+ {
+ status.level = 2;
+ status.message = "Failed to resume previous mode of operation.";
+ return;
}
- }
+ }
- res.info = oss.str();
+ status.level = 0;
+ status.message = "Previous operation resumed successfully.";
+ }
- testing_mutex.unlock();
- return true;
- }
};
int
Modified: pkg/trunk/drivers/laser/hokuyourg_player/manifest.xml
===================================================================
--- pkg/trunk/drivers/laser/hokuyourg_player/manifest.xml 2008-08-13 01:49:54 UTC (rev 2988)
+++ pkg/trunk/drivers/laser/hokuyourg_player/manifest.xml 2008-08-13 02:00:36 UTC (rev 2989)
@@ -4,7 +4,7 @@
<license>BSD</license>
<depend package="roscpp" />
<depend package="std_msgs" />
- <depend package="std_srvs" />
+ <depend package="robot_srvs" />
<depend package="urg_driver" />
<depend package="namelookup" />
<depend package="rosthread" />
Modified: pkg/trunk/hardware_test/sensors/hokuyo_tester/CMakeLists.txt
===================================================================
--- pkg/trunk/hardware_test/sensors/hokuyo_tester/CMakeLists.txt 2008-08-13 01:49:54 UTC (rev 2988)
+++ pkg/trunk/hardware_test/sensors/hokuyo_tester/CMakeLists.txt 2008-08-13 02:00:36 UTC (rev 2989)
@@ -16,8 +16,8 @@
rospack_add_library(hokuyotester src/hokuyo_tester/hokuyo_tester.cpp
src/hokuyo_tester/gen_hokuyo_tester.cpp)
-rospack_add_executable(gui src/gui/gui.cpp)
rospack_add_executable(test_hokuyo src/standalone/standalone.cpp)
+rospack_add_executable(gui src/gui/gui.cpp)
target_link_libraries(gui hokuyotester ${wxWidgets_LIBRARIES})
Modified: pkg/trunk/hardware_test/sensors/hokuyo_tester/manifest.xml
===================================================================
--- pkg/trunk/hardware_test/sensors/hokuyo_tester/manifest.xml 2008-08-13 01:49:54 UTC (rev 2988)
+++ pkg/trunk/hardware_test/sensors/hokuyo_tester/manifest.xml 2008-08-13 02:00:36 UTC (rev 2989)
@@ -1,12 +1,11 @@
<package>
-<description brief="Tool for connecting to a Hokuyo">
+<description brief="Tool for running the Hokuyo self test.">
</description>
<author>Jeremy Leibs</author>
<license>BSD</license>
<url>http://pr.willowgarage.com</url>
<depend package="roscpp"/>
-<depend package="urg_driver"/>
<depend package="std_msgs"/>
-<depend package="std_srvs"/>
+<depend package="robot_srvs"/>
</package>
Modified: pkg/trunk/hardware_test/sensors/hokuyo_tester/src/hokuyo_tester/hokuyo_tester.cpp
===================================================================
--- pkg/trunk/hardware_test/sensors/hokuyo_tester/src/hokuyo_tester/hokuyo_tester.cpp 2008-08-13 01:49:54 UTC (rev 2988)
+++ pkg/trunk/hardware_test/sensors/hokuyo_tester/src/hokuyo_tester/hokuyo_tester.cpp 2008-08-13 02:00:36 UTC (rev 2989)
@@ -32,17 +32,17 @@
* POSSIBILITY OF SUCH DAMAGE.
*********************************************************************/
-#include "hokuyo_tester.h"
-#include "urg_laser.h"
-#include <wx/dcclient.h>
#include <math.h>
+#include <time.h>
+#include <fstream>
+#include <iomanip>
+
#include <wx/app.h>
-
+#include <wx/dcclient.h>
#include <wx/msgdlg.h>
#include <wx/textdlg.h>
-#include <time.h>
-#include <fstream>
+#include "hokuyo_tester.h"
DECLARE_EVENT_TYPE(wxSELF_TEST_DONE,-1)
DEFINE_EVENT_TYPE(wxSELF_TEST_DONE)
@@ -101,15 +101,50 @@
void* TestThread::Entry()
{
+ wxMutexGuiEnter();
wxLogMessage(_T("Conducting self test...\n"));
+ wxMutexGuiLeave();
if (ros::service::call("urglaser/self_test", parent->req, parent->res))
{
- wxLogMessage(_T("Self test completed\n") + wxString::FromAscii(parent->res.info.c_str()));
+ wxLogMessage(_T("Self test completed"));
+
+ wxString info = _T("");
+
+ if (parent->res.passed)
+ info += _T("Test passed\n");
+ else
+ info += _T("Test failed\n");
+
+ for (size_t i = 0; i < parent->res.get_status_size(); i++)
+ {
+ wxString level;
+ if (parent->res.status[i].level == 0)
+ level = _T("[OK]");
+ else if (parent->res.status[i].level == 1)
+ level = _T("[WARNING]");
+ else
+ level = _T("[ERROR]");
+
+ wxString number;
+ number << i + 1;
+
+ info += number
+ + _T(") ")
+ + wxString::FromAscii(parent->res.status[i].name.c_str()) + _T("\n")
+ + _T(" ") + level + _T(" ")
+ + wxString::FromAscii(parent->res.status[i].message.c_str()) + _T("\n");
+ }
+
+ wxMutexGuiEnter();
+ wxLogMessage(info);
+ wxMutexGuiLeave();
}
else
{
+ wxMutexGuiEnter();
wxLogMessage(_T("Could not find hokuyo selftest service. Ros node must not be running."));
+ wxMutexGuiLeave();
parent->testButton->Enable();
return NULL;
}
@@ -174,19 +209,37 @@
if (res.passed)
{
out << "Self test: PASSED" << std::endl;
- out << "Info:" << std::endl << res.info;
- out << std::endl << std::endl;
+ }
+ else
+ {
+ out << "Self test: FAILED" << std::endl;
+ }
+
+ out << "Info:" << std::endl;
+ for (size_t i = 0; i < res.get_status_size(); i++)
+ {
+ out << std::setw(2) << i + 1 << ") " << res.status[i].name << std::endl;
+
+ if (res.status[i].level == 0)
+ out << " [OK]: ";
+ else if (res.status[i].level == 1)
+ out << " [WARNING]: ";
+ else
+ out << " [ERROR]: ";
+
+ out << res.status[i].message << std::endl << std::endl;
+ }
+
+ out << std::endl << std::endl;
+
+ if (res.passed)
+ {
if (answer == wxYES)
out << "Data inspection: PASSED" << std::endl;
else
out << "Data inspection: FAILED" << std::endl;
}
- else
- {
- out << "Self test: FAILED" << std::endl;
- out << "Info:" << std::endl << res.info;
- }
testButton->Enable();
}
Modified: pkg/trunk/hardware_test/sensors/hokuyo_tester/src/hokuyo_tester/hokuyo_tester.h
===================================================================
--- pkg/trunk/hardware_test/sensors/hokuyo_tester/src/hokuyo_tester/hokuyo_tester.h 2008-08-13 01:49:54 UTC (rev 2988)
+++ pkg/trunk/hardware_test/sensors/hokuyo_tester/src/hokuyo_tester/hokuyo_tester.h 2008-08-13 02:00:36 UTC (rev 2989)
@@ -35,15 +35,16 @@
#ifndef HOKUYO_TESTER_H
#define HOKUYO_TESTER_H
-#include "gen_hokuyo_tester.h"
#include <wx/log.h>
#include <wx/thread.h>
#include <wx/glcanvas.h>
#include "ros/node.h"
#include "std_msgs/LaserScan.h"
-#include "std_srvs/SelfTest.h"
+#include "robot_srvs/SelfTest.h"
+#include "gen_hokuyo_tester.h"
+
class HokuyoTester;
class TestThread: public wxThread
@@ -78,8 +79,8 @@
int last_x;
int last_y;
- std_srvs::SelfTest::request req;
- std_srvs::SelfTest::response res;
+ robot_srvs::SelfTest::request req;
+ robot_srvs::SelfTest::response res;
protected:
Modified: pkg/trunk/hardware_test/sensors/hokuyo_tester/src/standalone/standalone.cpp
===================================================================
--- pkg/trunk/hardware_test/sensors/hokuyo_tester/src/standalone/standalone.cpp 2008-08-13 01:49:54 UTC (rev 2988)
+++ pkg/trunk/hardware_test/sensors/hokuyo_tester/src/standalone/standalone.cpp 2008-08-13 02:00:36 UTC (rev 2989)
@@ -33,7 +33,7 @@
*********************************************************************/
#include "ros/node.h"
-#include "std_srvs/SelfTest.h"
+#include "robot_srvs/SelfTest.h"
#include <string>
@@ -46,8 +46,8 @@
bool doTest(std::string name)
{
- std_srvs::SelfTest::request req;
- std_srvs::SelfTest::response res;
+ robot_srvs::SelfTest::request req;
+ robot_srvs::SelfTest::response res;
if (ros::service::call(name + "/self_test", req, res))
{
printf("Self test completed:\n");
@@ -55,8 +55,19 @@
printf("Test passed!\n");
else
printf("Test failed!\n");
- printf("Status code: %d\n", res.status_code);
- printf("Info:\n%s\n", res.info.c_str());
+
+ for (size_t i = 0; i < res.get_status_size(); i++)
+ {
+ printf("%2d) %s\n", i + 1, res.status[i].name.c_str());
+ if (res.status[i].level == 0)
+ printf(" [OK]: ");
+ else if (res.status[i].level == 1)
+ printf(" [WARNING]: ");
+ else
+ printf(" [ERROR]: ");
+
+ printf("%s\n\n", res.status[i].message.c_str());
+ }
return true;
}
else
Modified: pkg/trunk/robot_msgs/msg/DiagnosticStatus.msg
===================================================================
--- pkg/trunk/robot_msgs/msg/DiagnosticStatus.msg 2008-08-13 01:49:54 UTC (rev 2988)
+++ pkg/trunk/robot_msgs/msg/DiagnosticStatus.msg 2008-08-13 02:00:36 UTC (rev 2989)
@@ -1,4 +1,4 @@
-byte level #(OK, WARN, ERROR)
+byte level #(OK=0, WARN=1, ERROR=2)
string name # a description of the test/component reporting
-string status_message # a description of the status
+string message # a description of the status
DiagnosticValue[] values # an array of values associated with the status
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ge...@us...> - 2008-08-13 07:05:09
|
Revision: 2999
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=2999&view=rev
Author: gerkey
Date: 2008-08-13 07:05:19 +0000 (Wed, 13 Aug 2008)
Log Message:
-----------
cmake-ified
Added Paths:
-----------
pkg/trunk/pr2_msgs/CMakeLists.txt
pkg/trunk/robot_msgs/CMakeLists.txt
Added: pkg/trunk/pr2_msgs/CMakeLists.txt
===================================================================
--- pkg/trunk/pr2_msgs/CMakeLists.txt (rev 0)
+++ pkg/trunk/pr2_msgs/CMakeLists.txt 2008-08-13 07:05:19 UTC (rev 2999)
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 2.6)
+include(rosbuild)
+rospack(pr2_msgs)
+genmsg()
+
+
Added: pkg/trunk/robot_msgs/CMakeLists.txt
===================================================================
--- pkg/trunk/robot_msgs/CMakeLists.txt (rev 0)
+++ pkg/trunk/robot_msgs/CMakeLists.txt 2008-08-13 07:05:19 UTC (rev 2999)
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 2.6)
+include(rosbuild)
+rospack(robot_msgs)
+genmsg()
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <is...@us...> - 2008-08-13 20:05:13
|
Revision: 3011
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=3011&view=rev
Author: isucan
Date: 2008-08-13 20:05:20 +0000 (Wed, 13 Aug 2008)
Log Message:
-----------
switched pr2 and robot to cmake
Modified Paths:
--------------
pkg/trunk/pr2_srvs/Makefile
pkg/trunk/robot_srvs/Makefile
Added Paths:
-----------
pkg/trunk/pr2_srvs/CMakeLists.txt
pkg/trunk/robot_srvs/CMakeLists.txt
Added: pkg/trunk/pr2_srvs/CMakeLists.txt
===================================================================
--- pkg/trunk/pr2_srvs/CMakeLists.txt (rev 0)
+++ pkg/trunk/pr2_srvs/CMakeLists.txt 2008-08-13 20:05:20 UTC (rev 3011)
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 2.6)
+include(rosbuild)
+rospack(pr2_srvs)
+gensrv()
Modified: pkg/trunk/pr2_srvs/Makefile
===================================================================
--- pkg/trunk/pr2_srvs/Makefile 2008-08-13 19:19:57 UTC (rev 3010)
+++ pkg/trunk/pr2_srvs/Makefile 2008-08-13 20:05:20 UTC (rev 3011)
@@ -1,4 +1 @@
-all:
- `rospack find rostools`/scripts/gensrv srv/*.srv
-clean:
- -rm -rf srv/cpp src/std_srvs
+include $(shell rospack find mk)/cmake.mk
Added: pkg/trunk/robot_srvs/CMakeLists.txt
===================================================================
--- pkg/trunk/robot_srvs/CMakeLists.txt (rev 0)
+++ pkg/trunk/robot_srvs/CMakeLists.txt 2008-08-13 20:05:20 UTC (rev 3011)
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 2.6)
+include(rosbuild)
+rospack(robot_srvs)
+gensrv()
Modified: pkg/trunk/robot_srvs/Makefile
===================================================================
--- pkg/trunk/robot_srvs/Makefile 2008-08-13 19:19:57 UTC (rev 3010)
+++ pkg/trunk/robot_srvs/Makefile 2008-08-13 20:05:20 UTC (rev 3011)
@@ -1,4 +1 @@
-all:
- `rospack find rostools`/scripts/gensrv srv/*.srv
-clean:
- -rm -rf srv/cpp src/std_srvs
+include $(shell rospack find mk)/cmake.mk
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <is...@us...> - 2008-08-13 22:37:24
|
Revision: 3013
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=3013&view=rev
Author: isucan
Date: 2008-08-13 22:37:32 +0000 (Wed, 13 Aug 2008)
Log Message:
-----------
created a package with base classes for nodes that need robot models. also updated ompl to nicer structs for specifying distance functions and state validity checkers
Modified Paths:
--------------
pkg/trunk/motion_planning/kinematic_planning/src/kinematic_planning.cpp
pkg/trunk/motion_planning/ompl/code/ompl/base/SpaceInformation.h
pkg/trunk/motion_planning/ompl/code/ompl/extension/samplingbased/kinematic/SpaceInformationKinematic.h
pkg/trunk/motion_planning/ompl/code/ompl/extension/samplingbased/kinematic/src/SpaceInformationKinematic.cpp
pkg/trunk/world_models/world_3d_map/manifest.xml
pkg/trunk/world_models/world_3d_map/src/world_3d_map.cpp
Added Paths:
-----------
pkg/trunk/motion_planning/planning_node_util/
pkg/trunk/motion_planning/planning_node_util/CMakeLists.txt
pkg/trunk/motion_planning/planning_node_util/Makefile
pkg/trunk/motion_planning/planning_node_util/include/
pkg/trunk/motion_planning/planning_node_util/include/knode.h
pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/
pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/knode.h
pkg/trunk/motion_planning/planning_node_util/manifest.xml
Removed Paths:
-------------
pkg/trunk/motion_planning/planning_models/include/planning_models/node.h
Modified: pkg/trunk/motion_planning/kinematic_planning/src/kinematic_planning.cpp
===================================================================
--- pkg/trunk/motion_planning/kinematic_planning/src/kinematic_planning.cpp 2008-08-13 21:31:23 UTC (rev 3012)
+++ pkg/trunk/motion_planning/kinematic_planning/src/kinematic_planning.cpp 2008-08-13 22:37:32 UTC (rev 3013)
@@ -287,7 +287,7 @@
/* cleanup */
p.si->clearGoal();
- p.si->clearStartStates(true);
+ p.si->clearStartStates();
p.mp->clear();
return true;
@@ -371,11 +371,14 @@
}
private:
-
+
+ class StateValidityPredicate;
+
struct Planner
{
ompl::Planner_t mp;
ompl::SpaceInformationKinematic_t si;
+ StateValidityPredicate* svc;
int type;
};
@@ -403,34 +406,52 @@
planning_models::KinematicModel *kmodel;
int groupID;
};
-
- std_msgs::PointCloudFloat32 m_cloud;
- std_msgs::RobotBase2DOdom m_localizedPose;
- double m_basePos[3];
- collision_space::EnvironmentModel *m_collisionSpace;
- std::map<std::string, Model*> m_models;
- std::vector<robot_desc::URDF*> m_robotDescriptions;
-
- static bool isStateValid(const ompl::SpaceInformationKinematic::StateKinematic_t state, void *data)
+ class StateValidityPredicate : public ompl::SpaceInformation::StateValidityChecker
{
- Model *model = reinterpret_cast<Model*>(data);
- model->kmodel->computeTransforms(state->values, model->groupID);
- model->collisionSpace->updateRobotModel(model->collisionSpaceID);
- bool collision = model->collisionSpace->isCollision(model->collisionSpaceID);
- return !collision;
- }
+ public:
+ StateValidityPredicate(Model *model) : ompl::SpaceInformation::StateValidityChecker()
+ {
+ m_model = model;
+ }
+
+ virtual bool operator()(const ompl::SpaceInformation::State_t state)
+ {
+ m_model->kmodel->computeTransforms(static_cast<const ompl::SpaceInformationKinematic::StateKinematic_t>(state)->values, m_model->groupID);
+ m_model->collisionSpace->updateRobotModel(m_model->collisionSpaceID);
+ bool collision = m_model->collisionSpace->isCollision(m_model->collisionSpaceID);
+ return !collision;
+ }
+
+ protected:
+
+ Model *m_model;
+ };
+
void createMotionPlanningInstances(Model* model)
{
+ addRRTInstance(model);
+ }
+
+ void addRRTInstance(Model *model)
+ {
Planner p;
p.si = new SpaceInformationXMLModel(model->kmodel, model->groupID);
- p.si->setStateValidFn(isStateValid, reinterpret_cast<void*>(model));
+ p.svc = new StateValidityPredicate(model);
+ p.si->setStateValidityChecker(p.svc);
p.mp = new ompl::RRT(p.si);
- p.type = 0;
+ p.type = 0;
model->planners.push_back(p);
}
-
+
+ std_msgs::PointCloudFloat32 m_cloud;
+ std_msgs::RobotBase2DOdom m_localizedPose;
+ double m_basePos[3];
+ collision_space::EnvironmentModel *m_collisionSpace;
+ std::map<std::string, Model*> m_models;
+ std::vector<robot_desc::URDF*> m_robotDescriptions;
+
};
int main(int argc, char **argv)
Modified: pkg/trunk/motion_planning/ompl/code/ompl/base/SpaceInformation.h
===================================================================
--- pkg/trunk/motion_planning/ompl/code/ompl/base/SpaceInformation.h 2008-08-13 21:31:23 UTC (rev 3012)
+++ pkg/trunk/motion_planning/ompl/code/ompl/base/SpaceInformation.h 2008-08-13 22:37:32 UTC (rev 3013)
@@ -41,40 +41,139 @@
namespace ompl
{
+ /** Forward class declaration */
ForwardClassDeclaration(SpaceInformation);
class SpaceInformation
{
public:
+
+ /** Constructor */
SpaceInformation(void)
{
- m_goal = NULL;
+ m_goal = NULL;
+ m_setup = false;
+ m_stateDistanceEvaluator = NULL;
+ m_stateValidityChecker = NULL;
}
+ /** Destructor */
virtual ~SpaceInformation(void)
{
}
+ /************************************************************/
+ /* States */
+ /************************************************************/
+ /** Forward class declaration */
+ ForwardClassDeclaration(State);
+
+ /** Abstract definition of a state */
+ class State
+ {
+ public:
+ virtual ~State(void)
+ {
+ }
+ };
+
+ /** Forward class declaration */
+ ForwardClassDeclaration(StateValidityChecker);
+
+ /** Abstract definition for a class checking the validity of states */
+ class StateValidityChecker
+ {
+ public:
+ /** Return true if the state is valid */
+ virtual bool operator()(const State_t state) = 0;
+ };
+
+ /** Forward class declaration */
+ ForwardClassDeclaration(StateDistanceEvaluator);
+
+ /** Abstract definition for a class evaluating distance between states */
+ class StateDistanceEvaluator
+ {
+ public:
+ /** Return true if the state is valid */
+ virtual double operator()(const State_t state1, const State_t state2) = 0;
+ };
+
+ /** Add a start state */
+ void addStartState(State_t state)
+ {
+ m_startStates.push_back(state);
+ }
+
+ /** Clear all start states (memory is freed) */
+ void clearStartStates(void)
+ {
+ for (unsigned int i = 0 ; i < m_startStates.size() ; ++i)
+ delete m_startStates[i];
+ m_startStates.clear();
+ }
+
+ /** Clear all start states but do not free memory */
+ void forgetStartStates(void)
+ {
+ m_startStates.clear();
+ }
+
+ /** Returns the number of start states */
+ unsigned int getStartStateCount(void) const
+ {
+ return m_startStates.size();
+ }
+
+ /** Returns a specific start state */
+ State_t getStartState(unsigned int index) const
+ {
+ return m_startStates[index];
+ }
+
+ /** Set the instance of the distance evaluator to use. This is
+ only needed by some planning algorithms. No memory freeing is performed. */
+ void setDistanceEvaluator(StateDistanceEvaluator *sde)
+ {
+ m_stateDistanceEvaluator = sde;
+ }
+
+ /** Set the instance of the validity checker to use. No memory freeing is performed. */
+ void setStateValidityChecker(StateValidityChecker *svc)
+ {
+ m_stateValidityChecker = svc;
+ }
+
/************************************************************/
/* Paths */
/************************************************************/
+ /** Forward declaration */
ForwardClassDeclaration(Path);
+ /** Abstract definition of a path */
class Path
{
public:
+ /** Constructor. A path must always know the space information it is part of */
Path(SpaceInformation_t si)
{
m_si = si;
}
-
+
+ /** Destructor */
virtual ~Path(void)
{
}
+ /** Returns the space information this path is part of */
+ SpaceInformation_t getSpaceInformation(void) const
+ {
+ return m_si;
+ }
+
protected:
SpaceInformation_t m_si;
@@ -86,12 +185,15 @@
/* Goals */
/************************************************************/
+ /** Forward declaration */
ForwardClassDeclaration(Goal);
+ /** Abstract definition of goals. Will contain solutions, if found */
class Goal
{
public:
-
+
+ /** Constructor. The goal must always know the space information it is part of */
Goal(SpaceInformation_t si)
{
m_si = si;
@@ -100,38 +202,66 @@
m_approximate = false;
}
+ /** Destructor. Clears the solution as well */
virtual ~Goal(void)
{
if (m_path)
delete m_path;
}
+
+ /** Returns the space information this goal is part of */
+ SpaceInformation_t getSpaceInformation(void) const
+ {
+ return m_si;
+ }
+ /** Returns true if a solution path has been found */
bool isAchieved(void) const
{
return m_path != NULL;
}
+ /** Return the found solution path */
Path_t getSolutionPath(void) const
{
return m_path;
}
+ /** Forget the solution path. Memory is not freed. This is
+ useful when the user wants to keep the solution path
+ but wants to clear the goal. The user takes
+ responsibilty to free the memory for the solution
+ path. */
+ void forgetSolutionPath(void)
+ {
+ m_path = NULL;
+ }
+
+ /** Update the solution path. If a previous solution path exists, it is deleted. */
void setSolutionPath(Path_t path, bool approximate = false)
{
+ if (m_path)
+ delete m_path;
m_path = path;
m_approximate = approximate;
}
+ /** If a difference between the desired solution and the
+ solution found is computed by the planner, this functions
+ returns it */
double getDifference(void) const
{
return m_difference;
}
+ /** Set the difference between the found solution path and
+ the desired solution path */
void setDifference(double difference)
{
m_difference = difference;
}
+ /** Return true if the found solution is approximate */
bool isApproximate(void) const
{
return m_approximate;
@@ -153,6 +283,8 @@
};
+
+ /** Set the goal. The memory for a previous goal is freed. */
void setGoal(Goal_t goal)
{
if (m_goal)
@@ -160,6 +292,7 @@
m_goal = goal;
}
+ /** Clear the goal. Memory is freed. */
void clearGoal(bool free = true)
{
if (free && m_goal)
@@ -167,54 +300,36 @@
m_goal = NULL;
}
+ /** Return the current goal */
Goal_t getGoal(void) const
{
return m_goal;
}
+ /** Clear the goal, but do not free its memory */
+ void forgetGoal(void)
+ {
+ m_goal = NULL;
+ }
/************************************************************/
- /* States */
+ /* Utility functions */
/************************************************************/
-
- ForwardClassDeclaration(State);
- class State
+ /** Perform additional setup tasks (run once, before use) */
+ virtual void setup(void)
{
- public:
- virtual ~State(void)
- {
- }
- };
-
- void addStartState(State_t state)
- {
- m_startStates.push_back(state);
+ m_setup = true;
}
- void clearStartStates(bool free = true)
- {
- if (free)
- for (unsigned int i = 0 ; i < m_startStates.size() ; ++i)
- delete m_startStates[i];
- m_startStates.clear();
- }
-
- unsigned int getStartStateCount(void) const
- {
- return m_startStates.size();
- }
+ protected:
- State_t getStartState(unsigned int index) const
- {
- return m_startStates[index];
- }
+ bool m_setup;
+ std::vector<State_t> m_startStates;
+ Goal_t m_goal;
+ StateValidityChecker *m_stateValidityChecker;
+ StateDistanceEvaluator *m_stateDistanceEvaluator;
- protected:
-
- Goal_t m_goal;
- std::vector<State_t> m_startStates;
-
};
Modified: pkg/trunk/motion_planning/ompl/code/ompl/extension/samplingbased/kinematic/SpaceInformationKinematic.h
===================================================================
--- pkg/trunk/motion_planning/ompl/code/ompl/extension/samplingbased/kinematic/SpaceInformationKinematic.h 2008-08-13 21:31:23 UTC (rev 3012)
+++ pkg/trunk/motion_planning/ompl/code/ompl/extension/samplingbased/kinematic/SpaceInformationKinematic.h 2008-08-13 22:37:32 UTC (rev 3013)
@@ -40,31 +40,38 @@
namespace ompl
{
-
+
+ /** Forward class declaration */
ForwardClassDeclaration(SpaceInformationKinematic);
+ /** Space information useful for kinematic planning */
class SpaceInformationKinematic : public SpaceInformation
{
public:
- SpaceInformationKinematic() : SpaceInformation()
+ /** Constructor; setup() needs to be called as well, before use */
+ SpaceInformationKinematic(void) : SpaceInformation(),
+ m_defaultDistanceEvaluator(this)
{
random_utils::init(&m_rngState);
-
- m_isValidStateFn = NULL;
- m_isValidStateFnData = NULL;
+ m_stateDistanceEvaluator = &m_defaultDistanceEvaluator;
m_smoother.rangeRatio = 0.2;
m_smoother.maxSteps = 10;
m_smoother.maxEmptySteps = 3;
}
+ /** Destructor */
virtual ~SpaceInformationKinematic(void)
{
}
+
ForwardClassDeclaration(StateKinematic);
-
+ ForwardClassDeclaration(GoalRegionKinematic);
+ ForwardClassDeclaration(GoalStateKinematic);
+ ForwardClassDeclaration(PathKinematic);
+
class StateKinematic : public State
{
public:
@@ -88,8 +95,6 @@
double *values;
};
- ForwardClassDeclaration(GoalRegionKinematic);
-
class GoalRegionKinematic : public Goal
{
public:
@@ -108,7 +113,6 @@
double threshold;
};
- ForwardClassDeclaration(GoalStateKinematic);
class GoalStateKinematic : public GoalRegionKinematic
{
@@ -133,7 +137,6 @@
StateKinematic_t state;
};
- ForwardClassDeclaration(PathKinematic);
class PathKinematic : public Path
{
@@ -159,6 +162,21 @@
}
};
+ class StateKinematicL2SquareDistanceEvaluator : public StateDistanceEvaluator
+ {
+ public:
+ StateKinematicL2SquareDistanceEvaluator(SpaceInformationKinematic_t si) : StateDistanceEvaluator()
+ {
+ m_si = si;
+ }
+
+ virtual double operator()(const State_t state1, const State_t state2);
+
+ protected:
+
+ SpaceInformationKinematic_t m_si;
+ };
+
struct StateComponent
{
StateComponent(void)
@@ -173,15 +191,7 @@
double maxValue;
double resolution;
};
-
- typedef bool (*IsStateValidFn)(const StateKinematic_t, void*);
-
- void setStateValidFn(IsStateValidFn fun, void *data)
- {
- m_isValidStateFn = fun;
- m_isValidStateFnData = data;
- }
-
+
virtual void printState(const StateKinematic_t state, FILE* out = stdout) const;
virtual void copyState(StateKinematic_t destination, const StateKinematic_t source)
{
@@ -198,25 +208,34 @@
return m_stateComponent[index];
}
- virtual double distance(const StateKinematic_t s1, const StateKinematic_t s2);
-
+ double distance(const StateKinematic_t s1, const StateKinematic_t s2)
+ {
+ return (*m_stateDistanceEvaluator)(static_cast<const State_t>(s1), static_cast<const State_t>(s2));
+ }
+
virtual void sample(StateKinematic_t state);
virtual void sampleNear(StateKinematic_t state, const StateKinematic_t near, double rho);
virtual void smoothVertices(PathKinematic_t path);
virtual bool checkMotion(const StateKinematic_t s1, const StateKinematic_t s2);
- virtual bool isValid(const StateKinematic_t state)
+
+ bool isValid(const StateKinematic_t state)
{
- return m_isValidStateFn(state, m_isValidStateFnData);
+ return (*m_stateValidityChecker)(static_cast<const State_t>(state));
}
virtual void printSettings(FILE *out = stdout) const;
+ virtual void setup(void)
+ {
+ assert(m_stateValidityChecker);
+ SpaceInformation::setup();
+ }
+
protected:
- unsigned int m_stateDimension;
- std::vector<StateComponent> m_stateComponent;
- IsStateValidFn m_isValidStateFn;
- void *m_isValidStateFnData;
+ unsigned int m_stateDimension;
+ std::vector<StateComponent> m_stateComponent;
+ StateKinematicL2SquareDistanceEvaluator m_defaultDistanceEvaluator;
struct
{
Modified: pkg/trunk/motion_planning/ompl/code/ompl/extension/samplingbased/kinematic/src/SpaceInformationKinematic.cpp
===================================================================
--- pkg/trunk/motion_planning/ompl/code/ompl/extension/samplingbased/kinematic/src/SpaceInformationKinematic.cpp 2008-08-13 21:31:23 UTC (rev 3012)
+++ pkg/trunk/motion_planning/ompl/code/ompl/extension/samplingbased/kinematic/src/SpaceInformationKinematic.cpp 2008-08-13 22:37:32 UTC (rev 3013)
@@ -37,25 +37,28 @@
#include <algorithm>
#include <queue>
-void ompl::SpaceInformationKinematic::printState(const StateKinematic_t state, FILE* out) const
+double ompl::SpaceInformationKinematic::StateKinematicL2SquareDistanceEvaluator::operator()(const State_t s1, const State_t s2)
{
- for (unsigned int i = 0 ; i < m_stateDimension ; ++i)
- fprintf(out, "%0.6f ", state->values[i]);
- fprintf(out, "\n");
-}
-
-double ompl::SpaceInformationKinematic::distance(const StateKinematic_t s1, const StateKinematic_t s2)
-{
+ const StateKinematic_t sk1 = static_cast<const StateKinematic_t>(s1);
+ const StateKinematic_t sk2 = static_cast<const StateKinematic_t>(s2);
+ const unsigned int dim = m_si->getStateDimension();
+
double dist = 0.0;
- for (unsigned int i = 0 ; i < m_stateDimension ; ++i)
+ for (unsigned int i = 0 ; i < dim ; ++i)
{
- double diff = m_stateComponent[i].type == StateComponent::ANGLE ?
- math_utils::shortest_angular_distance(s1->values[i], s2->values[i]) : s1->values[i] - s2->values[i];
+ double diff = m_si->getStateComponent(i).type == StateComponent::ANGLE ?
+ math_utils::shortest_angular_distance(sk1->values[i], sk2->values[i]) : sk1->values[i] - sk2->values[i];
dist += diff * diff;
}
return dist;
}
+void ompl::SpaceInformationKinematic::printState(const StateKinematic_t state, FILE* out) const
+{
+ for (unsigned int i = 0 ; i < m_stateDimension ; ++i)
+ fprintf(out, "%0.6f ", state->values[i]);
+ fprintf(out, "\n");
+}
void ompl::SpaceInformationKinematic::sample(StateKinematic_t state)
{
for (unsigned int i = 0 ; i < m_stateDimension ; ++i)
Deleted: pkg/trunk/motion_planning/planning_models/include/planning_models/node.h
===================================================================
--- pkg/trunk/motion_planning/planning_models/include/planning_models/node.h 2008-08-13 21:31:23 UTC (rev 3012)
+++ pkg/trunk/motion_planning/planning_models/include/planning_models/node.h 2008-08-13 22:37:32 UTC (rev 3013)
@@ -1,166 +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.
-*********************************************************************/
-
-#include <ros/node.h>
-#include <ros/time.h>
-#include <urdf/URDF.h>
-#include <planning_models/kinematic.h>
-#include <std_msgs/RobotBase2DOdom.h>
-#include <rosTF/rosTF.h>
-
-namespace planning_models
-{
-
- class NodeWithRobotModel : public ros::node
- {
-
- public:
-
- NodeWithRobotModel(const std::string &robot_model, const std::string &name, uint32_t options = 0) : ros::node(name, options),
- m_tf(*this, true, 1 * 1000000000ULL, 1000000000ULL)
- {
- m_urdf = NULL;
- m_kmodel = NULL;
- m_basePos[0] = m_basePos[1] = m_basePos[2] = 0.0;
- loadRobotDescription(robot_model);
-
- subscribe("localizedpose", m_localizedPose, &NodeWithRobotModel::localizedPoseCallback);
- }
-
- virtual ~NodeWithRobotModel(void)
- {
- if (m_urdf)
- delete m_urdf;
- if (m_kmodel)
- delete m_kmodel;
- }
-
- void setRobotDescriptionFromData(const char *data)
- {
- robot_desc::URDF *file = new robot_desc::URDF();
- if (file->loadString(data))
- setRobotDescription(file);
- else
- delete file;
- }
-
- void setRobotDescriptionFromFile(const char *filename)
- {
- robot_desc::URDF *file = new robot_desc::URDF();
- if (file->loadFile(filename))
- setRobotDescription(file);
- else
- delete file;
- }
-
- virtual void setRobotDescription(robot_desc::URDF *file)
- {
- if (m_urdf)
- delete m_urdf;
- if (m_kmodel)
- delete m_kmodel;
-
- m_urdf = file;
- m_kmodel = new planning_models::KinematicModel();
- m_kmodel->setVerbose(false);
- m_kmodel->build(*file);
- }
-
- virtual void loadRobotDescription(const std::string &robot_model)
- {
- if (!robot_model.empty() && robot_model != "-")
- {
- std::string content;
- if (get_param(robot_model, content))
- setRobotDescriptionFromData(content.c_str());
- else
- fprintf(stderr, "Robot model '%s' not found!\n", robot_model.c_str());
- }
- }
-
- protected:
-
- void localizedPoseCallback(void)
- {
- bool success = true;
- libTF::TFPose2D pose;
- pose.x = m_localizedPose.pos.x;
- pose.y = m_localizedPose.pos.y;
- pose.yaw = m_localizedPose.pos.th;
- pose.time = m_localizedPose.header.stamp.to_ull();
- pose.frame = m_localizedPose.header.frame_id;
-
- try
- {
- pose = m_tf.transformPose2D("FRAMEID_MAP", pose);
- }
- catch(libTF::TransformReference::LookupException& ex)
- {
- fprintf(stderr, "Discarding pose: Transform reference lookup exception\n");
- success = false;
- }
- catch(libTF::TransformReference::ExtrapolateException& ex)
- {
- fprintf(stderr, "Discarding pose: Extrapolation exception: %s\n", ex.what());
- success = false;
- }
- catch(...)
- {
- fprintf(stderr, "Discarding pose: Exception in pose computation\n");
- success = false;
- }
-
- if (success)
- {
- m_basePos[0] = pose.x;
- m_basePos[1] = pose.y;
- m_basePos[2] = pose.yaw;
-
- baseUpdate();
- }
- }
-
- virtual void baseUpdate(void)
- {
- }
-
- rosTFClient m_tf;
- std_msgs::RobotBase2DOdom m_localizedPose;
- robot_desc::URDF *m_urdf;
- planning_models::KinematicModel *m_kmodel;
- double m_basePos[3];
-
- };
-
-}
Copied: pkg/trunk/motion_planning/planning_node_util/CMakeLists.txt (from rev 3011, pkg/trunk/motion_planning/collision_space/CMakeLists.txt)
===================================================================
--- pkg/trunk/motion_planning/planning_node_util/CMakeLists.txt (rev 0)
+++ pkg/trunk/motion_planning/planning_node_util/CMakeLists.txt 2008-08-13 22:37:32 UTC (rev 3013)
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.6)
+include(rosbuild)
+rospack(planning_node_util)
Copied: pkg/trunk/motion_planning/planning_node_util/Makefile (from rev 3011, pkg/trunk/motion_planning/collision_space/Makefile)
===================================================================
--- pkg/trunk/motion_planning/planning_node_util/Makefile (rev 0)
+++ pkg/trunk/motion_planning/planning_node_util/Makefile 2008-08-13 22:37:32 UTC (rev 3013)
@@ -0,0 +1 @@
+include $(shell rospack find mk)/cmake.mk
Copied: pkg/trunk/motion_planning/planning_node_util/include/knode.h (from rev 3011, pkg/trunk/motion_planning/planning_models/include/planning_models/node.h)
===================================================================
--- pkg/trunk/motion_planning/planning_node_util/include/knode.h (rev 0)
+++ pkg/trunk/motion_planning/planning_node_util/include/knode.h 2008-08-13 22:37:32 UTC (rev 3013)
@@ -0,0 +1,166 @@
+/*********************************************************************
+* 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.
+*********************************************************************/
+
+#include <ros/node.h>
+#include <ros/time.h>
+#include <urdf/URDF.h>
+#include <planning_models/kinematic.h>
+#include <std_msgs/RobotBase2DOdom.h>
+#include <rosTF/rosTF.h>
+
+namespace planning_node_util
+{
+
+ class NodeWithRobotModel : public ros::node
+ {
+
+ public:
+
+ NodeWithRobotModel(const std::string &robot_model, const std::string &name, uint32_t options = 0) : ros::node(name, options),
+ m_tf(*this, true, 1 * 1000000000ULL, 1000000000ULL)
+ {
+ m_urdf = NULL;
+ m_kmodel = NULL;
+ m_basePos[0] = m_basePos[1] = m_basePos[2] = 0.0;
+ loadRobotDescription(robot_model);
+
+ subscribe("localizedpose", m_localizedPose, &NodeWithRobotModel::localizedPoseCallback);
+ }
+
+ virtual ~NodeWithRobotModel(void)
+ {
+ if (m_urdf)
+ delete m_urdf;
+ if (m_kmodel)
+ delete m_kmodel;
+ }
+
+ void setRobotDescriptionFromData(const char *data)
+ {
+ robot_desc::URDF *file = new robot_desc::URDF();
+ if (file->loadString(data))
+ setRobotDescription(file);
+ else
+ delete file;
+ }
+
+ void setRobotDescriptionFromFile(const char *filename)
+ {
+ robot_desc::URDF *file = new robot_desc::URDF();
+ if (file->loadFile(filename))
+ setRobotDescription(file);
+ else
+ delete file;
+ }
+
+ virtual void setRobotDescription(robot_desc::URDF *file)
+ {
+ if (m_urdf)
+ delete m_urdf;
+ if (m_kmodel)
+ delete m_kmodel;
+
+ m_urdf = file;
+ m_kmodel = new planning_models::KinematicModel();
+ m_kmodel->setVerbose(false);
+ m_kmodel->build(*file);
+ }
+
+ virtual void loadRobotDescription(const std::string &robot_model)
+ {
+ if (!robot_model.empty() && robot_model != "-")
+ {
+ std::string content;
+ if (get_param(robot_model, content))
+ setRobotDescriptionFromData(content.c_str());
+ else
+ fprintf(stderr, "Robot model '%s' not found!\n", robot_model.c_str());
+ }
+ }
+
+ protected:
+
+ void localizedPoseCallback(void)
+ {
+ bool success = true;
+ libTF::TFPose2D pose;
+ pose.x = m_localizedPose.pos.x;
+ pose.y = m_localizedPose.pos.y;
+ pose.yaw = m_localizedPose.pos.th;
+ ...
[truncated message content] |
|
From: <is...@us...> - 2008-08-13 23:22:05
|
Revision: 3020
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=3020&view=rev
Author: isucan
Date: 2008-08-13 23:22:13 +0000 (Wed, 13 Aug 2008)
Log Message:
-----------
switched planning_world_viewer to use planning_node_util
Modified Paths:
--------------
pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/knode.h
pkg/trunk/motion_planning/planning_world_viewer/manifest.xml
pkg/trunk/motion_planning/planning_world_viewer/src/planning_world_viewer.cpp
pkg/trunk/util/display_ode_spaces/include/display_ode/displayODE.h
Added Paths:
-----------
pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/cnode.h
Copied: pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/cnode.h (from rev 3013, pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/knode.h)
===================================================================
--- pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/cnode.h (rev 0)
+++ pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/cnode.h 2008-08-13 23:22:13 UTC (rev 3020)
@@ -0,0 +1,119 @@
+/*********************************************************************
+* 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.
+*********************************************************************/
+
+#include <planning_node_util/knode.h>
+#include <std_msgs/PointCloudFloat32.h>
+#include <collision_space/environmentODE.h>
+
+namespace planning_node_util
+{
+
+ class NodeWithODECollisionModel : public NodeWithRobotModel
+ {
+
+ public:
+
+ NodeWithODECollisionModel(const std::string &robot_model, const std::string &name, uint32_t options = 0) : NodeWithRobotModel(robot_model, name, options)
+ {
+ m_collisionSpace = new collision_space::EnvironmentModelODE();
+ m_collisionSpace->setSelfCollision(false);
+ m_sphereSize = 0.03;
+
+ subscribe("world_3d_map", m_worldCloud, &NodeWithODECollisionModel::worldMapCallback);
+ }
+
+ virtual ~NodeWithODECollisionModel(void)
+ {
+ if (m_collisionSpace)
+ delete m_collisionSpace;
+ }
+
+ virtual void setRobotDescription(robot_desc::URDF *file)
+ {
+ NodeWithRobotModel::setRobotDescription(file);
+ if (m_kmodel)
+ {
+ m_collisionSpace->lock();
+ m_collisionSpace->addRobotModel(m_kmodel);
+ m_collisionSpace->unlock();
+ }
+ }
+
+ protected:
+
+ std_msgs::PointCloudFloat32 m_worldCloud;
+ collision_space::EnvironmentModelODE *m_collisionSpace;
+ double m_sphereSize;
+
+ void worldMapCallback(void)
+ {
+ unsigned int n = m_worldCloud.get_pts_size();
+ printf("received %u points (world map)\n", n);
+
+ beforeWorldUpdate();
+
+ ros::Time startTime = ros::Time::now();
+ double *data = new double[3 * n];
+ for (unsigned int i = 0 ; i < n ; ++i)
+ {
+ unsigned int i3 = i * 3;
+ data[i3 ] = m_worldCloud.pts[i].x;
+ data[i3 + 1] = m_worldCloud.pts[i].y;
+ data[i3 + 2] = m_worldCloud.pts[i].z;
+ }
+
+ m_collisionSpace->lock();
+ m_collisionSpace->clearObstacles();
+ m_collisionSpace->addPointCloud(n, data, m_sphereSize);
+ m_collisionSpace->unlock();
+
+ delete[] data;
+
+ double tupd = (ros::Time::now() - startTime).to_double();
+ printf("Updated world model in %f seconds\n", tupd);
+
+ afterWorldUpdate();
+ }
+
+ virtual void beforeWorldUpdate(void)
+ {
+ }
+
+ virtual void afterWorldUpdate(void)
+ {
+ }
+
+ };
+
+}
Modified: pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/knode.h
===================================================================
--- pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/knode.h 2008-08-13 23:18:57 UTC (rev 3019)
+++ pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/knode.h 2008-08-13 23:22:13 UTC (rev 3020)
@@ -109,6 +109,23 @@
}
}
+ void defaultPosition(void)
+ {
+ if (m_kmodel)
+ {
+ double defaultPose[m_kmodel->stateDimension];
+ for (unsigned int i = 0 ; i < m_kmodel->stateDimension ; ++i)
+ defaultPose[i] = 0.0;
+
+ m_kmodel->computeTransforms(defaultPose);
+ }
+ }
+
+ bool loadedRobot(void) const
+ {
+ return m_kmodel != NULL;
+ }
+
protected:
void localizedPoseCallback(void)
Modified: pkg/trunk/motion_planning/planning_world_viewer/manifest.xml
===================================================================
--- pkg/trunk/motion_planning/planning_world_viewer/manifest.xml 2008-08-13 23:18:57 UTC (rev 3019)
+++ pkg/trunk/motion_planning/planning_world_viewer/manifest.xml 2008-08-13 23:22:13 UTC (rev 3020)
@@ -5,7 +5,7 @@
<depend package="roscpp" />
<depend package="robot_msgs" />
<depend package="robot_srvs" />
- <depend package="xmlparam" />
- <depend package="collision_space" />
+ <depend package="rosthread" />
+ <depend package="planning_node_util" />
<depend package="display_ode_spaces" />
</package>
Modified: pkg/trunk/motion_planning/planning_world_viewer/src/planning_world_viewer.cpp
===================================================================
--- pkg/trunk/motion_planning/planning_world_viewer/src/planning_world_viewer.cpp 2008-08-13 23:18:57 UTC (rev 3019)
+++ pkg/trunk/motion_planning/planning_world_viewer/src/planning_world_viewer.cpp 2008-08-13 23:22:13 UTC (rev 3020)
@@ -81,15 +81,9 @@
**/
-#include <ros/node.h>
-#include <ros/time.h>
-#include <std_msgs/PointCloudFloat32.h>
-#include <std_msgs/RobotBase2DOdom.h>
-
+#include <planning_node_util/cnode.h>
+#include <rosthread/mutex.h>
#include <robot_msgs/NamedKinematicPath.h>
-
-#include <urdf/URDF.h>
-#include <collision_space/environmentODE.h>
#include <display_ode/displayODE.h>
#include <vector>
@@ -97,77 +91,44 @@
#include <sstream>
#include <map>
-class PlanningWorldViewer : public ros::node
+class PlanningWorldViewer : public planning_node_util::NodeWithODECollisionModel
{
public:
- PlanningWorldViewer(void) : ros::node("planning_world_viewer")
+ PlanningWorldViewer(const std::string &robot_model) : planning_node_util::NodeWithODECollisionModel(robot_model, "planning_world_viewer")
{
- subscribe("world_3d_map", m_cloud, &PlanningWorldViewer::pointCloudCallback);
- subscribe("localizedpose", m_localizedPose, &PlanningWorldViewer::localizedPoseCallback);
subscribe("display_kinematic_path", m_displayPath, &PlanningWorldViewer::displayPathCallback);
- m_collisionSpace = new collision_space::EnvironmentModelODE();
- m_collisionSpace->setSelfCollision(false);
- m_basePos[0] = m_basePos[1] = m_basePos[2] = 0.0;
m_follow = true;
m_displayRobot = true;
m_displayObstacles = true;
m_checkCollision = false;
- m_collisionSpace->lock();
- loadRobotDescriptions();
- m_collisionSpace->unlock();
-
updateODESpaces();
}
~PlanningWorldViewer(void)
{
- for (unsigned int i = 0 ; i < m_robotDescriptions.size() ; ++i)
- delete m_robotDescriptions[i];
- if (m_collisionSpace)
- delete m_collisionSpace;
}
void updateODESpaces(void)
{
- m_collisionSpace->lock();
+ m_collisionSpace->lock();
+ m_displayLock.lock();
m_spaces.clear();
if (m_displayObstacles)
m_spaces.addSpace(m_collisionSpace->getODESpace(), 1.0f, 0.0f, 0.0f);
if (m_displayRobot)
for (unsigned int i = 0 ; i < m_collisionSpace->getModelCount() ; ++i)
m_spaces.addSpace(m_collisionSpace->getModelODESpace(i), 0.1f, 0.5f, (float)(i + 1)/(float)m_collisionSpace->getModelCount());
+ m_displayLock.unlock();
m_collisionSpace->unlock();
}
- void loadRobotDescriptions(void)
+ void baseUpdate(void)
{
- printf("Loading robot descriptions...\n\n");
+ planning_node_util::NodeWithODECollisionModel::baseUpdate();
- std::string description_files;
- if (get_param("robotdesc_list", description_files))
- {
- std::stringstream sdf(description_files);
- while (sdf.good())
- {
- std::string file;
- std::string content;
- sdf >> file;
- if (get_param(file, content))
- addRobotDescriptionFromData(content.c_str());
- }
- }
- printf("\n\n");
- }
-
- void localizedPoseCallback(void)
- {
- m_basePos[0] = m_localizedPose.pos.x;
- m_basePos[1] = m_localizedPose.pos.y;
- m_basePos[2] = m_localizedPose.pos.th;
-
if (m_collisionSpace && m_collisionSpace->getModelCount() == 1 && m_follow)
{
int group = m_collisionSpace->getModel(0)->getGroupID("pr2::base");
@@ -183,113 +144,43 @@
}
}
- void pointCloudCallback(void)
+ virtual void beforeWorldUpdate(void)
{
- unsigned int n = m_cloud.get_pts_size();
- printf("received %u points\n", n);
-
- ros::Time startTime = ros::Time::now();
- double *data = new double[3 * n];
- for (unsigned int i = 0 ; i < n ; ++i)
- {
- unsigned int i3 = i * 3;
- data[i3 ] = m_cloud.pts[i].x;
- data[i3 + 1] = m_cloud.pts[i].y;
- data[i3 + 2] = m_cloud.pts[i].z;
- }
-
- m_collisionSpace->lock();
+ planning_node_util::NodeWithODECollisionModel::beforeWorldUpdate();
+ m_displayLock.lock();
m_spaces.clear();
- m_collisionSpace->clearObstacles();
- m_collisionSpace->addPointCloud(n, data, 0.03);
- m_collisionSpace->unlock();
-
- delete[] data;
-
- updateODESpaces();
-
- double tupd = (ros::Time::now() - startTime).to_double();
- printf("Updated world model in %f seconds\n", tupd);
-
+ m_displayLock.unlock();
}
+
+ virtual void afterWorldUpdate(void)
+ {
+ planning_node_util::NodeWithODECollisionModel::afterWorldUpdate();
+ updateODESpaces();
+ }
void displayPathCallback(void)
{
- if (m_collisionSpace->getModelCount() != 1)
- return;
bool follow = m_follow;
m_follow = false;
ros::Duration sleepTime(0.2);
- planning_models::KinematicModel *kmodel = m_collisionSpace->getModel(0);
- int groupID = kmodel->getGroupID(m_displayPath.name);
+ int groupID = m_kmodel->getGroupID(m_displayPath.name);
for (unsigned int i = 0 ; i < m_displayPath.path.get_states_size() ; ++i)
{
- kmodel->computeTransforms(m_displayPath.path.states[i].vals, groupID);
+ m_kmodel->computeTransforms(m_displayPath.path.states[i].vals, groupID);
m_collisionSpace->updateRobotModel(0);
sleepTime.sleep();
}
m_follow = follow;
}
- void addRobotDescriptionFromFile(const char *filename)
+ virtual void setRobotDescription(robot_desc::URDF *file)
{
- robot_desc::URDF *file = new robot_desc::URDF();
- if (file->loadFile(filename))
- addRobotDescription(file);
- else
- delete file;
+ planning_node_util::NodeWithODECollisionModel::setRobotDescription(file);
+ defaultPosition();
+ m_collisionSpace->updateRobotModel(0);
}
- void addRobotDescriptionFromData(const char *data)
- {
- robot_desc::URDF *file = new robot_desc::URDF();
- if (file->loadString(data))
- addRobotDescription(file);
- else
- delete file;
- }
-
- void addRobotDescription(robot_desc::URDF *file)
- {
- m_robotDescriptions.push_back(file);
-
- printf("\n\nCreating new kinematic model:\n");
-
- /* create a model for the whole robot (with the name given in the file) */
- planning_models::KinematicModel *kmodel = new planning_models::KinematicModel();
- kmodel->setVerbose(true);
- kmodel->build(*file);
-
- /* add the model to the collision space */
- unsigned int cid = m_collisionSpace->addRobotModel(kmodel);
-
- defaultPosition(kmodel, cid);
- }
-
- void defaultPosition(planning_models::KinematicModel *kmodel = NULL, unsigned int cid = 0)
- {
- if (!kmodel)
- {
- if (m_collisionSpace->getModelCount() == 1)
- kmodel = m_collisionSpace->getModel(0);
- else
- return;
- }
-
- double defaultPose[kmodel->stateDimension];
- for (unsigned int i = 0 ; i < kmodel->stateDimension ; ++i)
- defaultPose[i] = 0.0;
-
- kmodel->computeTransforms(defaultPose);
- m_collisionSpace->updateRobotModel(cid);
- }
-
- unsigned int getRobotCount(void) const
- {
- return m_robotDescriptions.size();
- }
-
bool getFollow(void) const
{
return m_follow;
@@ -345,20 +236,16 @@
void display(void)
{
- m_collisionSpace->lock();
+ m_displayLock.lock();
m_spaces.displaySpaces();
- m_collisionSpace->unlock();
+ m_displayLock.unlock();
}
private:
- std_msgs::PointCloudFloat32 m_cloud;
- std_msgs::RobotBase2DOdom m_localizedPose;
- collision_space::EnvironmentModelODE *m_collisionSpace;
- std::vector<robot_desc::URDF*> m_robotDescriptions;
- double m_basePos[3];
-
display_ode::DisplayODESpaces m_spaces;
+ ros::thread::mutex m_displayLock;
+
robot_msgs::NamedKinematicPath m_displayPath;
bool m_follow;
bool m_displayRobot;
@@ -419,30 +306,41 @@
viewer->display();
}
+void usage(const char *progname)
+{
+ printf("\nUsage: %s robot_model [standard ROS args]\n", progname);
+ printf(" \"robot_model\" is the name (string) of a robot description to be used when showing the map.\n");
+}
+
int main(int argc, char **argv)
{
- ros::init(argc, argv);
-
- viewer = new PlanningWorldViewer();
-
- if (viewer->getRobotCount() > 0)
- {
- dsFunctions fn;
- fn.version = DS_VERSION;
- fn.start = &start;
- fn.step = &simLoop;
- fn.command = &command;
- fn.stop = 0;
- fn.path_to_textures = "./res";
+ if (argc == 2)
+ {
+ ros::init(argc, argv);
+
+ viewer = new PlanningWorldViewer(argv[1]);
- dsSimulationLoop(argc, argv, 640, 480, &fn);
+ if (viewer->loadedRobot())
+ {
+ dsFunctions fn;
+ fn.version = DS_VERSION;
+ fn.start = &start;
+ fn.step = &simLoop;
+ fn.command = &command;
+ fn.stop = 0;
+ fn.path_to_textures = "./res";
+
+ dsSimulationLoop(argc, argv, 640, 480, &fn);
+ }
+ else
+ printf("No model defined. Display world node cannot start.\n");
+
+ viewer->shutdown();
+
+ delete viewer;
}
else
- printf("No models defined. Kinematic planning node cannot start.\n");
+ usage(argv[0]);
- viewer->shutdown();
-
- delete viewer;
-
return 0;
}
Modified: pkg/trunk/util/display_ode_spaces/include/display_ode/displayODE.h
===================================================================
--- pkg/trunk/util/display_ode_spaces/include/display_ode/displayODE.h 2008-08-13 23:18:57 UTC (rev 3019)
+++ pkg/trunk/util/display_ode_spaces/include/display_ode/displayODE.h 2008-08-13 23:22:13 UTC (rev 3020)
@@ -32,6 +32,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*********************************************************************/
+#ifndef DISPLAY_ODE_H
+#define DISPLAY_ODE_H
+
#include <ode/ode.h>
#include <drawstuff/drawstuff.h>
#include <vector>
@@ -132,3 +135,4 @@
};
}
+#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <is...@us...> - 2008-08-13 23:48:42
|
Revision: 3025
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=3025&view=rev
Author: isucan
Date: 2008-08-13 23:48:51 +0000 (Wed, 13 Aug 2008)
Log Message:
-----------
updated some documentation
Modified Paths:
--------------
pkg/trunk/motion_planning/kinematic_planning/src/kinematic_planning.cpp
pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/cnode.h
pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/knode.h
pkg/trunk/motion_planning/planning_world_viewer/src/planning_world_viewer.cpp
pkg/trunk/robot_descriptions/wg_robot_description/send.xml
pkg/trunk/world_models/world_3d_map/src/world_3d_map.cpp
Modified: pkg/trunk/motion_planning/kinematic_planning/src/kinematic_planning.cpp
===================================================================
--- pkg/trunk/motion_planning/kinematic_planning/src/kinematic_planning.cpp 2008-08-13 23:40:48 UTC (rev 3024)
+++ pkg/trunk/motion_planning/kinematic_planning/src/kinematic_planning.cpp 2008-08-13 23:48:51 UTC (rev 3025)
@@ -36,7 +36,7 @@
@mainpage
-@htmlinclude manifest.html
+@htmlinclude ../manifest.html
@b KinematicPlanning is a node capable of planning kinematic paths for
a set of robot models.
@@ -45,13 +45,13 @@
@section usage Usage
@verbatim
-$ kinematic_planning [standard ROS args]
+$ kinematic_planning robot_model [standard ROS args]
@endverbatim
@par Example
@verbatim
-$ kinematic_planning
+$ kinematic_planning robotdesc/pr2
@endverbatim
<hr>
@@ -59,7 +59,7 @@
@section topic ROS topics
Subscribes to (name/type):
-- @b world_3d_map/PointCloudFloat32 : point cloud with data describing the 3D environment
+- None
Publishes to (name/type):
- None
Modified: pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/cnode.h
===================================================================
--- pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/cnode.h 2008-08-13 23:40:48 UTC (rev 3024)
+++ pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/cnode.h 2008-08-13 23:48:51 UTC (rev 3025)
@@ -32,6 +32,42 @@
* POSSIBILITY OF SUCH DAMAGE.
*********************************************************************/
+/**
+
+@mainpage
+
+@htmlinclude ../../manifest.html
+
+@b NodeWithODECollisionModel is a ROS node that in addition to being aware of a robot model,
+is also aware of an ODE collision space
+
+<hr>
+
+@section topic ROS topics
+
+Subscribes to (name/type):
+- @b world_3d_map/PointCloudFloat32 : point cloud with data describing the 3D environment
+
+Publishes to (name/type):
+- None
+
+<hr>
+
+@section services ROS services
+
+Uses (name/type):
+- None
+
+Provides (name/type):
+- None
+
+<hr>
+
+@section parameters ROS parameters
+- None
+
+**/
+
#include <planning_node_util/knode.h>
#include <std_msgs/PointCloudFloat32.h>
#include <collision_space/environmentODE.h>
Modified: pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/knode.h
===================================================================
--- pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/knode.h 2008-08-13 23:40:48 UTC (rev 3024)
+++ pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/knode.h 2008-08-13 23:48:51 UTC (rev 3025)
@@ -32,6 +32,41 @@
* POSSIBILITY OF SUCH DAMAGE.
*********************************************************************/
+/**
+
+@mainpage
+
+@htmlinclude ../../manifest.html
+
+@b NodeWithRobotModel is a ROS node that is also aware of a given robot model
+
+<hr>
+
+@section topic ROS topics
+
+Subscribes to (name/type):
+- @b localizedpose/RobotBase2DOdom : localized position of the robot base
+
+Publishes to (name/type):
+- None
+
+<hr>
+
+@section services ROS services
+
+Uses (name/type):
+- None
+
+Provides (name/type):
+- None
+
+<hr>
+
+@section parameters ROS parameters
+- None
+
+**/
+
#include <ros/node.h>
#include <ros/time.h>
#include <urdf/URDF.h>
Modified: pkg/trunk/motion_planning/planning_world_viewer/src/planning_world_viewer.cpp
===================================================================
--- pkg/trunk/motion_planning/planning_world_viewer/src/planning_world_viewer.cpp 2008-08-13 23:40:48 UTC (rev 3024)
+++ pkg/trunk/motion_planning/planning_world_viewer/src/planning_world_viewer.cpp 2008-08-13 23:48:51 UTC (rev 3025)
@@ -36,7 +36,7 @@
@mainpage
-@htmlinclude manifest.html
+@htmlinclude ../manifest.html
@b PlanningWorldViewer is a node capable of displaying the state of the world
the motion planner sees
@@ -45,13 +45,13 @@
@section usage Usage
@verbatim
-$ planning_world_viewer [standard ROS args]
+$ planning_world_viewer robot_model [standard ROS args]
@endverbatim
@par Example
@verbatim
-$ planning_world_viewer
+$ planning_world_viewer robotdesc/pr2
@endverbatim
<hr>
@@ -59,7 +59,7 @@
@section topic ROS topics
Subscribes to (name/type):
-- @b world_3d_map/PointCloudFloat32 : point cloud with data describing the 3D environment
+- None
Publishes to (name/type):
- None
Modified: pkg/trunk/robot_descriptions/wg_robot_description/send.xml
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description/send.xml 2008-08-13 23:40:48 UTC (rev 3024)
+++ pkg/trunk/robot_descriptions/wg_robot_description/send.xml 2008-08-13 23:48:51 UTC (rev 3025)
@@ -1,6 +1,5 @@
<launch>
- <param name="robotdesc_list" value="robotdesc/pr2" />
<param name="robotdesc/pr2" command="$(find wg_robot_description_parser)/merge "$(find wg_robot_description)/pr2/pr2.xml"" />
</launch>
Modified: pkg/trunk/world_models/world_3d_map/src/world_3d_map.cpp
===================================================================
--- pkg/trunk/world_models/world_3d_map/src/world_3d_map.cpp 2008-08-13 23:40:48 UTC (rev 3024)
+++ pkg/trunk/world_models/world_3d_map/src/world_3d_map.cpp 2008-08-13 23:48:51 UTC (rev 3025)
@@ -36,7 +36,7 @@
@mainpage
-@htmlinclude manifest.html
+@htmlinclude ../manifest.html
@b world_3d_map is a node capable of building 3D maps out of laser
scan data. The node will put together a pointcloud in the FRAMEID_MAP
@@ -57,7 +57,7 @@
@par Example
@verbatim
-$ world_3d_map
+$ world_3d_map robotdesc/pr2 scan:=tilt_scan
@endverbatim
@par Notes
@@ -73,7 +73,6 @@
Subscribes to (name/type):
- @b scan/LaserScan : scan data received from a laser
-- @b robotpose/RobotBase2DOdom : position of the robot base
Publishes to (name/type):
- @b "world_3d_map"/PointCloudFloat32 : point cloud describing the 3D environment
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <is...@us...> - 2008-08-14 00:46:39
|
Revision: 3034
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=3034&view=rev
Author: isucan
Date: 2008-08-14 00:46:47 +0000 (Thu, 14 Aug 2008)
Log Message:
-----------
fixing little glitches...
Modified Paths:
--------------
pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/cnode.h
pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/knode.h
pkg/trunk/motion_planning/planning_world_viewer/src/planning_world_viewer.cpp
pkg/trunk/world_models/world_3d_map/src/world_3d_map.cpp
Modified: pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/cnode.h
===================================================================
--- pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/cnode.h 2008-08-14 00:29:03 UTC (rev 3033)
+++ pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/cnode.h 2008-08-14 00:46:47 UTC (rev 3034)
@@ -92,7 +92,10 @@
virtual ~NodeWithODECollisionModel(void)
{
if (m_collisionSpace)
+ {
delete m_collisionSpace;
+ m_kmodel = NULL;
+ }
}
virtual void setRobotDescription(robot_desc::URDF *file)
Modified: pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/knode.h
===================================================================
--- pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/knode.h 2008-08-14 00:29:03 UTC (rev 3033)
+++ pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/knode.h 2008-08-14 00:46:47 UTC (rev 3034)
@@ -88,7 +88,7 @@
m_urdf = NULL;
m_kmodel = NULL;
m_basePos[0] = m_basePos[1] = m_basePos[2] = 0.0;
- loadRobotDescription(robot_model);
+ m_robotModelName = robot_model;
subscribe("localizedpose", m_localizedPose, &NodeWithRobotModel::localizedPoseCallback);
}
@@ -132,15 +132,15 @@
m_kmodel->build(*file);
}
- virtual void loadRobotDescription(const std::string &robot_model)
+ virtual void loadRobotDescription(void)
{
- if (!robot_model.empty() && robot_model != "-")
+ if (!m_robotModelName.empty() && m_robotModelName != "-")
{
std::string content;
- if (get_param(robot_model, content))
+ if (get_param(m_robotModelName, content))
setRobotDescriptionFromData(content.c_str());
else
- fprintf(stderr, "Robot model '%s' not found!\n", robot_model.c_str());
+ fprintf(stderr, "Robot model '%s' not found!\n", m_robotModelName.c_str());
}
}
@@ -211,6 +211,7 @@
std_msgs::RobotBase2DOdom m_localizedPose;
robot_desc::URDF *m_urdf;
planning_models::KinematicModel *m_kmodel;
+ std::string m_robotModelName;
double m_basePos[3];
};
Modified: pkg/trunk/motion_planning/planning_world_viewer/src/planning_world_viewer.cpp
===================================================================
--- pkg/trunk/motion_planning/planning_world_viewer/src/planning_world_viewer.cpp 2008-08-14 00:29:03 UTC (rev 3033)
+++ pkg/trunk/motion_planning/planning_world_viewer/src/planning_world_viewer.cpp 2008-08-14 00:46:47 UTC (rev 3034)
@@ -104,7 +104,6 @@
m_displayObstacles = true;
m_checkCollision = false;
- updateODESpaces();
}
~PlanningWorldViewer(void)
@@ -139,7 +138,7 @@
{
ros::Time startTime = ros::Time::now();
printf("Collision: %d [%f s]\n", m_collisionSpace->isCollision(0), (ros::Time::now() - startTime).to_double());
- }
+ }
m_collisionSpace->unlock();
}
}
@@ -235,6 +234,8 @@
void display(void)
{
+ // printf("disp\n");
+
m_displayLock.lock();
m_spaces.displaySpaces();
m_displayLock.unlock();
@@ -318,7 +319,9 @@
ros::init(argc, argv);
viewer = new PlanningWorldViewer(argv[1]);
-
+ viewer->loadRobotDescription();
+ viewer->updateODESpaces();
+
if (viewer->loadedRobot())
{
dsFunctions fn;
Modified: pkg/trunk/world_models/world_3d_map/src/world_3d_map.cpp
===================================================================
--- pkg/trunk/world_models/world_3d_map/src/world_3d_map.cpp 2008-08-14 00:29:03 UTC (rev 3033)
+++ pkg/trunk/world_models/world_3d_map/src/world_3d_map.cpp 2008-08-14 00:46:47 UTC (rev 3034)
@@ -119,11 +119,11 @@
advertise<std_msgs::PointCloudFloat32>("world_3d_map");
advertise<rostools::Log>("roserr");
- param("max_publish_frequency", m_maxPublishFrequency, 0.5);
- param("retain_pointcloud_duration", m_retainPointcloudDuration, 60.0);
- param("retain_pointcloud_fraction", m_retainPointcloudFraction, 0.02);
- param("retain_above_ground_threshold", m_retainAboveGroundThreshold, 0.01);
- param("verbosity_level", m_verbose, 1);
+ param("world_3d_map/max_publish_frequency", m_maxPublishFrequency, 0.5);
+ param("world_3d_map/retain_pointcloud_duration", m_retainPointcloudDuration, 60.0);
+ param("world_3d_map/retain_pointcloud_fraction", m_retainPointcloudFraction, 0.02);
+ param("world_3d_map/retain_above_ground_threshold", m_retainAboveGroundThreshold, 0.01);
+ param("world_3d_map/verbosity_level", m_verbose, 1);
/* create a thread that does the processing of the input data.
* and one that handles the publishing of the data */
@@ -172,9 +172,12 @@
void baseUpdate(void)
{
planning_node_util::NodeWithRobotModel::baseUpdate();
- int group = m_kmodel->getGroupID(m_urdf->getRobotName() + "::base");
- if (group >= 0)
- m_kmodel->computeTransforms(m_basePos, group);
+ if (m_kmodel)
+ {
+ int group = m_kmodel->getGroupID(m_urdf->getRobotName() + "::base");
+ if (group >= 0)
+ m_kmodel->computeTransforms(m_basePos, group);
+ }
}
void pointCloudCallback(void)
@@ -184,6 +187,8 @@
of data will not happen, but we don't want the node to
postpone processing latest data just because it is not done
with older data. */
+ if (m_verbose)
+ printf("Received laser scan with %u points in frame %d\n", m_inputScan.get_ranges_size(), m_inputScan.header.frame_id);
m_flagMutex.lock();
bool discard = m_working;
@@ -206,7 +211,7 @@
bool success = true;
try
{
- m_tf.transformLaserScanToPointCloud("FRAMEID_MAP", m_toProcess, m_inputScan);
+ m_tf.transformLaserScanToPointCloud("tilt_laser", m_toProcess, m_inputScan);
}
catch(libTF::TransformReference::LookupException& ex)
{
@@ -435,7 +440,10 @@
keep = !m_selfSeeParts[i].body->containsPoint(x, y, z);
if (keep)
+ {
copy->pts[j++] = cloud.pts[k];
+ printf("%f\n", cloud.pts[k].z);
+ }
}
}
if (m_verbose)
@@ -481,9 +489,11 @@
if (argc == 2)
{
- World3DMap map(argv[1]);
- map.spin();
- map.shutdown();
+ World3DMap *map = new World3DMap(argv[1]);
+ map->loadRobotDescription();
+ map->spin();
+ map->shutdown();
+ delete map;
}
else
usage(argv[0]);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hsu...@us...> - 2008-08-14 02:01:27
|
Revision: 3053
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=3053&view=rev
Author: hsujohnhsu
Date: 2008-08-14 02:01:35 +0000 (Thu, 14 Aug 2008)
Log Message:
-----------
updates to test plugins.
updates to mechanism control for access to components w/o xml.
Modified Paths:
--------------
pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/test_actuators.h
pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Camera.cc
pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Laser.cc
pkg/trunk/drivers/simulator/gazebo_plugin/src/test_actuators.cpp
pkg/trunk/mechanism/mechanism_control/include/mechanism_control/mechanism_control.h
pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp
pkg/trunk/mechanism/mechanism_model/include/mechanism_model/joint.h
pkg/trunk/mechanism/mechanism_model/include/mechanism_model/transmission.h
pkg/trunk/mechanism/mechanism_model/src/simple_transmission.cpp
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/test_actuators.h
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/test_actuators.h 2008-08-14 01:58:02 UTC (rev 3052)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/include/gazebo_plugin/test_actuators.h 2008-08-14 02:01:35 UTC (rev 3053)
@@ -105,11 +105,15 @@
Model *parent_model_;
+ TiXmlDocument *pr2Doc_;
+
//---------------------------------------------------------------------
// for mechanism control
//---------------------------------------------------------------------
- //MechanismControl mc_;
- //MechanismControlNode mcn_; // multiple nodes per process
+ MechanismControl mc_;
+ MechanismControl rmc_;
+ MechanismControlNode mcn_;
+ MechanismControlNode rmcn_;
// pointer to ros node
ros::node *rosnode_;
@@ -133,7 +137,7 @@
//std::vector<mechanism::Transmission*> transmissions_;
//std::vector<std::string> actuator_names_;
//std::vector<gazebo::Joint*> gazebo_joints_;
- HardwareInterface *hw_;
+ HardwareInterface hw_;
// 2. fill in HardwareInterface
// actuators_ is a vector
@@ -164,11 +168,12 @@
robot_desc::URDF pr2Description;
// for storing pr2 xml
- mechanism::Robot* mech_robot_;
+ //mechanism::Robot* mech_robot_;
// for storing reverse transmission results
- mechanism::Robot* reverse_mech_robot_;
+ //mechanism::Robot* reverse_mech_robot_;
+
// for storing controller xml
struct Robot_controller_
{
@@ -176,13 +181,12 @@
std::string type;
std::string joint_name;
std::string joint_type;
+
mechanism::Joint* mech_joint_;
mechanism::Joint* reverse_mech_joint_;
std::string control_mode; // obsolete? use to pick controller for now
double p_gain,i_gain,d_gain,windup, init_time;
- controller::JointPositionController pcontroller; // our fancy controller
- controller::JointVelocityController vcontroller; // our fancy controller
double saturation_torque;
double explicitDampingCoefficient;
@@ -193,44 +197,20 @@
std::vector<Robot_controller_> robot_controllers_;
// for storing transmission xml
- struct Robot_transmission_
- {
- std::string name;
- std::string joint_name;
- std::string actuator_name;
- mechanism::SimpleTransmission simple_transmission;
- gazebo::Joint* gazebo_joints_;
- };
- std::vector<Robot_transmission_> robot_transmissions_;
- std::vector<Robot_transmission_> reverse_robot_transmissions_;
+ // struct Robot_transmission_
+ // {
+ // std::string name;
+ // mechanism::SimpleTransmission simple_transmission;
+ // gazebo::Joint* gazebo_joints_;
+ // };
+ //std::vector<Robot_transmission_> robot_transmissions_;
+ //std::vector<Robot_transmission_> reverse_robot_transmissions_;
+ std::vector<mechanism::SimpleTransmission> transmissions_;
- // for storing actuator xml
- struct Robot_actuator_
- {
- std::string name;
- std::string motorboardID;
- double maxCurrent;
- std::string motor;
- std::string ip;
- double port;
- double reduction;
- Vector3 polymap;
- // use our fancy Actuator class
- Actuator actuator;
- // link to joint?
- //gazebo::Joint* gazebo_joints_;
- };
- std::map<std::string,Robot_actuator_> robot_actuators_;
-
-
-
-
-
-
//------------------------------------------------------------
// offsets for frame transform
//------------------------------------------------------------
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Camera.cc
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Camera.cc 2008-08-14 01:58:02 UTC (rev 3052)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Camera.cc 2008-08-14 02:01:35 UTC (rev 3053)
@@ -173,7 +173,7 @@
this->lock.lock();
// copy data into image
- this->imageMsg.header.frame_id = tfc->lookup(this->frameName);
+ this->imageMsg.header.frame_id = tfc->nameClient.lookup(this->frameName);
this->imageMsg.header.stamp.sec = (unsigned long)floor(this->cameraIface->data->head.time);
this->imageMsg.header.stamp.nsec = (unsigned long)floor( 1e9 * ( this->cameraIface->data->head.time - this->imageMsg.header.stamp.sec) );
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Laser.cc
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Laser.cc 2008-08-14 01:58:02 UTC (rev 3052)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Laser.cc 2008-08-14 02:01:35 UTC (rev 3053)
@@ -174,7 +174,7 @@
/* */
/***************************************************************/
this->lock.lock();
- this->laserMsg.header.frame_id = tfc->lookup(this->frameName);
+ this->laserMsg.header.frame_id = tfc->nameClient.lookup(this->frameName);
this->laserMsg.header.stamp.sec = (unsigned long)floor(this->laserIface->data->head.time);
this->laserMsg.header.stamp.nsec = (unsigned long)floor( 1e9 * ( this->laserIface->data->head.time - this->laserMsg.header.stamp.sec) );
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/src/test_actuators.cpp
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/src/test_actuators.cpp 2008-08-14 01:58:02 UTC (rev 3052)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/src/test_actuators.cpp 2008-08-14 02:01:35 UTC (rev 3053)
@@ -48,7 +48,7 @@
GZ_REGISTER_DYNAMIC_CONTROLLER("test_actuators", GazeboActuators);
GazeboActuators::GazeboActuators(Entity *parent)
- : Controller(parent) // , hw_(0), mc_(&hw_) //, mcn_(&mc_)
+ : Controller(parent) , hw_(0), mc_(&hw_), rmc_(&hw_) , mcn_(&mc_), rmcn_(&rmc_)
{
this->parent_model_ = dynamic_cast<Model*>(this->parent);
@@ -68,9 +68,6 @@
tfc = new rosTFClient(*rosnode_); //, true, 1 * 1000000000ULL, 0ULL);
tfs = new rosTFServer(*rosnode_); //, true, 1 * 1000000000ULL, 0ULL);
- // initialize hardware interface
- hw_ = new HardwareInterface(0);
-
// uses info from wg_robot_description_parser/send.xml
std::string pr2Content;
// get pr2.xml for Ioan's parser
@@ -78,6 +75,12 @@
// parse the big pr2.xml string from ros
pr2Description.loadString(pr2Content.c_str());
+
+ // using tiny xml
+ pr2Doc_ = new TiXmlDocument();
+ pr2Doc_->SetUserData(NULL);
+ pr2Doc_->Parse(pr2Content.c_str());
+
AdvertiseSubscribeMessages();
}
@@ -113,7 +116,7 @@
{
// TODO: mc_.init();
- hw_->current_time_ = Simulator::Instance()->GetSimTime();
+ hw_.current_time_ = Simulator::Instance()->GetSimTime();
}
void GazeboActuators::UpdateChild()
@@ -150,24 +153,28 @@
//
//-------------------------------------------------------------------------------------------
+ // FIXME: mechanism control is not able to read joints from pr2.xml yet. for now, rely on Ioan's parser
// get all links in pr2.xml
std::vector<robot_desc::URDF::Link*> links;
pr2Description.getLinks(links);
- std::cout << " pr2.xml link size(): " << links.size() << std::endl;
+ std::cout << " pr2.xml link size: " << links.size() << std::endl;
// create a robot for forward transmission
// create joints for mech_joint_ cycle through all links in pr2.xml
- mech_robot_ = new mechanism::Robot((char*)NULL);
for (std::vector<robot_desc::URDF::Link*>::iterator lit = links.begin(); lit != links.end(); lit++)
{
- std::cout << " link name: " << (*lit)->name << std::endl;
+ std::cout << " link name: " << (*lit)->name;
if ((*lit)->isSet["joint"])
{
// FIXME: assume there's a joint to every link, this is not true if there are floating joints
- std::cout << " link joint name: " << (*lit)->joint->name << std::endl;
mechanism::Joint* joint;
joint = new mechanism::Joint();
+ // assign name of joint
+ joint->name_ = (*lit)->joint->name;
+ //joint->name_ = new char(((*lit)->joint->name).size());
+ //strcpy(joint->name_,(*lit)->joint->name.c_str());
+ //std::cout << " link joint name: " << joint->name_ << std::endl;
// FIXME: bug: copy name to a variable
//char* robot_joint_name;
//robot_joint_name = new char((*lit)->joint->name.size());
@@ -208,27 +215,29 @@
joint->joint_limit_max_ = 0;
joint->effort_limit_ = (*lit)->joint->effortLimit;
joint->velocity_limit_ = (*lit)->joint->velocityLimit;
- mech_robot_->joints_.push_back(joint);
- mech_robot_->joints_lookup_.insert(make_pair((*lit)->joint->name,(mech_robot_->joints_.size())-1));
+ mc_.addJoint(joint);
}
}
- mech_robot_->hw_ = hw_;
// create a fake robot for reverse transmission in gazebo
// create joints for reverse_mech_joint_, cycle through all links in pr2.xml
- reverse_mech_robot_ = new mechanism::Robot((char*)NULL);
for (std::vector<robot_desc::URDF::Link*>::iterator lit = links.begin(); lit != links.end(); lit++)
{
- std::cout << " link name: " << (*lit)->name << std::endl;
+ std::cout << " link name: " << (*lit)->name;
if ((*lit)->isSet["joint"])
{
// FIXME: assume there's a joint to every link, this is not true if there are floating joints
- std::cout << " link joint name: " << (*lit)->joint->name << std::endl;
mechanism::Joint* joint;
joint = new mechanism::Joint();
+ // assign name of joint
+ joint->name_ = (*lit)->joint->name;
+ //joint->name_ = new char(((*lit)->joint->name).size());
+ //strcpy(joint->name_,(*lit)->joint->name.c_str());
+ //std::cout << " link joint name: " << joint->name_ << std::endl;
+
// FIXME: bug: copy name to a variable
//char* robot_joint_name;
//robot_joint_name = new char((*lit)->joint->name.size());
@@ -269,22 +278,19 @@
joint->joint_limit_max_ = 0;
joint->effort_limit_ = (*lit)->joint->effortLimit;
joint->velocity_limit_ = (*lit)->joint->velocityLimit;
- reverse_mech_robot_->joints_.push_back(joint);
- reverse_mech_robot_->joints_lookup_.insert(make_pair((*lit)->joint->name,(reverse_mech_robot_->joints_.size())-1));
+ rmc_.addJoint(joint);
}
}
- reverse_mech_robot_->hw_ = hw_;
- // loop through copied controller, transmission, actuator data in gazebo pr2 model file
+ //-----------------------------------------------------------------------------------------
+ //
+ // CONTROLLER XML
+ //
+ //-----------------------------------------------------------------------------------------
for (XMLConfigNode *xit = node->GetChild("robot"); xit; xit=xit->GetNext("robot"))
{
- //-----------------------------------------------------------------------------------------
- //
- // CONTROLLER XML
- //
- //-----------------------------------------------------------------------------------------
std::cout << " LoadChild gazebo controller: " << xit->GetString("name","",0) << std::endl;
// one layer below <robot name="pr2">
@@ -301,25 +307,33 @@
controller.joint_name = jit->GetString("name", "", 1);
controller.joint_type = jit->GetString("type", "revolute", 0);
- // get a pointer to mech_robot_->joints_!
- mechanism::Robot::IndexMap::iterator mjit = mech_robot_->joints_lookup_.find(controller.joint_name);
- if (mjit == mech_robot_->joints_lookup_.end())
+ // get a pointer to mc_->joints_!
+ mechanism::Joint* j = mc_.model_.getJoint(controller.joint_name);
+
+ if (j == NULL)
{
// TODO: report: Could not find the joint named xxxx
std::cout << " join name " << controller.joint_name
<< " not found, probably an abstract joint, like a gripper joint. " << std::endl;
// FIXME: need to have a mechanism joint for controller to control!
// we can look at the finger joints below, and use one of them, or
- // create a new joint: mech_robot_->joints_.insert( new_abstract_joint );
+ // create a new joint: mc_.addJoint( new_abstract_joint );
//continue; // skip, do not add controller
//
- // artifically insert a gripper joint into mech_robot_->joints_
+ // artifically insert a gripper joint into mc_.model_.joints_
//
mechanism::Joint* joint;
joint = new mechanism::Joint();
+ // assign name of joint
+ joint->name_ = controller.joint_name;
+ //joint->name_ = new char(controller.joint_name.size());
+ //strcpy(joint->name_,controller.joint_name.c_str());
+ //std::cout << " link joint name: " << joint->name_ << std::endl;
+
+
joint->type_ = mechanism::JOINT_ROTARY;
joint->initialized_ = true; // from transmission
joint->position_ = 0; // from transmission
@@ -330,34 +344,39 @@
joint->joint_limit_max_ = 0;
joint->effort_limit_ = (jit->GetChild("gripper_defaults"))->GetDouble("effortLimit",0,0);
joint->velocity_limit_ = (jit->GetChild("gripper_defaults"))->GetDouble("velocityLimit",0,0);
- mech_robot_->joints_.push_back(joint);
- mech_robot_->joints_lookup_.insert(make_pair(controller.joint_name,(mech_robot_->joints_.size())-1));
- controller.mech_joint_ = mech_robot_->joints_.back(); // return joint we just added
+ mc_.addJoint(joint);
+ controller.mech_joint_ = mc_.model_.joints_.back(); // return joint we just added
}
else
{
- controller.mech_joint_ = mech_robot_->joints_.at(mjit->second); // we want to control this link
+ controller.mech_joint_ = j; // we want to control this link
}
- // get a pointer to reverse_mech_robot_->joints_!
- mechanism::Robot::IndexMap::iterator rmjit = reverse_mech_robot_->joints_lookup_.find(controller.joint_name);
- if (rmjit == reverse_mech_robot_->joints_lookup_.end())
+ // get a pointer to rmc_->joints_!
+ mechanism::Joint* rj = rmc_.model_.getJoint(controller.joint_name);
+ if (rj == NULL)
{
// TODO: report: Could not find the joint named xxxx
std::cout << " join name " << controller.joint_name
<< " not found, probably an abstract joint, like a gripper joint. " << std::endl;
// FIXME: need to have a mechanism joint for controller to control!
// we can look at the finger joints below, and use one of them, or
- // create a new joint: reverse_mech_robot_->joints_.insert( new_abstract_joint );
+ // create a new joint: rmc_.addJoint( new_abstract_joint );
//continue; // skip, do not add controller
//
- // artifically insert a gripper joint into reverse_mech_robot_->joints_
+ // artifically insert a gripper joint into rmc_.model_.joints_
//
mechanism::Joint* joint;
joint = new mechanism::Joint();
+ // assign name of joint
+ joint->name_ = controller.joint_name;
+ //joint->name_ = new char(controller.joint_name.size());
+ //strcpy(joint->name_,controller.joint_name.c_str());
+ //std::cout << " link joint name: " << joint->name_ << std::endl;
+
joint->type_ = mechanism::JOINT_ROTARY;
joint->initialized_ = true; // from transmission
joint->position_ = 0; // from transmission
@@ -368,13 +387,13 @@
joint->joint_limit_max_ = 0;
joint->effort_limit_ = (jit->GetChild("gripper_defaults"))->GetDouble("effortLimit",0,0);
joint->velocity_limit_ = (jit->GetChild("gripper_defaults"))->GetDouble("velocityLimit",0,0);
- reverse_mech_robot_->joints_.push_back(joint);
- reverse_mech_robot_->joints_lookup_.insert(make_pair(controller.joint_name,(reverse_mech_robot_->joints_.size())-1));
- controller.reverse_mech_joint_ = reverse_mech_robot_->joints_.back(); // return joint we just added
+ rmc_.addJoint(joint);
+
+ controller.reverse_mech_joint_ = rmc_.model_.joints_.back(); // return joint we just added
}
else
{
- controller.reverse_mech_joint_ = reverse_mech_robot_->joints_.at(rmjit->second); // we want to control this link
+ controller.reverse_mech_joint_ = rj; // we want to control this link
}
@@ -388,17 +407,20 @@
controller.init_time = Simulator::Instance()->GetSimTime();
// initialize controller
TiXmlElement junk("");
- if (controller.control_mode == "PD_CONTROL")
- {
- controller.pcontroller.initXml(mech_robot_,&junk); // just pass Robot pointer to controller. controller uses hw_ to get time
- controller.pcontroller.init(controller.p_gain,controller.i_gain,controller.d_gain,controller.windup,controller.init_time,mech_robot_, controller.mech_joint_);
- }
- else if (controller.control_mode == "VELOCITY_CONTROL")
- {
- controller.vcontroller.initXml(mech_robot_,&junk); // just pass Robot pointer to controller. controller uses hw_ to get time
- controller.vcontroller.init(controller.p_gain,controller.i_gain,controller.d_gain,controller.windup,controller.init_time,mech_robot_, controller.mech_joint_);
- }
+ mc_.spawnController(controller.control_mode,
+ controller.name,
+ controller.p_gain,controller.i_gain,controller.d_gain,controller.windup,
+ controller.init_time,
+ controller.mech_joint_);
+
+ rmc_.spawnController(controller.control_mode,
+ controller.name,
+ controller.p_gain,controller.i_gain,controller.d_gain,controller.windup,
+ controller.init_time,
+ controller.reverse_mech_joint_);
+
+ // setup gazebo joints
XMLConfigNode *dit = jit->GetChild("data");
std::string data_name = dit->GetString("name","",1);
std::string data_type = dit->GetString("type","",1);
@@ -459,130 +481,83 @@
robot_controllers_.push_back(controller);
}
+ }
+ for (XMLConfigNode *xit = node->GetChild("robot"); xit; xit=xit->GetNext("robot"))
+ {
//-----------------------------------------------------------------------------------------
//
- // TRANSMISSION XML
- //
- //-----------------------------------------------------------------------------------------
- // Reads the transmission information from the config.
- for (XMLConfigNode *tit = xit->GetChild("transmission"); tit; tit = tit->GetNext("transmission"))
- {
- //==================================================================================================
- //for forward transmission (actuator -> real robot joint)
- Robot_transmission_ trn;
- trn.name = tit->GetString("name", "", 1);
-
- trn.joint_name = tit->GetChild("joint")->GetString("name","",1);
- trn.actuator_name = tit->GetChild("actuator")->GetString("name","",1);
-
- trn.simple_transmission.mechanical_reduction_ = tit->GetDouble("mechanicalReduction",0,1);
- trn.simple_transmission.motor_torque_constant_= tit->GetDouble("motorTorqueConstant",0,1);
- trn.simple_transmission.pulses_per_revolution_= tit->GetDouble("pulsesPerRevolution",0,1);
- //trn.simple_transmission.actuator_ = ; // pointer to our actuator;
- //trn.simple_transmission.joint_ = ; // pointer to our robot joint;
- //trn.gazebo_joints_ = parent_model_->GetJoint(transmission.joint_name); // this is not necessary
- //assert(trn.gazebo_joints_ != NULL); // this is not necessary
- robot_transmissions_.push_back(trn);
- //==================================================================================================
- //for reverse transmission (actuator -> gazebo's fake robot joint copy
- Robot_transmission_ rtrn;
- rtrn.name = tit->GetString("name", "", 1);
-
- rtrn.joint_name = tit->GetChild("joint")->GetString("name","",1);
- rtrn.actuator_name = tit->GetChild("actuator")->GetString("name","",1);
-
- rtrn.simple_transmission.mechanical_reduction_ = tit->GetDouble("mechanicalReduction",0,1);
- rtrn.simple_transmission.motor_torque_constant_= tit->GetDouble("motorTorqueConstant",0,1);
- rtrn.simple_transmission.pulses_per_revolution_= tit->GetDouble("pulsesPerRevolution",0,1);
- //rtrn.simple_transmission.actuator_ = ; // pointer to our actuator;
- //rtrn.simple_transmission.joint_ = ; // pointer to our robot joint;
- //rtrn.gazebo_joints_ = parent_model_->GetJoint(transmission.joint_name); // this is not necessary
- //assert(rtrn.gazebo_joints_ != NULL); // this is not necessary
- reverse_robot_transmissions_.push_back(rtrn);
- //==================================================================================================
- std::cout << " transmission name " << trn.name
- << " joint name " << trn.joint_name
- << " actuator name " << trn.actuator_name
- << " mec red " << trn.simple_transmission.mechanical_reduction_
- << " tor con " << trn.simple_transmission.motor_torque_constant_
- << " pul rev " << trn.simple_transmission.pulses_per_revolution_ << std::endl;
- //==================================================================================================
- }
-
- //-----------------------------------------------------------------------------------------
- //
// ACTUATOR XML
//
//-----------------------------------------------------------------------------------------
// Reads the actuator information from the config.
for (XMLConfigNode *ait = xit->GetChild("actuator"); ait; ait = ait->GetNext("actuator"))
{
- Robot_actuator_ actuator;
// read from actuator_test.xml
- actuator.name = ait->GetString("name", "", 1);
- actuator.motorboardID = ait->GetString("motorboardID", "", 1);
- actuator.maxCurrent = ait->GetDouble("maxCurrent", 0, 1);
- actuator.motor = ait->GetString("motor", "", 1);
- actuator.ip = ait->GetString("ip", "", 1);
- actuator.port = ait->GetDouble("port", 0, 1);
- actuator.reduction = ait->GetDouble("reduction", 0, 1);
- actuator.polymap = ait->GetVector3("polymap",Vector3(1,0,0));
+ std::string actuator_name = ait->GetString("name", "", 1);
+ // std::string motorboardID = ait->GetString("motorboardID", "", 1);
+ // double maxCurrent = ait->GetDouble("maxCurrent", 0, 1);
+ // std::string motor = ait->GetString("motor", "", 1);
+ // std::string ip = ait->GetString("ip", "", 1);
+ // double port = ait->GetDouble("port", 0, 1);
+ // double reduction = ait->GetDouble("reduction", 0, 1);
+ // Vector3 polymap = ait->GetVector3("polymap",Vector3(1,0,0));
+ Actuator* actuator = new Actuator();
// initialize the actuator object
- actuator.actuator.state_.encoder_count_ = 0;
- actuator.actuator.state_.timestamp_ = Simulator::Instance()->GetSimTime();
- actuator.actuator.state_.is_enabled_ = true;
- actuator.actuator.command_.enable_ = true;
- actuator.actuator.command_.current_ = 0;
+ actuator->state_.encoder_count_ = 0;
+ actuator->state_.timestamp_ = Simulator::Instance()->GetSimTime();
+ actuator->state_.is_enabled_ = true;
+ actuator->command_.enable_ = true;
+ actuator->command_.current_ = 0;
- robot_actuators_.insert(make_pair(actuator.name,actuator));
-
// formal structures
- hw_->actuators_.push_back(&actuator.actuator);
- //actuator_names_.push_back(actuator.name);
+ // forward and revere mc_ share same hardware actuators
+ hw_.actuators_.push_back(actuator);
+ mc_.registerActuator(actuator_name,hw_.actuators_.size()-1);
+ rmc_.registerActuator(actuator_name,hw_.actuators_.size()-1);
- std::cout << " actuator name " << actuator.name
- << " reduction " << actuator.reduction
- << " polymap " << actuator.polymap << std::endl;
-
-
-
+ std::cout << " adding actuator name to hw_ " << actuator_name << " " << hw_.actuators_.size() << std::endl;
}
-
-
}
- //==================================================================================================
- // fetch actuator and joint pair for forward transmission
- // loop through all transmissions
- for (std::vector<Robot_transmission_>::iterator rti = robot_transmissions_.begin(); rti != robot_transmissions_.end(); rti++)
+
+ for (XMLConfigNode *xit = node->GetChild("robot"); xit; xit=xit->GetNext("robot"))
{
- // use actuator name to find actuator
- std::map<std::string,Robot_actuator_>::iterator mrai = robot_actuators_.find((*rti).actuator_name);
- assert (mrai != robot_actuators_.end()); // actuator must exist
- (*rti).simple_transmission.actuator_ = &((mrai->second).actuator); // link actuator to transmission
- // use joint name to find mech_joint_ in controller, get a pointer to mech_robot_->joints_!
- mechanism::Robot::IndexMap::iterator mjit = mech_robot_->joints_lookup_.find((*rti).joint_name);
- assert (mjit != mech_robot_->joints_lookup_.end()); // joint must exist
- (*rti).simple_transmission.joint_ = mech_robot_->joints_.at(mjit->second); // link joint to transmission
+ //-----------------------------------------------------------------------------------------
+ //
+ // TRANSMISSION XML
+ //
+ //-----------------------------------------------------------------------------------------
+ // Reads the transmission information from the config.
+ for (XMLConfigNode *tit = xit->GetChild("transmission"); tit; tit = tit->GetNext("transmission"))
+ {
+ //==================================================================================================
+ //for forward transmission (actuator -> real robot joint)
+ // FIXME: fix parsing in transmission so this is not needed
+ mechanism::SimpleTransmission st; // = new mechanism::SimpleTransmission();
+ transmissions_.push_back(st);
+ //==================================================================================================
+ transmissions_.back().name_ = tit->GetString("name", "", 1);
+ transmissions_.back().joint_name_ = tit->GetChild("joint")->GetString("name","",1);
+ transmissions_.back().actuator_name_ = tit->GetChild("actuator")->GetString("name","",1);
+ transmissions_.back().mechanical_reduction_ = tit->GetDouble("mechanicalReduction",0,1);
+ transmissions_.back().motor_torque_constant_= tit->GetDouble("motorTorqueConstant",0,1);
+ transmissions_.back().pulses_per_revolution_= tit->GetDouble("pulsesPerRevolution",0,1);
+ mc_.addSimpleTransmission(&transmissions_.back());
+ //==================================================================================================
+ //for reverse transmission (actuator -> gazebo's fake robot joint copy
+ rmc_.addSimpleTransmission(&transmissions_.back());
+ //==================================================================================================
+ std::cout << " adding transmission name " << transmissions_.back().name_
+ << " joint name " << transmissions_.back().joint_name_
+ << " actuator name " << transmissions_.back().actuator_name_
+ << " mec red " << transmissions_.back().mechanical_reduction_
+ << " tor con " << transmissions_.back().motor_torque_constant_
+ << " pul rev " << transmissions_.back().pulses_per_revolution_ << std::endl;
+ }
}
- //==================================================================================================
- for (std::vector<Robot_transmission_>::iterator rrti = reverse_robot_transmissions_.begin(); rrti != reverse_robot_transmissions_.end(); rrti++)
- {
- // use actuator name to find a...
[truncated message content] |
|
From: <is...@us...> - 2008-08-14 21:21:34
|
Revision: 3083
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=3083&view=rev
Author: isucan
Date: 2008-08-14 21:21:43 +0000 (Thu, 14 Aug 2008)
Log Message:
-----------
removed constraints, for now
Modified Paths:
--------------
pkg/trunk/robot_msgs/msg/KinematicConstraint.msg
pkg/trunk/robot_srvs/srv/KinematicMotionPlan.srv
Modified: pkg/trunk/robot_msgs/msg/KinematicConstraint.msg
===================================================================
--- pkg/trunk/robot_msgs/msg/KinematicConstraint.msg 2008-08-14 20:45:09 UTC (rev 3082)
+++ pkg/trunk/robot_msgs/msg/KinematicConstraint.msg 2008-08-14 21:21:43 UTC (rev 3083)
@@ -2,21 +2,3 @@
# Since there are multiple types of constraints, the 'type' member is used
# to identify the different constraints
-
-# Value that identifies the type of constraint
-byte type
-
-
-##########################################
-# For constraints of type 0 #
-# (position of center of a certain body) #
-##########################################
-
-# The name of the body (link) for which the constraint is defined
-string body
-
-# The position of the body
-std_msgs/Point3DFloat64 position
-
-# The tolerance for this position
-float64 tolerance
Modified: pkg/trunk/robot_srvs/srv/KinematicMotionPlan.srv
===================================================================
--- pkg/trunk/robot_srvs/srv/KinematicMotionPlan.srv 2008-08-14 20:45:09 UTC (rev 3082)
+++ pkg/trunk/robot_srvs/srv/KinematicMotionPlan.srv 2008-08-14 21:21:43 UTC (rev 3083)
@@ -25,10 +25,6 @@
robot_msgs/KinematicState goal_state
-# The constraints the motion planner should respect
-robot_msgs/KinematicConstraint[] constraints
-
-
# The maximum amount of time the motion planner is allowed to plan for
float64 allowed_time
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <hsu...@us...> - 2008-08-15 00:11:35
|
Revision: 3103
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=3103&view=rev
Author: hsujohnhsu
Date: 2008-08-15 00:11:44 +0000 (Fri, 15 Aug 2008)
Log Message:
-----------
updated to new gazebo.
ros camera get vfov function is not working in current gazebo, will find out why, non critical.
Modified Paths:
--------------
pkg/trunk/3rdparty/gazebo/Makefile
pkg/trunk/3rdparty/gazebo/gazebo_patch.diff
pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Camera.cc
Modified: pkg/trunk/3rdparty/gazebo/Makefile
===================================================================
--- pkg/trunk/3rdparty/gazebo/Makefile 2008-08-15 00:09:45 UTC (rev 3102)
+++ pkg/trunk/3rdparty/gazebo/Makefile 2008-08-15 00:11:44 UTC (rev 3103)
@@ -2,7 +2,7 @@
SVN_DIR = gazebo-svn
SVN_URL = https://playerstage.svn.sourceforge.net/svnroot/playerstage/code/gazebo/trunk
-SVN_REVISION = -r 6915 #revision with wall extrusion working, Ogre camera save frame (TP)
+SVN_REVISION = -r 6952 #more updates on geometry creation
SVN_PATCH = gazebo_patch.diff
include $(shell rospack find mk)/svn_checkout.mk
Modified: pkg/trunk/3rdparty/gazebo/gazebo_patch.diff
===================================================================
--- pkg/trunk/3rdparty/gazebo/gazebo_patch.diff 2008-08-15 00:09:45 UTC (rev 3102)
+++ pkg/trunk/3rdparty/gazebo/gazebo_patch.diff 2008-08-15 00:11:44 UTC (rev 3103)
@@ -1,6 +1,6 @@
Index: player/SConscript
===================================================================
---- player/SConscript (revision 6915)
+--- player/SConscript (revision 6952)
+++ player/SConscript (working copy)
@@ -1,7 +1,8 @@
import os
@@ -14,7 +14,7 @@
'GazeboClient.cc',
Index: libgazebo/Server.cc
===================================================================
---- libgazebo/Server.cc (revision 6915)
+--- libgazebo/Server.cc (revision 6952)
+++ libgazebo/Server.cc (working copy)
@@ -38,6 +38,7 @@
#include <sys/sem.h>
@@ -103,7 +103,7 @@
{
Index: libgazebo/Iface.cc
===================================================================
---- libgazebo/Iface.cc (revision 6915)
+--- libgazebo/Iface.cc (revision 6952)
+++ libgazebo/Iface.cc (working copy)
@@ -55,6 +55,8 @@
GZ_REGISTER_IFACE("factory", FactoryIface);
@@ -116,7 +116,7 @@
Index: libgazebo/gazebo.h
===================================================================
---- libgazebo/gazebo.h (revision 6915)
+--- libgazebo/gazebo.h (revision 6952)
+++ libgazebo/gazebo.h (working copy)
@@ -558,7 +558,7 @@
@@ -568,7 +568,7 @@
#define GAZEBO_STEREO_CAMERA_MAX_DISPARITY_SIZE 640 * 480
/// \brief Stereo data
-@@ -1392,6 +1761,9 @@
+@@ -1380,6 +1749,9 @@
/// Right depth map (float)
public: float right_depth[GAZEBO_STEREO_CAMERA_MAX_DISPARITY_SIZE];
@@ -578,7 +578,7 @@
};
-@@ -1409,6 +1781,7 @@
+@@ -1397,6 +1769,7 @@
{
Iface::Create(server,id);
this->data = (StereoCameraData*)this->mMap;
@@ -586,7 +586,7 @@
}
/// \brief Open the iface
-@@ -1416,8 +1789,16 @@
+@@ -1404,8 +1777,16 @@
{
Iface::Open(client,id);
this->data = (StereoCameraData*)this->mMap;
@@ -605,30 +605,30 @@
};
Index: server/physics/SphereGeom.cc
===================================================================
---- server/physics/SphereGeom.cc (revision 6915)
+--- server/physics/SphereGeom.cc (revision 6952)
+++ server/physics/SphereGeom.cc (working copy)
-@@ -53,11 +53,16 @@
+@@ -53,11 +53,15 @@
double radius = node->GetDouble("size",1.0,0);
// Initialize box mass matrix
- dMassSetSphereTotal(&this->mass, this->dblMass, radius);
-+ this->SetGeom(dCreateSphere(0, radius ), true);
++ this->SetGeom( dCreateSphere(0, radius ), true);
// Create the sphere geometry
-- this->SetGeom(dCreateSphere(0, radius ), true);
+- this->SetGeom( dCreateSphere(0, radius ), true);
+-
+ if (this->massMatrix)
+ dMassSetParameters(&this->mass, this->dblMass, this->cx, this->cy, this->cz,
+ this->ixx,this->iyy,this->izz,this->ixy,this->ixz,this->iyz);
+ else
+ dMassSetSphereTotal(&this->mass, this->dblMass, radius);
-
-+
++
//to be able to show physics
/* this->visualNode->AttachMesh("unit_sphere"); // unit_sphere radius=1 diameter=2
this->visualNode->SetScale(Vector3(radius, radius ,radius));
Index: server/physics/BoxGeom.cc
===================================================================
---- server/physics/BoxGeom.cc (revision 6915)
+--- server/physics/BoxGeom.cc (revision 6952)
+++ server/physics/BoxGeom.cc (working copy)
@@ -54,11 +54,18 @@
@@ -654,9 +654,9 @@
this->visualNode->SetMaterial("Gazebo/GreenEmissive");
Index: server/physics/Geom.hh
===================================================================
---- server/physics/Geom.hh (revision 6915)
+--- server/physics/Geom.hh (revision 6952)
+++ server/physics/Geom.hh (working copy)
-@@ -170,6 +170,10 @@
+@@ -164,6 +164,10 @@
/// Mass as a double
protected: double dblMass;
@@ -669,7 +669,7 @@
Index: server/physics/HingeJoint.hh
===================================================================
---- server/physics/HingeJoint.hh (revision 6915)
+--- server/physics/HingeJoint.hh (revision 6952)
+++ server/physics/HingeJoint.hh (working copy)
@@ -117,6 +117,8 @@
@@ -682,7 +682,7 @@
Index: server/physics/CylinderGeom.cc
===================================================================
---- server/physics/CylinderGeom.cc (revision 6915)
+--- server/physics/CylinderGeom.cc (revision 6952)
+++ server/physics/CylinderGeom.cc (working copy)
@@ -50,10 +50,17 @@
double radius = node->GetTupleDouble("size",0,1.0);
@@ -706,7 +706,7 @@
/*this->visualNode->AttachMesh("unit_cylinder");
Index: server/physics/Geom.cc
===================================================================
---- server/physics/Geom.cc (revision 6915)
+--- server/physics/Geom.cc (revision 6952)
+++ server/physics/Geom.cc (working copy)
@@ -102,6 +102,21 @@
this->dblMass = 0.001;
@@ -730,7 +730,7 @@
this->contact->Load(node);
this->LoadChild(node);
-@@ -403,18 +418,21 @@
+@@ -372,18 +387,21 @@
if (!this->placeable)
return NULL;
@@ -756,7 +756,7 @@
dMassRotate(&this->bodyMass, r);
Index: server/physics/HingeJoint.cc
===================================================================
---- server/physics/HingeJoint.cc (revision 6915)
+--- server/physics/HingeJoint.cc (revision 6952)
+++ server/physics/HingeJoint.cc (working copy)
@@ -38,6 +38,7 @@
: Joint()
@@ -785,16 +785,14 @@
Index: server/physics/ode/ODEPhysics.cc
===================================================================
---- server/physics/ode/ODEPhysics.cc (revision 6915)
+--- server/physics/ode/ODEPhysics.cc (revision 6952)
+++ server/physics/ode/ODEPhysics.cc (working copy)
-@@ -259,24 +259,28 @@
+@@ -259,18 +259,18 @@
double h, kp, kd;
contact.geom = contactGeoms[i];
-- contact.surface.mode = dContactSoftERP | dContactSoftCFM |
-- dContactBounce | dContactMu2;
-+ //contact.surface.mode = dContactSoftERP | dContactSoftCFM |
-+ // dContactBounce | dContactMu2;
+- contact.surface.mode = dContactSoftERP | dContactBounce | dContactMu2;
++ //contact.surface.mode = dContactSoftERP | dContactBounce | dContactMu2;
+ contact.surface.mode = 0;
@@ -804,27 +802,17 @@
- kp = 1 / (1 / geom1->contact->kp + 1 / geom2->contact->kp);
+ kp = 1.0 / (1.0 / geom1->contact->kp + 1.0 / geom2->contact->kp);
kd = geom1->contact->kd + geom2->contact->kd;
-+ //std::cout << " =-======================= " << geom1->contact->kp
-+ // << " =-======================= " << geom2->contact->kp << std::endl;
contact.surface.soft_erp = h * kp / (h * kp + kd);
- contact.surface.soft_cfm = 1 / (h * kp + kd);
+ contact.surface.soft_cfm = 1.0 / (h * kp + kd);
-
+-
contact.surface.mu = MIN(geom1->contact->mu1, geom2->contact->mu1);
-- contact.surface.mu2 = MIN(geom1->contact->mu2, geom2->contact->mu2);
-+ //contact.surface.mu2 = MIN(geom1->contact->mu2, geom2->contact->mu2);
-+ contact.surface.mu2 = 0.0;
+ contact.surface.mu2 = MIN(geom1->contact->mu2, geom2->contact->mu2);
contact.surface.bounce = 0.1;
- contact.surface.bounce_vel = 0.1;
-- contact.surface.soft_cfm = 0.01;
-+ //contact.surface.soft_cfm = 0.01;
-
- dJointID c = dJointCreateContact (self->worldId,
- self->contactGroup, &contact);
Index: server/physics/TrimeshGeom.cc
===================================================================
---- server/physics/TrimeshGeom.cc (revision 6915)
+--- server/physics/TrimeshGeom.cc (revision 6952)
+++ server/physics/TrimeshGeom.cc (working copy)
@@ -208,7 +208,11 @@
@@ -841,7 +829,7 @@
this->SetGeom(this->geomId, true);
Index: server/physics/SliderJoint.cc
===================================================================
---- server/physics/SliderJoint.cc (revision 6915)
+--- server/physics/SliderJoint.cc (revision 6952)
+++ server/physics/SliderJoint.cc (working copy)
@@ -35,6 +35,8 @@
: Joint()
@@ -854,7 +842,7 @@
Index: server/sensors/Sensor.hh
===================================================================
---- server/sensors/Sensor.hh (revision 6915)
+--- server/sensors/Sensor.hh (revision 6952)
+++ server/sensors/Sensor.hh (working copy)
@@ -63,6 +63,7 @@
@@ -882,7 +870,7 @@
#endif
Index: server/sensors/camera/MonoCameraSensor.cc
===================================================================
---- server/sensors/camera/MonoCameraSensor.cc (revision 6915)
+--- server/sensors/camera/MonoCameraSensor.cc (revision 6952)
+++ server/sensors/camera/MonoCameraSensor.cc (working copy)
@@ -49,6 +49,7 @@
MonoCameraSensor::MonoCameraSensor(Body *body)
@@ -973,7 +961,7 @@
////////////////////////////////////////////////////////////////////////////////
Index: server/sensors/camera/StereoCameraSensor.cc
===================================================================
---- server/sensors/camera/StereoCameraSensor.cc (revision 6915)
+--- server/sensors/camera/StereoCameraSensor.cc (revision 6952)
+++ server/sensors/camera/StereoCameraSensor.cc (working copy)
@@ -58,6 +58,7 @@
this->depthBuffer[1] = NULL;
@@ -1138,7 +1126,7 @@
////////////////////////////////////////////////////////////////////////////////
Index: server/sensors/ray/RaySensor.cc
===================================================================
---- server/sensors/ray/RaySensor.cc (revision 6915)
+--- server/sensors/ray/RaySensor.cc (revision 6952)
+++ server/sensors/ray/RaySensor.cc (working copy)
@@ -237,7 +237,7 @@
// Update the sensor information
@@ -1151,7 +1139,7 @@
Pose3d poseDelta;
Index: server/sensors/Sensor.cc
===================================================================
---- server/sensors/Sensor.cc (revision 6915)
+--- server/sensors/Sensor.cc (revision 6952)
+++ server/sensors/Sensor.cc (working copy)
@@ -32,6 +32,7 @@
#include "World.hh"
@@ -1204,17 +1192,17 @@
+
Index: server/Simulator.cc
===================================================================
---- server/Simulator.cc (revision 6915)
+--- server/Simulator.cc (revision 6952)
+++ server/Simulator.cc (working copy)
-@@ -71,6 +71,7 @@
- physicsEnabled(true),
- timeout(-1)
+@@ -72,6 +72,7 @@
+ timeout(-1),
+ selectedEntity(NULL)
{
+ selectedEntity = NULL;
}
////////////////////////////////////////////////////////////////////////////////
-@@ -253,6 +254,9 @@
+@@ -254,6 +255,9 @@
{
currTime = this->GetRealTime();
@@ -1224,7 +1212,7 @@
if (physicsUpdateRate == 0 ||
currTime - this->prevPhysicsTime >= physicsUpdatePeriod)
{
-@@ -277,6 +281,9 @@
+@@ -278,6 +282,9 @@
this->prevPhysicsTime = this->GetRealTime();
}
@@ -1236,7 +1224,7 @@
currTime - this->prevRenderTime >= renderUpdatePeriod)
Index: server/rendering/UserCamera.hh
===================================================================
---- server/rendering/UserCamera.hh (revision 6915)
+--- server/rendering/UserCamera.hh (revision 6952)
+++ server/rendering/UserCamera.hh (working copy)
@@ -52,7 +52,7 @@
public: void Load( XMLConfigNode *node );
@@ -1269,7 +1257,7 @@
Index: server/rendering/UserCamera.cc
===================================================================
---- server/rendering/UserCamera.cc (revision 6915)
+--- server/rendering/UserCamera.cc (revision 6952)
+++ server/rendering/UserCamera.cc (working copy)
@@ -25,6 +25,7 @@
*/
@@ -1432,7 +1420,7 @@
+}
Index: server/GazeboConfig.cc
===================================================================
---- server/GazeboConfig.cc (revision 6915)
+--- server/GazeboConfig.cc (revision 6952)
+++ server/GazeboConfig.cc (working copy)
@@ -56,6 +56,17 @@
@@ -1454,7 +1442,7 @@
XMLConfig rc;
Index: server/gui/GLWindow.hh
===================================================================
---- server/gui/GLWindow.hh (revision 6915)
+--- server/gui/GLWindow.hh (revision 6952)
+++ server/gui/GLWindow.hh (working copy)
@@ -63,6 +63,9 @@
/// \brief Initalize the gui
@@ -1468,7 +1456,7 @@
Index: server/gui/GLFrame.cc
===================================================================
---- server/gui/GLFrame.cc (revision 6915)
+--- server/gui/GLFrame.cc (revision 6952)
+++ server/gui/GLFrame.cc (working copy)
@@ -107,7 +107,7 @@
// Load the frame
@@ -1481,7 +1469,7 @@
this->startPose.pos = node->GetVector3("xyz", Vector3(0,0,0));
Index: server/gui/GLWindow.cc
===================================================================
---- server/gui/GLWindow.cc (revision 6915)
+--- server/gui/GLWindow.cc (revision 6952)
+++ server/gui/GLWindow.cc (working copy)
@@ -68,11 +68,17 @@
this->directionVec.x = 0;
@@ -1590,7 +1578,7 @@
this->moveAmount *= 2;
Index: server/World.hh
===================================================================
---- server/World.hh (revision 6915)
+--- server/World.hh (revision 6952)
+++ server/World.hh (working copy)
@@ -91,6 +91,26 @@
/// \return Pointer to the physics engine
@@ -1631,7 +1619,7 @@
};
Index: server/controllers/camera/generic/Generic_Camera.cc
===================================================================
---- server/controllers/camera/generic/Generic_Camera.cc (revision 6915)
+--- server/controllers/camera/generic/Generic_Camera.cc (revision 6952)
+++ server/controllers/camera/generic/Generic_Camera.cc (working copy)
@@ -79,7 +79,24 @@
// Update the controller
@@ -1661,7 +1649,7 @@
////////////////////////////////////////////////////////////////////////////////
Index: server/controllers/Controller.cc
===================================================================
---- server/controllers/Controller.cc (revision 6915)
+--- server/controllers/Controller.cc (revision 6952)
+++ server/controllers/Controller.cc (working copy)
@@ -67,8 +67,12 @@
@@ -1680,7 +1668,7 @@
Index: server/World.cc
===================================================================
---- server/World.cc (revision 6915)
+--- server/World.cc (revision 6952)
+++ server/World.cc (working copy)
@@ -27,6 +27,7 @@
#include <assert.h>
@@ -1700,7 +1688,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-@@ -152,6 +156,7 @@
+@@ -167,6 +171,7 @@
this->physicsEngine->Init();
@@ -1708,7 +1696,7 @@
this->toAddModels.clear();
this->toDeleteModels.clear();
-@@ -165,6 +170,11 @@
+@@ -180,6 +185,11 @@
std::vector< Model* >::iterator miter;
std::vector< Model* >::iterator miter2;
@@ -1720,7 +1708,7 @@
// Update all the models
for (miter=this->models.begin(); miter!=this->models.end(); miter++)
{
-@@ -174,14 +184,27 @@
+@@ -189,14 +199,27 @@
}
}
@@ -1748,7 +1736,7 @@
// Copy the newly created models into the main model vector
std::copy(this->toAddModels.begin(), this->toAddModels.end(),
std::back_inserter(this->models));
-@@ -199,6 +222,9 @@
+@@ -214,6 +237,9 @@
this->toDeleteModels.clear();
@@ -1758,7 +1746,7 @@
return 0;
}
-@@ -246,6 +272,41 @@
+@@ -268,6 +294,41 @@
return this->physicsEngine;
}
@@ -1802,7 +1790,7 @@
int World::LoadEntities(XMLConfigNode *node, Model *parent)
Index: SConstruct
===================================================================
---- SConstruct (revision 6915)
+--- SConstruct (revision 6952)
+++ SConstruct (working copy)
@@ -22,8 +22,11 @@
# 3rd party packages
Modified: pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Camera.cc
===================================================================
--- pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Camera.cc 2008-08-15 00:09:45 UTC (rev 3102)
+++ pkg/trunk/drivers/simulator/gazebo_plugin/src/Ros_Camera.cc 2008-08-15 00:11:44 UTC (rev 3103)
@@ -148,7 +148,7 @@
// GetFOV() returns radians
data->hfov = this->myParent->GetHFOV();
- data->vfov = this->myParent->GetVFOV();
+ //data->vfov = this->myParent->GetVFOV(); //FIXME: breaks in gazebo
// Set the pose of the camera
cameraPose = this->myParent->GetWorldPose();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mm...@us...> - 2008-08-15 01:33:09
|
Revision: 3116
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=3116&view=rev
Author: mmwise
Date: 2008-08-15 01:33:18 +0000 (Fri, 15 Aug 2008)
Log Message:
-----------
cleaning up init mess
Modified Paths:
--------------
pkg/trunk/controllers/pr2_controllers/include/pr2_controllers/laser_scanner_controller.h
pkg/trunk/controllers/pr2_controllers/src/laser_scanner_controller.cpp
pkg/trunk/hardware_test/motors/xml/WG_3021.xml
pkg/trunk/mechanism/mechanism_control/include/mechanism_control/mechanism_control.h
pkg/trunk/mechanism/mechanism_control/manifest.xml
pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp
pkg/trunk/mechanism/mechanism_model/src/simple_transmission.cpp
Modified: pkg/trunk/controllers/pr2_controllers/include/pr2_controllers/laser_scanner_controller.h
===================================================================
--- pkg/trunk/controllers/pr2_controllers/include/pr2_controllers/laser_scanner_controller.h 2008-08-15 01:16:40 UTC (rev 3115)
+++ pkg/trunk/controllers/pr2_controllers/include/pr2_controllers/laser_scanner_controller.h 2008-08-15 01:33:18 UTC (rev 3116)
@@ -70,7 +70,7 @@
* \brief Functional way to initialize limits and gains.
*
*/
- void init(double p_gain, double i_gain, double d_gain, double windup, double time, mechanism::Robot *robot, mechanism::Joint *joint);
+ void init(double p_gain, double i_gain, double d_gain, double windup, double time, std::string name, mechanism::Robot *robot);
void initXml(mechanism::Robot *robot, TiXmlElement *config);
/*!
@@ -88,7 +88,7 @@
/*!
* \brief Read the torque of the motor
*/
- double getActual();
+ double getMeasuredState();
/*!
* \brief Issues commands to the joint. Should be called at regular intervals
Modified: pkg/trunk/controllers/pr2_controllers/src/laser_scanner_controller.cpp
===================================================================
--- pkg/trunk/controllers/pr2_controllers/src/laser_scanner_controller.cpp 2008-08-15 01:16:40 UTC (rev 3115)
+++ pkg/trunk/controllers/pr2_controllers/src/laser_scanner_controller.cpp 2008-08-15 01:33:18 UTC (rev 3116)
@@ -43,9 +43,11 @@
LaserScannerController::LaserScannerController()
{
- // Initialize PID class
+ robot_ = NULL;
+ joint_ = NULL;
+
command_ = 0;
-
+ last_time_ = 0;
profile_index_ = 0;
profile_length_ = 0;
@@ -63,27 +65,27 @@
}
-void LaserScannerController::init(double p_gain, double i_gain, double d_gain, double windup, double time, mechanism::Robot *robot, mechanism::Joint *joint)
+void LaserScannerController::init(double p_gain, double i_gain, double d_gain, double windup, double time, std::string name, mechanism::Robot *robot)
{
- joint_position_controller_.init( p_gain, i_gain, d_gain, windup, time, robot, joint);
robot_ = robot;
+ joint_ = robot->getJoint(name);
+
+ joint_position_controller_.init( p_gain, i_gain, d_gain, windup, time, name, robot);
command_= 0;
last_time_= time;
- joint_ = joint;
}
void LaserScannerController::initXml(mechanism::Robot *robot, TiXmlElement *config)
{
-
-
TiXmlElement *elt = config->FirstChildElement("joint");
- if (elt) {
+ if (elt)
+ {
// TODO: error check if xml attributes/elements are missing
double p_gain = atof(elt->FirstChildElement("pGain")->GetText());
double i_gain = atof(elt->FirstChildElement("iGain")->GetText());
double d_gain = atof(elt->FirstChildElement("dGain")->GetText());
double windup= atof(elt->FirstChildElement("windup")->GetText());
- init(p_gain, i_gain, d_gain, windup, robot->hw_->current_time_, robot, robot->getJoint(elt->Attribute("name")));
+ init(p_gain, i_gain, d_gain, windup, robot->hw_->current_time_,elt->Attribute("name"), robot);
}
}
@@ -101,7 +103,7 @@
}
// Return the measured joint position
-double LaserScannerController::getActual()
+double LaserScannerController::getMeasuredState()
{
return joint_->position_;
}
Modified: pkg/trunk/hardware_test/motors/xml/WG_3021.xml
===================================================================
--- pkg/trunk/hardware_test/motors/xml/WG_3021.xml 2008-08-15 01:16:40 UTC (rev 3115)
+++ pkg/trunk/hardware_test/motors/xml/WG_3021.xml 2008-08-15 01:33:18 UTC (rev 3116)
@@ -18,12 +18,11 @@
<pulsesPerRevolution>1200</pulsesPerRevolution>
</transmission>
- <controller name="test_controller" type="JointVelocityControllerNode">
+ <controller name="test_controller" type="RampInputController">
<joint name="test_joint">
- <pGain>0.0006</pGain>
- <iGain>0.01</iGain>
- <dGain>0</dGain>
- <windup>0.007</windup>
+ <start>0.0</start>
+ <end>0.1</end>
+ <duration>4</duration>
</joint>
</controller>
Modified: pkg/trunk/mechanism/mechanism_control/include/mechanism_control/mechanism_control.h
===================================================================
--- pkg/trunk/mechanism/mechanism_control/include/mechanism_control/mechanism_control.h 2008-08-15 01:16:40 UTC (rev 3115)
+++ pkg/trunk/mechanism/mechanism_control/include/mechanism_control/mechanism_control.h 2008-08-15 01:33:18 UTC (rev 3116)
@@ -75,10 +75,6 @@
bool addController(controller::Controller *c, const std::string &name);
bool spawnController(const std::string &type, const std::string &name, TiXmlElement *config);
bool killController(const std::string &name);
- bool spawnController(const std::string &type,
- const std::string &name,
- double p_gain, double i_gain, double d_gain, double windup,
- double time, mechanism::Joint *joint);
bool addJoint(mechanism::Joint* j);
bool addSimpleTransmission(mechanism::SimpleTransmission *st);
controller::Controller* getControllerByName(std::string name);
Modified: pkg/trunk/mechanism/mechanism_control/manifest.xml
===================================================================
--- pkg/trunk/mechanism/mechanism_control/manifest.xml 2008-08-15 01:16:40 UTC (rev 3115)
+++ pkg/trunk/mechanism/mechanism_control/manifest.xml 2008-08-15 01:33:18 UTC (rev 3116)
@@ -10,6 +10,7 @@
<depend package="tinyxml"/>
<depend package="mechanism_model"/>
<depend package="generic_controllers"/>
+<depend package="pr2_controllers"/>
<depend package="misc_utils" />
<depend package="rospy" />
<export>
Modified: pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp
===================================================================
--- pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp 2008-08-15 01:16:40 UTC (rev 3115)
+++ pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp 2008-08-15 01:33:18 UTC (rev 3116)
@@ -203,26 +203,7 @@
return true;
}
-bool MechanismControl::spawnController(const std::string &type,
- const std::string &name,
- double p_gain, double i_gain, double d_gain, double windup,
- double time, mechanism::Joint *joint)
-{
- controller::Controller *c = controller::ControllerFactory::instance().create(type);
- if (c == NULL)
- return false;
- //c->init(p_gain,i_gain,d_gain,windup,time,&model_,joint);
- if (!addController(c, name))
- {
- delete c;
- return false;
- }
-
- return true;
-}
-
-
bool MechanismControl::spawnController(const std::string &type,
const std::string &name,
TiXmlElement *config)
@@ -230,6 +211,7 @@
controller::Controller *c = controller::ControllerFactory::instance().create(type);
if (c == NULL)
return false;
+ printf("Spawning %s: %08x\n", name.c_str(), &model_);
c->initXml(&model_, config);
if (!addController(c, name))
Modified: pkg/trunk/mechanism/mechanism_model/src/simple_transmission.cpp
===================================================================
--- pkg/trunk/mechanism/mechanism_model/src/simple_transmission.cpp 2008-08-15 01:16:40 UTC (rev 3115)
+++ pkg/trunk/mechanism/mechanism_model/src/simple_transmission.cpp 2008-08-15 01:33:18 UTC (rev 3116)
@@ -76,6 +76,7 @@
joint_->position_ = ((double)actuator_->state_.encoder_count_*2*M_PI)/(pulses_per_revolution_ * mechanical_reduction_);
joint_->velocity_ = ((double)actuator_->state_.encoder_velocity_*2*M_PI)/(pulses_per_revolution_ * mechanical_reduction_);
joint_->applied_effort_ = actuator_->state_.last_measured_current_ * (motor_torque_constant_ * mechanical_reduction_);
+
}
void SimpleTransmission::propagatePositionBackwards()
@@ -89,9 +90,11 @@
{
actuator_->command_.current_ = joint_->commanded_effort_/(motor_torque_constant_ * mechanical_reduction_);
actuator_->command_.enable_ = true;
+
}
void SimpleTransmission::propagateEffortBackwards()
{
joint_->commanded_effort_ = actuator_->command_.current_ * motor_torque_constant_ * mechanical_reduction_;
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <adv...@us...> - 2008-08-15 18:39:20
|
Revision: 3125
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=3125&view=rev
Author: advaitjain
Date: 2008-08-15 18:39:28 +0000 (Fri, 15 Aug 2008)
Log Message:
-----------
documentation and licenses.
Modified Paths:
--------------
pkg/trunk/deprecated/libKDL/src/kdl_kinematics.cpp
pkg/trunk/deprecated/libKDL/test/dynamics.cpp
pkg/trunk/deprecated/libKDL/test/pr2_kin_test.cpp
pkg/trunk/manip/overhead_grasp_behavior/manifest.xml
pkg/trunk/manip/overhead_grasp_behavior/src/overhead_grasp.cc
pkg/trunk/manip/pr2_kinematic_controllers/manifest.xml
pkg/trunk/manip/pr2_kinematic_controllers/src/pr2_kinematic_controllers.cc
pkg/trunk/manip/pr2_kinematic_controllers/test/test_pr2_kin_con.cc
pkg/trunk/manip/teleop_arm_keyboard/teleop_arm_keyboard.cc
Removed Paths:
-------------
pkg/trunk/deprecated/libKDL/doc/
Modified: pkg/trunk/deprecated/libKDL/src/kdl_kinematics.cpp
===================================================================
--- pkg/trunk/deprecated/libKDL/src/kdl_kinematics.cpp 2008-08-15 18:14:39 UTC (rev 3124)
+++ pkg/trunk/deprecated/libKDL/src/kdl_kinematics.cpp 2008-08-15 18:39:28 UTC (rev 3125)
@@ -1,4 +1,47 @@
+/*
+ * 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: Advait Jain
+
+/**
+
+ @mainpage
+
+ @htmlinclude manifest.html
+
+ @b libKDL has been @b deprecated by @b robot_kinematics. It served as a wrapper around KDL to make it easier to use FK and IK.
+
+ **/
+
+
+
+
#include "libKDL/kdl_kinematics.h"
using namespace KDL;
Modified: pkg/trunk/deprecated/libKDL/test/dynamics.cpp
===================================================================
--- pkg/trunk/deprecated/libKDL/test/dynamics.cpp 2008-08-15 18:14:39 UTC (rev 3124)
+++ pkg/trunk/deprecated/libKDL/test/dynamics.cpp 2008-08-15 18:39:28 UTC (rev 3125)
@@ -1,5 +1,35 @@
+/*
+ * 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: Advait Jain
+
#include "libKDL/kdl_kinematics.h"
#include "libKDL/dynamics.h"
Modified: pkg/trunk/deprecated/libKDL/test/pr2_kin_test.cpp
===================================================================
--- pkg/trunk/deprecated/libKDL/test/pr2_kin_test.cpp 2008-08-15 18:14:39 UTC (rev 3124)
+++ pkg/trunk/deprecated/libKDL/test/pr2_kin_test.cpp 2008-08-15 18:39:28 UTC (rev 3125)
@@ -1,4 +1,35 @@
+/*
+ * 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: Advait Jain
+
+
#include "libKDL/kdl_kinematics.h"
#include <sys/time.h>
Modified: pkg/trunk/manip/overhead_grasp_behavior/manifest.xml
===================================================================
--- pkg/trunk/manip/overhead_grasp_behavior/manifest.xml 2008-08-15 18:14:39 UTC (rev 3124)
+++ pkg/trunk/manip/overhead_grasp_behavior/manifest.xml 2008-08-15 18:39:28 UTC (rev 3125)
@@ -3,7 +3,6 @@
</description>
<author>Advait Jain</author>
<license>BSD</license>
-<url>http://pr.willowgarage.com</url>
<depend package="roscpp"/>
<depend package="std_msgs"/>
<depend package="pr2Core"/>
Modified: pkg/trunk/manip/overhead_grasp_behavior/src/overhead_grasp.cc
===================================================================
--- pkg/trunk/manip/overhead_grasp_behavior/src/overhead_grasp.cc 2008-08-15 18:14:39 UTC (rev 3124)
+++ pkg/trunk/manip/overhead_grasp_behavior/src/overhead_grasp.cc 2008-08-15 18:39:28 UTC (rev 3125)
@@ -1,3 +1,86 @@
+/*
+ * 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.
+ */
+
+
+/**
+
+ @mainpage
+
+ @htmlinclude manifest.html
+
+ @b overhead_grasp_behavior is the state machine that can be used to step the PR2 through the different states such as position_camera_above_object, segment_object, grasp_from_above etc. This is the object grasping behavior that we use at the Healthcare Robotics Lab at Georgia Tech. More documentation at the wiki page on Behavior Based Grasping.
+
+ <hr>
+
+ @section usage Usage
+ @verbatim
+ The correct pr2 model files for gazebo need to be generated. Follow step-by-step instructions on the wiki.
+ @endverbatim
+
+ <hr>
+
+ @section topic ROS topics
+
+ Subscribes to (name/type):
+ - @b "object_position" / @b std_msgs::Point3DFloat32 : 3d Pose of the object. This is the cheat laser pointer interface.
+ - @b "rightarm_tooltip_cartesian" / @b pr2_msgs::EndEffectorState : current cartesian pose of the end effector.
+
+ Publishes to (name/type):
+ - @b "right_pr2arm_set_end_effector" / @b pr2_msgs::EndEffectorState : desired end effector pose for the right arm. Should be a service.
+ - @b "interpolate_step_size" / @b std_msgs::Float64 : step size for interpolation. (pr2_kinematic_controllers)
+ - @b "interpolate_wait_time" / @b std_msgs::Float64 : wait time for interpolation. (pr2_kinematic_controllers)
+
+ <hr>
+
+ @section parameters ROS parameters
+
+ - None
+
+ <hr>
+
+ @section services ROS services
+
+ Advertises (name/type):
+
+ - None
+
+ Calls (name/type):
+
+ - @b "hrl_grasp" / @b gmmseg::hrl_grasp : tell node gmmseg to segment the image, get back x,y,theta of the object in camera coordiante frame.
+ - @b "operate_right_gripper" / @b rosgazebo::GripperCmd : set gap and force for the gripper.
+ - @b "move_along_gripper" / @b pr2_kinematic_controllers::Float64Int32 : reaching motion.
+
+
+ **/
+
+// Author: Advait Jain
+
#include <termios.h>
#include <signal.h>
#include <math.h>
@@ -23,181 +106,154 @@
class OverheadGrasper : public ros::node
{
- public:
- // coordinates of arm's origin in gazebo/arm coordinate frame (the axes of both frames are parallel)
- Vector gazebo_to_arm_vector;
- std_msgs::Point3DFloat32 objectPosMsg;
+ public:
+ // coordinates of arm's origin in gazebo/arm coordinate frame (the axes of both frames are parallel)
+ Vector gazebo_to_arm_vector;
+ std_msgs::Point3DFloat32 objectPosMsg;
pr2_msgs::EndEffectorState rightEndEffectorMsg;
- Frame right_tooltip_frame;
- Vector objectPosition;
- const static double PR2_GRIPPER_LENGTH = 0.16;
- Vector CAMERA_ENDEFFECTOR; // position of camera relative to end effector in end effector frame.
+ Frame right_tooltip_frame;
+ Vector objectPosition;
+ const static double PR2_GRIPPER_LENGTH = 0.16;
+ Vector CAMERA_ENDEFFECTOR; // position of camera relative to end effector in end effector frame.
- public:
- OverheadGrasper(void) : ros::node("overhead_grasper")
- {
- advertise<std_msgs::PR2Arm>("cmd_rightarmconfig");
- advertise<pr2_msgs::EndEffectorState>("right_pr2arm_set_end_effector"); // this should actually be a service.
- advertise<std_msgs::Float64>("interpolate_step_size");
- advertise<std_msgs::Float64>("interpolate_wait_time");
- subscribe("object_position", objectPosMsg, &OverheadGrasper::objectPosition_cb);
- subscribe("rightarm_tooltip_cartesian", rightEndEffectorMsg, &OverheadGrasper::currentRightArmPosCartesian_cb);
+ public:
+ OverheadGrasper(void) : ros::node("overhead_grasper")
+ {
+ advertise<pr2_msgs::EndEffectorState>("right_pr2arm_set_end_effector"); // this should actually be a service.
+ advertise<std_msgs::Float64>("interpolate_step_size");
+ advertise<std_msgs::Float64>("interpolate_wait_time");
+ subscribe("object_position", objectPosMsg, &OverheadGrasper::objectPosition_cb);
+ subscribe("rightarm_tooltip_cartesian", rightEndEffectorMsg, &OverheadGrasper::currentRightArmPosCartesian_cb);
-// gazebo_to_arm_vector = Vector(1.020-0.7987,-0.15,0.8269);
- gazebo_to_arm_vector = Vector(0.81-0.82025,-0.20,0.739675);
+// gazebo_to_arm_vector = Vector(1.020-0.7987,-0.15,0.8269);
+ gazebo_to_arm_vector = Vector(0.81-0.82025,-0.20,0.739675);
- CAMERA_ENDEFFECTOR = Vector(0.0, 0.,0.05); // position of camera relative to end effector in base frame.
- }
+ CAMERA_ENDEFFECTOR = Vector(0.0, 0.,0.05); // position of camera relative to end effector in base frame.
+ }
- void KDL_to_EndEffectorStateMsg(const Frame& f, pr2_msgs::EndEffectorState &efs)
- {
- efs.set_rot_size(9);
- efs.set_trans_size(3);
- for(int i = 0; i < 9; i++)
- efs.rot[i] = f.M.data[i];
- for(int i = 0; i < 3; i++)
- efs.trans[i] = f.p.data[i];
- }
+ void KDL_to_EndEffectorStateMsg(const Frame& f, pr2_msgs::EndEffectorState &efs)
+ {
+ efs.set_rot_size(9);
+ efs.set_trans_size(3);
+ for(int i = 0; i < 9; i++)
+ efs.rot[i] = f.M.data[i];
+ for(int i = 0; i < 3; i++)
+ efs.trans[i] = f.p.data[i];
+ }
- void EndEffectorStateMsg_to_KDL(const pr2_msgs::EndEffectorState &efs, Frame& f)
- {
- for(int i = 0; i < 9; i++)
- f.M.data[i] = efs.rot[i];
- for(int i = 0; i < 3; i++)
- f.p.data[i] = efs.trans[i];
- }
+ void EndEffectorStateMsg_to_KDL(const pr2_msgs::EndEffectorState &efs, Frame& f)
+ {
+ for(int i = 0; i < 9; i++)
+ f.M.data[i] = efs.rot[i];
+ for(int i = 0; i < 3; i++)
+ f.p.data[i] = efs.trans[i];
+ }
- void positionArmCartesian(const Vector& v, const Rotation& r)
- {
- pr2_msgs::EndEffectorState efs;
- Frame f(r,v);
- KDL_to_EndEffectorStateMsg(f,efs);
+ void positionArmCartesian(const Vector& v, const Rotation& r)
+ {
+ pr2_msgs::EndEffectorState efs;
+ Frame f(r,v);
+ KDL_to_EndEffectorStateMsg(f,efs);
- publish("right_pr2arm_set_end_effector",efs);
- }
+ publish("right_pr2arm_set_end_effector",efs);
+ }
- void overheadGraspPosture()
- {
- std_msgs::PR2Arm rightarm;
-// rightarm.turretAngle = deg2rad*0;
-// rightarm.shoulderLiftAngle = deg2rad*0;
-// rightarm.upperarmRollAngle = deg2rad*0;
-// rightarm.elbowAngle = deg2rad*0;
-// rightarm.forearmRollAngle = 0;
-// rightarm.wristPitchAngle = deg2rad*90;
-// rightarm.wristRollAngle = 0;
-// rightarm.gripperForceCmd = 50;
-// rightarm.gripperGapCmd = 0.;
+ // Vector v is shoulder coordinate frame.
+// void positionEyecamOverObject(Vector v)
+ void positionEyecamOverObject()
+ {
+ Vector v_arm = objectPosition;
+ v_arm.data[2] += 0.3; // I want end effector to be 0.4m above object.
+ Rotation r = Rotation::RotY(deg2rad*90) * Rotation::RotY(deg2rad*90); // look down vertically
+ cout<<"Going to: "<<v_arm<<endl;
+ positionArmCartesian(v_arm, r);
+ }
- rightarm.turretAngle = deg2rad*-20;
- rightarm.shoulderLiftAngle = deg2rad*-20;
- rightarm.upperarmRollAngle = deg2rad*180;
- rightarm.elbowAngle = deg2rad*-30;
- rightarm.forearmRollAngle = 0;
- rightarm.wristPitchAngle = 0;
- rightarm.wristRollAngle = 0;
- rightarm.gripperForceCmd = 50;
- rightarm.gripperGapCmd = 0.;
+ void moveArmSegmentation()
+ {
+ gmmseg::hrl_grasp::request req;
+ gmmseg::hrl_grasp::response res;
+ req.height = right_tooltip_frame.p[2] - objectPosition[2] - CAMERA_ENDEFFECTOR[0];
+ if (ros::service::call("hrl_grasp", req, res)==false)
+ {
+ printf("[overhead_grasp_behavior] <overhead_grasp.cpp> {segmentObject} hrl_grasp service failed.\nExiting..\n");
+ exit(0);
+ }
+ Vector move(-1*res.y, -1*res.x, 0);
+ cout<<"move: "<<move<<"\n";
- publish("cmd_rightarmconfig",rightarm);
- }
+ move += Rotation::RotY(deg2rad*90)*CAMERA_ENDEFFECTOR;
- // Vector v is shoulder coordinate frame.
-// void positionEyecamOverObject(Vector v)
- void positionEyecamOverObject()
- {
- Vector v_arm = objectPosition;
- v_arm.data[2] += 0.3; // I want end effector to be 0.4m above object.
- Rotation r = Rotation::RotY(deg2rad*90) * Rotation::RotY(deg2rad*90); // look down vertically
- cout<<"Going to: "<<v_arm<<endl;
- positionArmCartesian(v_arm, r);
- }
+ if (res.theta>0)
+ res.theta = deg2rad*90-res.theta;
+ else
+ res.theta = -1*(res.theta+deg2rad*90);
- void moveArmSegmentation()
- {
- gmmseg::hrl_grasp::request req;
- gmmseg::hrl_grasp::response res;
- req.height = right_tooltip_frame.p[2] - objectPosition[2] - CAMERA_ENDEFFECTOR[0];
- if (ros::service::call("hrl_grasp", req, res)==false)
- {
- printf("[overhead_grasp_behavior] <overhead_grasp.cpp> {segmentObject} hrl_grasp service failed.\nExiting..\n");
- exit(0);
- }
- Vector move(-1*res.y, -1*res.x, 0);
- cout<<"move: "<<move<<"\n";
+ Rotation r = Rotation::RotY(deg2rad*90)*Rotation::RotY(deg2rad*90)*Rotation::RotZ(res.theta); // look down vertically, with correct wrist roll
+ Vector goto_point = right_tooltip_frame.p+move;
+ cout<<"Going to: "<<goto_point<<endl;
+ positionArmCartesian(goto_point, r);
+ }
- move += Rotation::RotY(deg2rad*90)*CAMERA_ENDEFFECTOR;
+ void objectPosition_cb(void)
+ {
+// cout<<"object's z coord: "<<objectPosMsg.z<<"\n";
+ objectPosition = Vector(objectPosMsg.x,objectPosMsg.y,objectPosMsg.z) - gazebo_to_arm_vector;
+ }
- if (res.theta>0)
- res.theta = deg2rad*90-res.theta;
- else
- res.theta = -1*(res.theta+deg2rad*90);
+ void currentRightArmPosCartesian_cb(void)
+ {
+ EndEffectorStateMsg_to_KDL(this->rightEndEffectorMsg, this->right_tooltip_frame);
+ }
- Rotation r = Rotation::RotY(deg2rad*90)*Rotation::RotY(deg2rad*90)*Rotation::RotZ(res.theta); // look down vertically, with correct wrist roll
- Vector goto_point = right_tooltip_frame.p+move;
- cout<<"Going to: "<<goto_point<<endl;
- positionArmCartesian(goto_point, r);
- }
+ void OpenGripper(void)
+ {
+ rosgazebo::GripperCmd::request req;
+ rosgazebo::GripperCmd::response res;
+ req.gap=0.3;
+ req.force=50;
+ if (ros::service::call("operate_right_gripper", req, res)==false)
+ {
+ printf("[overhead_grasp_behavior] <overhead_grasp.cpp> {OpenGripper} operate_right_gripper service failed.\nExiting..\n");
+ exit(0);
+ }
+ }
- void objectPosition_cb(void)
- {
-// cout<<"object's z coord: "<<objectPosMsg.z<<"\n";
- objectPosition = Vector(objectPosMsg.x,objectPosMsg.y,objectPosMsg.z) - gazebo_to_arm_vector;
- }
+ void CloseGripper(void)
+ {
+ rosgazebo::GripperCmd::request req;
+ rosgazebo::GripperCmd::response res;
+ req.gap=0.0;
+ req.force=200;
+ if (ros::service::call("operate_right_gripper", req, res)==false)
+ {
+ printf("[overhead_grasp_behavior] <overhead_grasp.cpp> {CloseGripper} operate_right_gripper service failed.\nExiting..\n");
+ exit(0);
+ }
+ }
- void currentRightArmPosCartesian_cb(void)
- {
- EndEffectorStateMsg_to_KDL(this->rightEndEffectorMsg, this->right_tooltip_frame);
- }
+ void pickUpObject(void)
+ {
+ pr2_kinematic_controllers::Float64Int32::request req;
+ pr2_kinematic_controllers::Float64Int32::response res;
+ req.f = -1*PR2_GRIPPER_LENGTH;
+ ros::service::call("move_along_gripper", req, res);
+ }
- void OpenGripper(void)
- {
- rosgazebo::GripperCmd::request req;
- rosgazebo::GripperCmd::response res;
- req.gap=0.3;
- req.force=50;
- if (ros::service::call("operate_right_gripper", req, res)==false)
- {
- printf("[overhead_grasp_behavior] <overhead_grasp.cpp> {OpenGripper} operate_right_gripper service failed.\nExiting..\n");
- exit(0);
- }
- }
+ void printTooltipTransformation(void)
+ {
+ cout<<"End effector transformation: "<<this->right_tooltip_frame<<"\n";
+ }
- void CloseGripper(void)
- {
- rosgazebo::GripperCmd::request req;
- rosgazebo::GripperCmd::response res;
- req.gap=0.0;
- req.force=200;
- if (ros::service::call("operate_right_gripper", req, res)==false)
- {
- printf("[overhead_grasp_behavior] <overhead_grasp.cpp> {CloseGripper} operate_right_gripper service failed.\nExiting..\n");
- exit(0);
- }
- }
-
- void pickUpObject(void)
- {
- pr2_kinematic_controllers::Float64Int32::request req;
- pr2_kinematic_controllers::Float64Int32::response res;
- req.f = -1*PR2_GRIPPER_LENGTH;
- ros::service::call("move_along_gripper", req, res);
- }
-
- void printTooltipTransformation(void)
- {
- cout<<"End effector transformation: "<<this->right_tooltip_frame<<"\n";
- }
-
- void graspFromAbove(void)
- {
- pr2_kinematic_controllers::Float64Int32::request req;
- pr2_kinematic_controllers::Float64Int32::response res;
- printf("arm tip z: %.4f\nobjectPosition.z: %.4f\n", right_tooltip_frame.p.data[2],objectPosition.data[2]);
- req.f = right_tooltip_frame.p.data[2] - objectPosition.data[2] - PR2_GRIPPER_LENGTH;
- printf("amount to move by: %.4f\n", req.f);
- ros::service::call("move_along_gripper", req, res);
- }
+ void graspFromAbove(void)
+ {
+ pr2_kinematic_controllers::Float64Int32::request req;
+ pr2_kinematic_controllers::Float64Int32::response res;
+ printf("arm tip z: %.4f\nobjectPosition.z: %.4f\n", right_tooltip_frame.p.data[2],objectPosition.data[2]);
+ req.f = right_tooltip_frame.p.data[2] - objectPosition.data[2] - PR2_GRIPPER_LENGTH;
+ printf("amount to move by: %.4f\n", req.f);
+ ros::service::call("move_along_gripper", req, res);
+ }
};
@@ -207,29 +263,29 @@
int main(int argc, char **argv)
{
- ros::init(argc, argv);
- OverheadGrasper ohGrasper;
+ ros::init(argc, argv);
+ OverheadGrasper ohGrasper;
- std_msgs::Float64 float64_msg;
- sleep(1);
+ std_msgs::Float64 float64_msg;
+ sleep(1);
- double interpolate_step_size = 0.01;
- float64_msg.data = interpolate_step_size;
- ohGrasper.publish("interpolate_step_size", float64_msg);
-
- double interpolate_wait_time = .3;
- float64_msg.data = interpolate_wait_time;
- ohGrasper.publish("interpolate_wait_time", float64_msg);
+ double interpolate_step_size = 0.01;
+ float64_msg.data = interpolate_step_size;
+ ohGrasper.publish("interpolate_step_size", float64_msg);
+
+ double interpolate_wait_time = .3;
+ float64_msg.data = interpolate_wait_time;
+ ohGrasper.publish("interpolate_wait_time", float64_msg);
//---- now for the keyboard driven state machine ------
- while(1)
- {
+ while(1)
+ {
signal(SIGINT,quit);
- keyboardLoop(ohGrasper);
- }
+ keyboardLoop(ohGrasper);
+ }
- return 0;
+ return 0;
}
@@ -240,85 +296,82 @@
void quit(int sig)
{
- ros::fini();
- tcsetattr(kfd, TCSANOW, &cooked);
- exit(0);
+ ros::fini();
+ tcsetattr(kfd, TCSANOW, &cooked);
+ exit(0);
}
void keyboardLoop(OverheadGrasper &n)
{
- char c;
+ char c;
- // get the console in raw mode
- tcgetattr(kfd, &cooked);
- memcpy(&raw, &cooked, sizeof(struct termios));
- raw.c_lflag &=~ (ICANON | ECHO);
- raw.c_cc[VEOL] = 1;
- raw.c_cc[VEOF] = 2;
- tcsetattr(kfd, TCSANOW, &raw);
+ // get the console in raw mode
+ tcgetattr(kfd, &cooked);
+ memcpy(&raw, &cooked, sizeof(struct termios));
+ raw.c_lflag &=~ (ICANON | ECHO);
+ raw.c_cc[VEOL] = 1;
+ raw.c_cc[VEOF] = 2;
+ tcsetattr(kfd, TCSANOW, &raw);
- puts("Reading from keyboard");
- puts("---------------------------");
- printf("Numbers starting from 1 to step through the states\n");
- puts("---------------------------");
+ puts("Reading from keyboard");
+ puts("---------------------------");
+ printf("Numbers starting from 1 to step through the states\n");
+ puts("---------------------------");
- for(;;)
- {
- // get the next event from the keyboard
- if(read(kfd, &c, 1) < 0)
- {
- perror("read():");
- exit(-1);
- }
+ for(;;)
+ {
+ // get the next event from the keyboard
+ if(read(kfd, &c, 1) < 0)
+ {
+ perror("read():");
+ exit(-1);
+ }
- switch(c)
- {
- case '1':
- n.overheadGraspPosture();
- break;
- case '2':
- {
- n.positionEyecamOverObject();
- }
- break;
- case '3':
- n.graspFromAbove();
- break;
- case '4':
- n.pickUpObject();
- break;
+ switch(c)
+ {
+ case '2':
+ {
+ n.positionEyecamOverObject();
+ }
+ break;
+ case '3':
+ n.graspFromAbove();
+ break;
+ case '4':
+ n.pickUpObject();
+ break;
- case 't':
- n.moveArmSegmentation();
- break;
+ case 't':
+ n.moveArmSegmentation();
+ break;
- case 'e':
- n.printTooltipTransformation();
- break;
+ case 'e':
+ n.printTooltipTransformation();
+ break;
- case 's':
- {
- pr2_kinematic_controllers::Float64Int32::request req;
- pr2_kinematic_controllers::Float64Int32::response res;
- req.f=0.01;
- ros::service::call("move_along_gripper", req, res);
- }
+ case 's':
+ {
+ pr2_kinematic_controllers::Float64Int32::request req;
+ pr2_kinematic_controllers::Float64Int32::response res;
+ req.f=0.01;
+ ros::service::call("move_along_gripper", req, res);
+ }
- // printf("x: %.4f y: %.4f z: %.4f\n", n.objectPosMsg.x, n.objectPosMsg.y, n.objectPosMsg.z);
- break;
- case 'o':
- case 'O':
- n.OpenGripper();
- break;
- case 'c':
- case 'C':
- n.CloseGripper();
- break;
- default:
- break;
- }
- }
+ // printf("x: %.4f y: %.4f z: %.4f\n", n.objectPosMsg.x, n.objectPosMsg.y, n.objectPosMsg.z);
+ break;
+ case 'o':
+ case 'O':
+ n.OpenGripper();
+ break;
+ case 'c':
+ case 'C':
+ n.CloseGripper();
+ break;
+ default:
+ break;
+ }
+ }
}
Modified: pkg/trunk/manip/pr2_kinematic_controllers/manifest.xml
===================================================================
--- pkg/trunk/manip/pr2_kinematic_controllers/manifest.xml 2008-08-15 18:14:39 UTC (rev 3124)
+++ pkg/trunk/manip/pr2_kinematic_controllers/manifest.xml 2008-08-15 18:39:28 UTC (rev 3125)
@@ -1,15 +1,13 @@
<package>
- <description brief='Higher level controllers for kinematics. Sourced from interpolated_kinematic_controller'>
+ <description> Higher level controllers for kinematics. Sourced from interpolated_kinematic_controller.
</description>
<author>Advait Jain</author>
<license>BSD</license>
- <url>http://pr.willowgarage.com</url>
<depend package="roscpp"/>
<depend package="std_msgs"/>
<depend package="pr2_msgs"/>
<depend package="pr2Core"/>
<depend package="libpr2API"/>
- <!-- <depend package="libKDL"/> -->
<depend package="robot_kinematics"/>
<depend package="pr2_gazebo"/>
<export>
Modified: pkg/trunk/manip/pr2_kinematic_controllers/src/pr2_kinematic_controllers.cc
===================================================================
--- pkg/trunk/manip/pr2_kinematic_controllers/src/pr2_kinematic_controllers.cc 2008-08-15 18:14:39 UTC (rev 3124)
+++ pkg/trunk/manip/pr2_kinematic_controllers/src/pr2_kinematic_controllers.cc 2008-08-15 18:39:28 UTC (rev 3125)
@@ -1,3 +1,86 @@
+/*
+ * 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 C...
[truncated message content] |
|
From: <is...@us...> - 2008-08-17 18:14:04
|
Revision: 3186
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=3186&view=rev
Author: isucan
Date: 2008-08-17 18:14:13 +0000 (Sun, 17 Aug 2008)
Log Message:
-----------
parameters update
Modified Paths:
--------------
pkg/trunk/motion_planning/plan_kinematic_path/src/plan_kinematic_path.cpp
pkg/trunk/robot_msgs/msg/NamedKinematicPath.msg
pkg/trunk/world_models/world_3d_map/run.xml
Modified: pkg/trunk/motion_planning/plan_kinematic_path/src/plan_kinematic_path.cpp
===================================================================
--- pkg/trunk/motion_planning/plan_kinematic_path/src/plan_kinematic_path.cpp 2008-08-16 19:34:29 UTC (rev 3185)
+++ pkg/trunk/motion_planning/plan_kinematic_path/src/plan_kinematic_path.cpp 2008-08-17 18:14:13 UTC (rev 3186)
@@ -64,7 +64,7 @@
req.threshold = 0.01;
req.distance_metric = "L2Square";
- req.start_state.set_vals_size(50);
+ req.start_state.set_vals_size(45);
for (unsigned int i = 0 ; i < req.start_state.vals_size ; ++i)
req.start_state.vals[i] = 0.0;
@@ -74,7 +74,7 @@
req.goal_state.vals[i] = m_basePos[i];
req.start_state.vals[i] = m_basePos[i];
}
- req.goal_state.vals[0] += 2.5;
+ req.goal_state.vals[0] += 3.5;
req.allowed_time = 5.0;
@@ -160,8 +160,8 @@
while (!plan.haveBasePos())
dur.sleep();
- plan.runTestLeftArm();
- // plan.runTestBase();
+ // plan.runTestLeftArm();
+ plan.runTestBase();
plan.shutdown();
Modified: pkg/trunk/robot_msgs/msg/NamedKinematicPath.msg
===================================================================
--- pkg/trunk/robot_msgs/msg/NamedKinematicPath.msg 2008-08-16 19:34:29 UTC (rev 3185)
+++ pkg/trunk/robot_msgs/msg/NamedKinematicPath.msg 2008-08-17 18:14:13 UTC (rev 3186)
@@ -1,5 +1,5 @@
# The definition of a kinematic path that has a name
# The name identifies the part of the robot the path is for
-
+# This is useful in displaying paths
string name
KinematicPath path
Modified: pkg/trunk/world_models/world_3d_map/run.xml
===================================================================
--- pkg/trunk/world_models/world_3d_map/run.xml 2008-08-16 19:34:29 UTC (rev 3185)
+++ pkg/trunk/world_models/world_3d_map/run.xml 2008-08-17 18:14:13 UTC (rev 3186)
@@ -3,7 +3,7 @@
<param name="world_3d_map/max_publish_frequency" type="double" value="0.3" /> <!-- Hz -->
<param name="world_3d_map/retain_pointcloud_duration" type="double" value="60.0" /> <!-- seconds -->
<param name="world_3d_map/retain_pointcloud_fraction" type="double" value="0.05" /> <!-- percentage (between 0 and 1) -->
- <param name="world_3d_map/retain_above_ground_threshold" type="double" value="-100.0" /> <!-- double value -->
+ <param name="world_3d_map/retain_above_ground_threshold" type="double" value="0.02" /> <!-- double value -->
<param name="world_3d_map/verbosity_level" type="int" value="1" /> <!-- integer value -->
<node pkg="world_3d_map" type="world_3d_map" args="robotdesc/pr2 scan:=tilt_scan" output="screen" respawn="false" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <is...@us...> - 2008-08-17 21:40:03
|
Revision: 3187
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=3187&view=rev
Author: isucan
Date: 2008-08-17 21:40:10 +0000 (Sun, 17 Aug 2008)
Log Message:
-----------
planning_node_util no longer inherits from ROS nodes
Modified Paths:
--------------
pkg/trunk/motion_planning/kinematic_planning/src/kinematic_planning.cpp
pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/cnode.h
pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/knode.h
pkg/trunk/motion_planning/planning_world_viewer/src/planning_world_viewer.cpp
pkg/trunk/world_models/world_3d_map/src/world_3d_map.cpp
Modified: pkg/trunk/motion_planning/kinematic_planning/src/kinematic_planning.cpp
===================================================================
--- pkg/trunk/motion_planning/kinematic_planning/src/kinematic_planning.cpp 2008-08-17 18:14:13 UTC (rev 3186)
+++ pkg/trunk/motion_planning/kinematic_planning/src/kinematic_planning.cpp 2008-08-17 21:40:10 UTC (rev 3187)
@@ -61,6 +61,10 @@
Subscribes to (name/type):
- None
+Additional subscriptions due to inheritance from NodeODECollisionModel:
+- @b localizedpose/RobotBase2DOdom : localized position of the robot base
+- @b world_3d_map/PointCloudFloat32 : point cloud with data describing the 3D environment
+
Publishes to (name/type):
- None
@@ -94,11 +98,13 @@
#include <sstream>
#include <map>
-class KinematicPlanning : public planning_node_util::NodeWithODECollisionModel
+class KinematicPlanning : public ros::node,
+ public planning_node_util::NodeODECollisionModel
{
public:
- KinematicPlanning(const std::string &robot_model) : planning_node_util::NodeWithODECollisionModel(robot_model, "kinematic_planning")
+ KinematicPlanning(const std::string &robot_model) : ros::node("kinematic_planning"),
+ planning_node_util::NodeODECollisionModel(dynamic_cast<ros::node*>(this), robot_model)
{
advertise_service("plan_kinematic_path", &KinematicPlanning::plan);
}
@@ -224,7 +230,7 @@
virtual void setRobotDescription(robot_desc::URDF *file)
{
- planning_node_util::NodeWithODECollisionModel::setRobotDescription(file);
+ planning_node_util::NodeODECollisionModel::setRobotDescription(file);
defaultPosition();
/* set the data for the model */
Modified: pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/cnode.h
===================================================================
--- pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/cnode.h 2008-08-17 18:14:13 UTC (rev 3186)
+++ pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/cnode.h 2008-08-17 21:40:10 UTC (rev 3187)
@@ -38,8 +38,8 @@
@htmlinclude ../../manifest.html
-@b NodeWithODECollisionModel is a ROS node that in addition to being aware of a robot model,
-is also aware of an ODE collision space
+@b NodeODECollisionModel is a class which in addition to being aware of a robot model,
+is also aware of an ODE collision space.
<hr>
@@ -48,6 +48,9 @@
Subscribes to (name/type):
- @b world_3d_map/PointCloudFloat32 : point cloud with data describing the 3D environment
+Additional subscriptions due to inheritance from NodeRobotModel:
+- @b localizedpose/RobotBase2DOdom : localized position of the robot base
+
Publishes to (name/type):
- None
@@ -75,21 +78,21 @@
namespace planning_node_util
{
- class NodeWithODECollisionModel : public NodeWithRobotModel
+ class NodeODECollisionModel : public NodeRobotModel
{
public:
- NodeWithODECollisionModel(const std::string &robot_model, const std::string &name, uint32_t options = 0) : NodeWithRobotModel(robot_model, name, options)
+ NodeODECollisionModel(ros::node *node, const std::string &robot_model) : NodeRobotModel(node, robot_model)
{
m_collisionSpace = new collision_space::EnvironmentModelODE();
m_collisionSpace->setSelfCollision(false);
m_sphereSize = 0.03;
- subscribe("world_3d_map", m_worldCloud, &NodeWithODECollisionModel::worldMapCallback);
+ m_node->subscribe("world_3d_map", m_worldCloud, &NodeODECollisionModel::worldMapCallback, this);
}
- virtual ~NodeWithODECollisionModel(void)
+ virtual ~NodeODECollisionModel(void)
{
if (m_collisionSpace)
{
@@ -100,7 +103,7 @@
virtual void setRobotDescription(robot_desc::URDF *file)
{
- NodeWithRobotModel::setRobotDescription(file);
+ NodeRobotModel::setRobotDescription(file);
if (m_kmodel)
{
m_collisionSpace->lock();
@@ -111,7 +114,7 @@
virtual void defaultPosition(void)
{
- NodeWithRobotModel::defaultPosition();
+ NodeRobotModel::defaultPosition();
if (m_collisionSpace && m_collisionSpace->getModelCount() == 1)
m_collisionSpace->updateRobotModel(0);
}
Modified: pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/knode.h
===================================================================
--- pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/knode.h 2008-08-17 18:14:13 UTC (rev 3186)
+++ pkg/trunk/motion_planning/planning_node_util/include/planning_node_util/knode.h 2008-08-17 21:40:10 UTC (rev 3187)
@@ -38,7 +38,8 @@
@htmlinclude ../../manifest.html
-@b NodeWithRobotModel is a ROS node that is also aware of a given robot model
+@b NodeRobotModel is a class that is also of a given robot model and
+uses a ROS node to retrieve the necessary data.
<hr>
@@ -77,23 +78,23 @@
namespace planning_node_util
{
- class NodeWithRobotModel : public ros::node
+ class NodeRobotModel
{
public:
- NodeWithRobotModel(const std::string &robot_model, const std::string &name, uint32_t options = 0) : ros::node(name, options),
- m_tf(*this, true, 1 * 1000000000ULL, 1000000000ULL)
+ NodeRobotModel(ros::node *node, const std::string &robot_model) : m_tf(*node, true, 1 * 1000000000ULL, 1000000000ULL)
{
m_urdf = NULL;
m_kmodel = NULL;
+ m_node = node;
m_basePos[0] = m_basePos[1] = m_basePos[2] = 0.0;
m_robotModelName = robot_model;
- subscribe("localizedpose", m_localizedPose, &NodeWithRobotModel::localizedPoseCallback);
+ m_node->subscribe("localizedpose", m_localizedPose, &NodeRobotModel::localizedPoseCallback, this);
}
- virtual ~NodeWithRobotModel(void)
+ virtual ~NodeRobotModel(void)
{
if (m_urdf)
delete m_urdf;
@@ -137,7 +138,7 @@
if (!m_robotModelName.empty() && m_robotModelName != "-")
{
std::string content;
- if (get_param(m_robotModelName, content))
+ if (m_node->get_param(m_robotModelName, content))
setRobotDescriptionFromData(content.c_str());
else
fprintf(stderr, "Robot model '%s' not found!\n", m_robotModelName.c_str());
@@ -208,6 +209,7 @@
}
rosTFClient m_tf;
+ ros::node *m_node;
std_msgs::RobotBase2DOdom m_localizedPose;
robot_desc::URDF *m_urdf;
planning_models::KinematicModel *m_kmodel;
Modified: pkg/trunk/motion_planning/planning_world_viewer/src/planning_world_viewer.cpp
===================================================================
--- pkg/trunk/motion_planning/planning_world_viewer/src/planning_world_viewer.cpp 2008-08-17 18:14:13 UTC (rev 3186)
+++ pkg/trunk/motion_planning/planning_world_viewer/src/planning_world_viewer.cpp 2008-08-17 21:40:10 UTC (rev 3187)
@@ -61,6 +61,10 @@
Subscribes to (name/type):
- None
+Additional subscriptions due to inheritance from NodeODECollisionModel:
+- @b localizedpose/RobotBase2DOdom : localized position of the robot base
+- @b world_3d_map/PointCloudFloat32 : point cloud with data describing the 3D environment
+
Publishes to (name/type):
- None
@@ -91,11 +95,13 @@
#include <sstream>
#include <map>
-class PlanningWorldViewer : public planning_node_util::NodeWithODECollisionModel
+class PlanningWorldViewer : public ros::node,
+ public planning_node_util::NodeODECollisionModel
{
public:
- PlanningWorldViewer(const std::string &robot_model) : planning_node_util::NodeWithODECollisionModel(robot_model, "planning_world_viewer")
+ PlanningWorldViewer(const std::string &robot_model) : ros::node("planning_world_viewer"),
+ planning_node_util::NodeODECollisionModel(dynamic_cast<ros::node*>(this), robot_model)
{
subscribe("display_kinematic_path", m_displayPath, &PlanningWorldViewer::displayPathCallback);
@@ -126,7 +132,7 @@
void baseUpdate(void)
{
- planning_node_util::NodeWithODECollisionModel::baseUpdate();
+ planning_node_util::NodeODECollisionModel::baseUpdate();
if (m_collisionSpace && m_collisionSpace->getModelCount() == 1 && m_follow)
{
@@ -145,7 +151,7 @@
virtual void beforeWorldUpdate(void)
{
- planning_node_util::NodeWithODECollisionModel::beforeWorldUpdate();
+ planning_node_util::NodeODECollisionModel::beforeWorldUpdate();
m_displayLock.lock();
m_spaces.clear();
m_displayLock.unlock();
@@ -153,7 +159,7 @@
virtual void afterWorldUpdate(void)
{
- planning_node_util::NodeWithODECollisionModel::afterWorldUpdate();
+ planning_node_util::NodeODECollisionModel::afterWorldUpdate();
updateODESpaces();
}
@@ -175,7 +181,7 @@
virtual void setRobotDescription(robot_desc::URDF *file)
{
- planning_node_util::NodeWithODECollisionModel::setRobotDescription(file);
+ planning_node_util::NodeODECollisionModel::setRobotDescription(file);
defaultPosition();
}
Modified: pkg/trunk/world_models/world_3d_map/src/world_3d_map.cpp
===================================================================
--- pkg/trunk/world_models/world_3d_map/src/world_3d_map.cpp 2008-08-17 18:14:13 UTC (rev 3186)
+++ pkg/trunk/world_models/world_3d_map/src/world_3d_map.cpp 2008-08-17 21:40:10 UTC (rev 3187)
@@ -74,6 +74,9 @@
Subscribes to (name/type):
- @b scan/LaserScan : scan data received from a laser
+Additional subscriptions due to inheritance from NodeRobotModel:
+- @b localizedpose/RobotBase2DOdom : localized position of the robot base
+
Publishes to (name/type):
- @b "world_3d_map"/PointCloudFloat32 : point cloud describing the 3D environment
- @b "roserr"/Log : output log messages
@@ -110,11 +113,13 @@
#include <deque>
#include <cmath>
-class World3DMap : public planning_node_util::NodeWithRobotModel
+class World3DMap : public ros::node,
+ public planning_node_util::NodeRobotModel
{
public:
-
- World3DMap(const std::string &robot_model) : planning_node_util::NodeWithRobotModel(robot_model, "world_3d_map")
+
+ World3DMap(const std::string &robot_model) : ros::node("world_3d_map"),
+ planning_node_util::NodeRobotModel(dynamic_cast<ros::node*>(this), robot_model)
{
advertise<std_msgs::PointCloudFloat32>("world_3d_map");
advertise<rostools::Log>("roserr");
@@ -157,7 +162,7 @@
virtual void setRobotDescription(robot_desc::URDF *file)
{
- planning_node_util::NodeWithRobotModel::setRobotDescription(file);
+ planning_node_util::NodeRobotModel::setRobotDescription(file);
addSelfSeeBodies();
}
@@ -171,7 +176,7 @@
void baseUpdate(void)
{
- planning_node_util::NodeWithRobotModel::baseUpdate();
+ planning_node_util::NodeRobotModel::baseUpdate();
if (m_kmodel)
{
int group = m_kmodel->getGroupID(m_urdf->getRobotName() + "::base");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <is...@us...> - 2008-08-17 22:22:24
|
Revision: 3189
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=3189&view=rev
Author: isucan
Date: 2008-08-17 22:22:33 +0000 (Sun, 17 Aug 2008)
Log Message:
-----------
renamed services for motion planning
Modified Paths:
--------------
pkg/trunk/motion_planning/issue_kinematic_plan/src/issue_kinematic_plan.cpp
pkg/trunk/motion_planning/kinematic_planning/src/kinematic_planning.cpp
pkg/trunk/motion_planning/plan_kinematic_path/src/plan_kinematic_path.cpp
pkg/trunk/robot_msgs/msg/KinematicConstraint.msg
Added Paths:
-----------
pkg/trunk/robot_srvs/srv/KinematicPlanLinkPosition.srv
pkg/trunk/robot_srvs/srv/KinematicPlanState.srv
Removed Paths:
-------------
pkg/trunk/robot_srvs/srv/KinematicMotionPlan.srv
Modified: pkg/trunk/motion_planning/issue_kinematic_plan/src/issue_kinematic_plan.cpp
===================================================================
--- pkg/trunk/motion_planning/issue_kinematic_plan/src/issue_kinematic_plan.cpp 2008-08-17 21:40:45 UTC (rev 3188)
+++ pkg/trunk/motion_planning/issue_kinematic_plan/src/issue_kinematic_plan.cpp 2008-08-17 22:22:33 UTC (rev 3189)
@@ -36,7 +36,7 @@
#include <std_msgs/PR2Arm.h>
#include <pr2_msgs/MoveArmGoal.h>
#include <pr2_msgs/MoveArmState.h>
-#include <robot_srvs/KinematicMotionPlan.h>
+#include <robot_srvs/KinematicPlanState.h>
static const double L1_JOINT_DIFF_MAX = .01;
static const double L1_GRIP_FORCE_DIFF_MAX = .01;
@@ -197,7 +197,7 @@
void moveLeftArm() {
- robot_srvs::KinematicMotionPlan::request req;
+ robot_srvs::KinematicPlanState::request req;
req.model_id = "pr2::leftArm";
req.threshold = 10e-06;
@@ -286,7 +286,7 @@
void moveRightArm() {
- robot_srvs::KinematicMotionPlan::request req;
+ robot_srvs::KinematicPlanState::request req;
req.model_id = "pr2::rightArm";
req.threshold = 10e-04;
@@ -385,7 +385,7 @@
private:
- void setStateGoalFromPlan(unsigned int state_num, const robot_srvs::KinematicMotionPlan::response& res,
+ void setStateGoalFromPlan(unsigned int state_num, const robot_srvs::KinematicPlanState::response& res,
std_msgs::PR2Arm& arm_com) {
if(state_num >= res.path.get_states_size()) {
printf("SetStateGoalFromPlan:: trying to set state greater than number of states in path.\n");
@@ -411,8 +411,8 @@
private:
- robot_srvs::KinematicMotionPlan::response left_plan_res_;
- robot_srvs::KinematicMotionPlan::response right_plan_res_;
+ robot_srvs::KinematicPlanState::response left_plan_res_;
+ robot_srvs::KinematicPlanState::response right_plan_res_;
std_msgs::PR2Arm left_arm_command_;
std_msgs::PR2Arm right_arm_command_;
Modified: pkg/trunk/motion_planning/kinematic_planning/src/kinematic_planning.cpp
===================================================================
--- pkg/trunk/motion_planning/kinematic_planning/src/kinematic_planning.cpp 2008-08-17 21:40:45 UTC (rev 3188)
+++ pkg/trunk/motion_planning/kinematic_planning/src/kinematic_planning.cpp 2008-08-17 22:22:33 UTC (rev 3189)
@@ -86,7 +86,8 @@
**/
#include <planning_node_util/cnode.h>
-#include <robot_srvs/KinematicMotionPlan.h>
+#include <robot_srvs/KinematicPlanState.h>
+#include <robot_srvs/KinematicPlanLinkPosition.h>
#include <ompl/extension/samplingbased/kinematic/extension/rrt/LazyRRT.h>
#include <ompl/extension/samplingbased/kinematic/extension/rrt/RRT.h>
@@ -115,7 +116,7 @@
delete i->second;
}
- bool plan(robot_srvs::KinematicMotionPlan::request &req, robot_srvs::KinematicMotionPlan::response &res)
+ bool plan(robot_srvs::KinematicPlanState::request &req, robot_srvs::KinematicPlanState::response &res)
{
if (m_models.find(req.model_id) == m_models.end())
{
Modified: pkg/trunk/motion_planning/plan_kinematic_path/src/plan_kinematic_path.cpp
===================================================================
--- pkg/trunk/motion_planning/plan_kinematic_path/src/plan_kinematic_path.cpp 2008-08-17 21:40:45 UTC (rev 3188)
+++ pkg/trunk/motion_planning/plan_kinematic_path/src/plan_kinematic_path.cpp 2008-08-17 22:22:33 UTC (rev 3189)
@@ -34,7 +34,7 @@
#include <ros/node.h>
#include <ros/time.h>
-#include <robot_srvs/KinematicMotionPlan.h>
+#include <robot_srvs/KinematicPlanState.h>
#include <robot_msgs/NamedKinematicPath.h>
#include <std_msgs/RobotBase2DOdom.h>
@@ -58,7 +58,7 @@
void runTestBase(void)
{
- robot_srvs::KinematicMotionPlan::request req;
+ robot_srvs::KinematicPlanState::request req;
req.model_id = "pr2::base";
req.threshold = 0.01;
@@ -87,7 +87,7 @@
void runTestLeftArm(void)
{
- robot_srvs::KinematicMotionPlan::request req;
+ robot_srvs::KinematicPlanState::request req;
req.model_id = "pr2::leftArm";
req.threshold = 0.01;
@@ -109,9 +109,9 @@
performCall(req);
}
- void performCall(robot_srvs::KinematicMotionPlan::request &req)
+ void performCall(robot_srvs::KinematicPlanState::request &req)
{
- robot_srvs::KinematicMotionPlan::response res;
+ robot_srvs::KinematicPlanState::response res;
robot_msgs::NamedKinematicPath dpath;
if (ros::service::call("plan_kinematic_path", req, res))
Modified: pkg/trunk/robot_msgs/msg/KinematicConstraint.msg
===================================================================
--- pkg/trunk/robot_msgs/msg/KinematicConstraint.msg 2008-08-17 21:40:45 UTC (rev 3188)
+++ pkg/trunk/robot_msgs/msg/KinematicConstraint.msg 2008-08-17 22:22:33 UTC (rev 3189)
@@ -2,3 +2,19 @@
# Since there are multiple types of constraints, the 'type' member is used
# to identify the different constraints
+# 0 = complete pose is considered
+# 1 = only pose position is considered
+# 2 = only pose orientation is considered
+byte type
+
+# The robot link this constraint refers to
+string robot_link
+
+# The desired pose of the robot link
+std_msgs/Pose3DFloat64 pose
+
+# the allowed difference (euclidian distance) for position
+float64 position_distance
+
+# the allowed difference (shortest angular distance) for orientation
+float64 orientation_distance
Deleted: pkg/trunk/robot_srvs/srv/KinematicMotionPlan.srv
===================================================================
--- pkg/trunk/robot_srvs/srv/KinematicMotionPlan.srv 2008-08-17 21:40:45 UTC (rev 3188)
+++ pkg/trunk/robot_srvs/srv/KinematicMotionPlan.srv 2008-08-17 22:22:33 UTC (rev 3189)
@@ -1,64 +0,0 @@
-# This message contains the definition for a request to the motion
-# planner
-
-
-
-# The model (defined in pr2.xml as a group) for which the motion
-# planner should plan for
-string model_id
-
-
-# The starting state for the robot. This is eth complete state of the
-# robot, all joint values, everything that needs to be specified to
-# completely define where each part of the robot is in space. The
-# meaning for each element in the state vector can be extracted from
-# viewing the output of the robot model construction (the kinematic
-# model constructed from the parsed URDF model) in verbose mode
-robot_msgs/KinematicState start_state
-
-
-# The goal state for the model to plan for. The dimension of this
-# state must be equal to the dimension of the state space
-# characterizing the model (group) to plan for. If this state has
-# dimension 0, it is assumed that the first state that satisfies the
-# constraints is correct
-robot_msgs/KinematicState goal_state
-
-
-# The maximum amount of time the motion planner is allowed to plan for
-float64 allowed_time
-
-
-# A string that identifies which distance metric the planner should use
-string distance_metric
-
-
-# The threshold (distance) that is allowed between the returned
-# solution and the actual goal
-float64 threshold
-
-
-# Lower coordinate for a box defining the volume in the workspace the
-# motion planner is active in. If planning in 2D, only first 2 values
-# (x, y) of the points are used.
-std_msgs/Point3DFloat64 volumeMin
-
-
-# Higher coordinate for the box described above
-std_msgs/Point3DFloat64 volumeMax
-
----
-
-# The result of a motion plan: a kinematic path. If the motion plan is
-# not succesful, this path has 0 states. If the motion plan is
-# succesful, this path contains the minimum number of states (but it
-# includes start and goal states) to define the motions for the
-# robot. If more intermediate states are needed, linear interpolation
-# is to be assumed.
-robot_msgs/KinematicPath path
-
-
-# The threshold that was actually achieved. If the planner did not have enough time,
-# it may return a distance larger than the desired threshold. The user may choose to
-# discard the path
-float64 distance
Added: pkg/trunk/robot_srvs/srv/KinematicPlanLinkPosition.srv
===================================================================
--- pkg/trunk/robot_srvs/srv/KinematicPlanLinkPosition.srv (rev 0)
+++ pkg/trunk/robot_srvs/srv/KinematicPlanLinkPosition.srv 2008-08-17 22:22:33 UTC (rev 3189)
@@ -0,0 +1,60 @@
+# This message contains the definition for a request to the motion
+# planner
+
+
+
+# The model (defined in pr2.xml as a group) for which the motion
+# planner should plan for
+string model_id
+
+
+# The starting state for the robot. This is eth complete state of the
+# robot, all joint values, everything that needs to be specified to
+# completely define where each part of the robot is in space. The
+# meaning for each element in the state vector can be extracted from
+# viewing the output of the robot model construction (the kinematic
+# model constructed from the parsed URDF model) in verbose mode
+robot_msgs/KinematicState start_state
+
+
+# The goal state for the model to plan for. The state is not explicit.
+# The goal is considered achieved if all the constraints are satisfied.
+robot_msgs/KinematicConstraint[] goal_constraints
+
+
+# No state in the produced motion plan will violate these constraints
+robot_msgs/KinematicConstraint[] constraints
+
+
+# The maximum amount of time the motion planner is allowed to plan for
+float64 allowed_time
+
+
+# A string that identifies which distance metric the planner should use
+string distance_metric
+
+
+# Lower coordinate for a box defining the volume in the workspace the
+# motion planner is active in. If planning in 2D, only first 2 values
+# (x, y) of the points are used.
+std_msgs/Point3DFloat64 volumeMin
+
+
+# Higher coordinate for the box described above
+std_msgs/Point3DFloat64 volumeMax
+
+---
+
+# The result of a motion plan: a kinematic path. If the motion plan is
+# not succesful, this path has 0 states. If the motion plan is
+# succesful, this path contains the minimum number of states (but it
+# includes start and goal states) to define the motions for the
+# robot. If more intermediate states are needed, linear interpolation
+# is to be assumed.
+robot_msgs/KinematicPath path
+
+
+# The threshold that was actually achieved. If the planner did not have enough time,
+# it may return a distance larger than the desired threshold. The user may choose to
+# discard the path
+float64 distance
Copied: pkg/trunk/robot_srvs/srv/KinematicPlanState.srv (from rev 3185, pkg/trunk/robot_srvs/srv/KinematicMotionPlan.srv)
===================================================================
--- pkg/trunk/robot_srvs/srv/KinematicPlanState.srv (rev 0)
+++ pkg/trunk/robot_srvs/srv/KinematicPlanState.srv 2008-08-17 22:22:33 UTC (rev 3189)
@@ -0,0 +1,67 @@
+# This message contains the definition for a request to the motion
+# planner
+
+
+
+# The model (defined in pr2.xml as a group) for which the motion
+# planner should plan for
+string model_id
+
+
+# The starting state for the robot. This is eth complete state of the
+# robot, all joint values, everything that needs to be specified to
+# completely define where each part of the robot is in space. The
+# meaning for each element in the state vector can be extracted from
+# viewing the output of the robot model construction (the kinematic
+# model constructed from the parsed URDF model) in verbose mode
+robot_msgs/KinematicState start_state
+
+
+# The goal state for the model to plan for. The dimension of this
+# state must be equal to the dimension of the state space
+# characterizing the model (group) to plan for. If this state has
+# dimension 0, it is assumed that the first state that satisfies the
+# constraints is correct
+robot_msgs/KinematicState goal_state
+
+
+# No state in the produced motion plan will violate these constraints
+robot_msgs/KinematicConstraint[] constraints
+
+# The maximum amount of time the motion planner is allowed to plan for
+float64 allowed_time
+
+
+# A string that identifies which distance metric the planner should use
+string distance_metric
+
+
+# The threshold (distance) that is allowed between the returned
+# solution and the actual goal
+float64 threshold
+
+
+# Lower coordinate for a box defining the volume in the workspace the
+# motion planner is active in. If planning in 2D, only first 2 values
+# (x, y) of the points are used.
+std_msgs/Point3DFloat64 volumeMin
+
+
+# Higher coordinate for the box described above
+std_msgs/Point3DFloat64 volumeMax
+
+---
+
+# The result of a motion plan: a kinematic path. If the motion plan is
+# not succesful, this path has 0 states. If the motion plan is
+# succesful, this path contains the minimum number of states (but it
+# includes start and goal states) to define the motions for the
+# robot. If more intermediate states are needed, linear interpolation
+# is to be assumed.
+robot_msgs/KinematicPath path
+
+
+# The threshold that was actually achieved. If the planner did not have enough time,
+# it may return a distance larger than the desired threshold. The user may choose to
+# discard the path
+float64 distance
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rob...@us...> - 2008-08-18 18:05:39
|
Revision: 3202
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=3202&view=rev
Author: rob_wheeler
Date: 2008-08-18 18:05:38 +0000 (Mon, 18 Aug 2008)
Log Message:
-----------
Enforce joint effort limits in the joint, not in the controllers.
Modified Paths:
--------------
pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_autotuner.h
pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_effort_controller.h
pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_position_controller.h
pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_velocity_controller.h
pkg/trunk/controllers/generic_controllers/include/generic_controllers/ramp_input_controller.h
pkg/trunk/controllers/generic_controllers/src/joint_autotuner.cpp
pkg/trunk/controllers/generic_controllers/src/joint_effort_controller.cpp
pkg/trunk/controllers/generic_controllers/src/joint_position_controller.cpp
pkg/trunk/controllers/generic_controllers/src/joint_velocity_controller.cpp
pkg/trunk/controllers/generic_controllers/src/ramp_input_controller.cpp
pkg/trunk/mechanism/mechanism_model/src/joint.cpp
Modified: pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_autotuner.h
===================================================================
--- pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_autotuner.h 2008-08-18 17:41:09 UTC (rev 3201)
+++ pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_autotuner.h 2008-08-18 18:05:38 UTC (rev 3202)
@@ -139,11 +139,6 @@
double cycle_start_time_;
private:
- /*!
- * \brief Actually issue torque set command of the joint motor.
- */
- void setJointEffort(double torque);
-
mechanism::Joint* joint_; /**< Joint we're controlling. */
Pid pid_controller_; /**< Internal PID controller. */
double last_time_; /**< Last time stamp of update. */
Modified: pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_effort_controller.h
===================================================================
--- pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_effort_controller.h 2008-08-18 17:41:09 UTC (rev 3201)
+++ pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_effort_controller.h 2008-08-18 18:05:38 UTC (rev 3202)
@@ -105,11 +105,6 @@
virtual void update();
private:
- /*!
- * \brief Actually issue torque set command of the joint motor.
- */
- void setJointEffort(double torque);
-
mechanism::Joint* joint_; /**< Joint we're controlling. */
mechanism::Robot *robot_; /**< Pointer to robot structure. */
double command_; /**< Last commanded position. */
Modified: pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_position_controller.h
===================================================================
--- pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_position_controller.h 2008-08-18 17:41:09 UTC (rev 3201)
+++ pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_position_controller.h 2008-08-18 18:05:38 UTC (rev 3202)
@@ -112,11 +112,6 @@
virtual void update();
private:
- /*!
- * \brief Actually issue torque set command of the joint motor.
- */
- void setJointEffort(double torque);
-
mechanism::Joint* joint_; /**< Joint we're controlling. */
mechanism::Robot *robot_; /**< Pointer to robot structure. */
Pid pid_controller_; /**< Internal PID controller. */
Modified: pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_velocity_controller.h
===================================================================
--- pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_velocity_controller.h 2008-08-18 17:41:09 UTC (rev 3201)
+++ pkg/trunk/controllers/generic_controllers/include/generic_controllers/joint_velocity_controller.h 2008-08-18 18:05:38 UTC (rev 3202)
@@ -112,11 +112,6 @@
virtual void update();
private:
- /*!
- * \brief Actually issue torque set command of the joint motor.
- */
- void setJointEffort(double torque);
-
mechanism::Joint* joint_; /**< Joint we're controlling. */
mechanism::Robot *robot_; /**< Pointer to robot structure. */
Pid pid_controller_; /**< Internal PID controller. */
Modified: pkg/trunk/controllers/generic_controllers/include/generic_controllers/ramp_input_controller.h
===================================================================
--- pkg/trunk/controllers/generic_controllers/include/generic_controllers/ramp_input_controller.h 2008-08-18 17:41:09 UTC (rev 3201)
+++ pkg/trunk/controllers/generic_controllers/include/generic_controllers/ramp_input_controller.h 2008-08-18 18:05:38 UTC (rev 3202)
@@ -108,11 +108,6 @@
virtual void update();
private:
- /*!
- * \brief Actually issue torque set command of the joint motor.
- */
- void setJointEffort(double torque);
-
mechanism::Joint* joint_; /**< Joint we're controlling. */
mechanism::Robot *robot_; /**< Pointer to robot structure. */
double input_start_; /**< Begining of the ramp. */
Modified: pkg/trunk/controllers/generic_controllers/src/joint_autotuner.cpp
===================================================================
--- pkg/trunk/controllers/generic_controllers/src/joint_autotuner.cpp 2008-08-18 17:41:09 UTC (rev 3201)
+++ pkg/trunk/controllers/generic_controllers/src/joint_autotuner.cpp 2008-08-18 18:05:38 UTC (rev 3202)
@@ -31,7 +31,6 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*********************************************************************/
-#include <algorithm>
#include <generic_controllers/joint_autotuner.h>
#include <math_utils/angles.h>
@@ -149,23 +148,18 @@
if(current_state_ == POSITIVE_PEAK)
{
if(position > positive_peak_) positive_peak_ = position;
- //If looking for positive peak, set positive h
- setJointEffort(relay_height_);
+ //If looking for positive peak, set positive h
+ joint_->commanded_effort_ = relay_height_;
}
else if(current_state_ == NEGATIVE_PEAK)
{
if(position<negative_peak_) negative_peak_ = position;
- //If looking for negative peak, set negative h
- setJointEffort(-relay_height_);
+ //If looking for negative peak, set negative h
+ joint_->commanded_effort_ = -relay_height_;
}
}
-void JointAutotuner::setJointEffort(double effort)
-{
- joint_->commanded_effort_ = min(max(effort, -joint_->effort_limit_), joint_->effort_limit_);
-}
-
ROS_REGISTER_CONTROLLER(JointAutotunerNode)
JointAutotunerNode::JointAutotunerNode()
{
Modified: pkg/trunk/controllers/generic_controllers/src/joint_effort_controller.cpp
===================================================================
--- pkg/trunk/controllers/generic_controllers/src/joint_effort_controller.cpp 2008-08-18 17:41:09 UTC (rev 3201)
+++ pkg/trunk/controllers/generic_controllers/src/joint_effort_controller.cpp 2008-08-18 18:05:38 UTC (rev 3202)
@@ -31,7 +31,6 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*********************************************************************/
-#include <algorithm>
#include <generic_controllers/joint_effort_controller.h>
using namespace std;
@@ -95,14 +94,9 @@
void JointEffortController::update()
{
- setJointEffort(command_);
+ joint_->commanded_effort_ = command_;
}
-void JointEffortController::setJointEffort(double effort)
-{
- joint_->commanded_effort_ = min(max(effort, -joint_->effort_limit_), joint_->effort_limit_);
-}
-
ROS_REGISTER_CONTROLLER(JointEffortControllerNode)
JointEffortControllerNode::JointEffortControllerNode()
{
Modified: pkg/trunk/controllers/generic_controllers/src/joint_position_controller.cpp
===================================================================
--- pkg/trunk/controllers/generic_controllers/src/joint_position_controller.cpp 2008-08-18 17:41:09 UTC (rev 3201)
+++ pkg/trunk/controllers/generic_controllers/src/joint_position_controller.cpp 2008-08-18 18:05:38 UTC (rev 3202)
@@ -31,7 +31,6 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*********************************************************************/
-#include <algorithm>
#include <generic_controllers/joint_position_controller.h>
#include <math_utils/angles.h>
@@ -106,7 +105,6 @@
{
assert(robot_ != NULL);
double error(0);
- double effort_cmd(0);
double time = robot_->hw_->current_time_;
if(joint_->type_ == mechanism::JOINT_ROTARY || joint_->type_ == mechanism::JOINT_CONTINUOUS)
@@ -118,16 +116,9 @@
error = joint_->position_ - command_;
}
- effort_cmd = pid_controller_.updatePid(error, time - last_time_);
-
- setJointEffort(effort_cmd);
+ joint_->commanded_effort_ = pid_controller_.updatePid(error, time - last_time_);
}
-void JointPositionController::setJointEffort(double effort)
-{
- joint_->commanded_effort_ = min(max(effort, -joint_->effort_limit_), joint_->effort_limit_);
-}
-
ROS_REGISTER_CONTROLLER(JointPositionControllerNode)
JointPositionControllerNode::JointPositionControllerNode()
{
Modified: pkg/trunk/controllers/generic_controllers/src/joint_velocity_controller.cpp
===================================================================
--- pkg/trunk/controllers/generic_controllers/src/joint_velocity_controller.cpp 2008-08-18 17:41:09 UTC (rev 3201)
+++ pkg/trunk/controllers/generic_controllers/src/joint_velocity_controller.cpp 2008-08-18 18:05:38 UTC (rev 3202)
@@ -31,7 +31,6 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*********************************************************************/
-#include <algorithm>
#include <generic_controllers/joint_velocity_controller.h>
#include <math_utils/angles.h>
@@ -107,20 +106,12 @@
void JointVelocityController::update()
{
double error(0);
- double torque_cmd(0);
double time = robot_->hw_->current_time_;
error = joint_->velocity_ - command_;
- torque_cmd = pid_controller_.updatePid(error, time - last_time_);
-
- setJointEffort(torque_cmd);
+ joint_->commanded_effort_ = pid_controller_.updatePid(error, time - last_time_);
}
-void JointVelocityController::setJointEffort(double effort)
-{
- joint_->commanded_effort_ = min(max(effort, -joint_->effort_limit_), joint_->effort_limit_);
-}
-
ROS_REGISTER_CONTROLLER(JointVelocityControllerNode)
JointVelocityControllerNode::JointVelocityControllerNode()
{
Modified: pkg/trunk/controllers/generic_controllers/src/ramp_input_controller.cpp
===================================================================
--- pkg/trunk/controllers/generic_controllers/src/ramp_input_controller.cpp 2008-08-18 17:41:09 UTC (rev 3201)
+++ pkg/trunk/controllers/generic_controllers/src/ramp_input_controller.cpp 2008-08-18 18:05:38 UTC (rev 3202)
@@ -31,7 +31,6 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*********************************************************************/
-#include <algorithm>
#include <generic_controllers/ramp_input_controller.h>
using namespace std;
@@ -104,19 +103,11 @@
void RampInputController::update()
{
- double effort_cmd(0);
double time = robot_->hw_->current_time_;
- effort_cmd=input_start_+(input_end_-input_start_)*(time-initial_time_)/(duration_);
-
- setJointEffort(effort_cmd);
+ joint_->commanded_effort_ = input_start_+(input_end_-input_start_)*(time-initial_time_)/(duration_);
}
-void RampInputController::setJointEffort(double effort)
-{
- joint_->commanded_effort_ = min(max(effort, -joint_->effort_limit_), joint_->effort_limit_);
-}
-
ROS_REGISTER_CONTROLLER(RampInputControllerNode)
RampInputControllerNode::RampInputControllerNode()
{
Modified: pkg/trunk/mechanism/mechanism_model/src/joint.cpp
===================================================================
--- pkg/trunk/mechanism/mechanism_model/src/joint.cpp 2008-08-18 17:41:09 UTC (rev 3201)
+++ pkg/trunk/mechanism/mechanism_model/src/joint.cpp 2008-08-18 18:05:38 UTC (rev 3202)
@@ -51,7 +51,7 @@
void Joint::enforceLimits()
{
- // TODO: enforce the limits so the joint operates safely
+ commanded_effort_ = min(max(commanded_effort_, -effort_limit_), effort_limit_);
}
void Joint::initXml(TiXmlElement *elt)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|