Ask Your Question

tengfei's profile - activity

2019-10-30 03:52:36 -0600 received badge  Notable Question (source)
2019-10-28 09:47:37 -0600 received badge  Popular Question (source)
2019-10-28 09:47:37 -0600 received badge  Famous Question (source)
2019-10-28 09:47:37 -0600 received badge  Notable Question (source)
2019-07-01 12:13:54 -0600 received badge  Famous Question (source)
2019-05-24 06:00:34 -0600 received badge  Teacher (source)
2019-05-24 06:00:34 -0600 received badge  Self-Learner (source)
2019-03-16 12:57:30 -0600 received badge  Famous Question (source)
2019-01-11 07:51:28 -0600 marked best answer robot in Rviz cannot move and dropping the first 1 trajectory point

Hi all! I'm now following the book Mastering ROS for Robotics Programming and build my robot in rviz and gazebo. I wrote the launch file to bring up both rviz and gazebo but some problems appeared. The first one is that after the rviz started, I give the robot a new position and click the plan and execute.it can plan successfully but cannot execute in other words, the robot in rviz cannot move to the goal position. Meanwhile in the terminal there is also a warning [ WARN] [1509967616.528903811, 3368.707000000]: Dropping first 1 trajectory point(s) out of 13, as they occur before the current time. First valid point will be reached in 0.459s. I guess that the warning is asociated with the first problem. I have searched the similar problem but I still cannot slove the problem. Could some one give me some suggestion? here is the launch file bringup.lunch which launch the rviz and gazebo together.when click the plan and execute,the robot can move correctly in gazebo but do not move in rviz.

<launch>

 <!-- Launch Gazebo -->
<include file="$(find jaka_ur_description_pkg)/launch/gazebo.launch" />
<!-- ros_control seven dof arm launch file -->
<include file="$(find jaka_ur_description_pkg)/launch/jaka_ur_gazebo_joint_states.launch" />
<!-- ros_control position control dof arm launch file -->
<!--<include file="$(find jaka_ur_description_pkg)/launch/jaka_ur_gazebo_position.launch" /> -->
<!-- ros_control trajectory control dof arm launch file -->
<include file="$(find jaka_ur_description_pkg)/launch/jaka_ur_trajectory_controller.launch" />
<include file="$(find jaka_ur_moveit_config2)/launch/moveit_planning_execution.launch" />
</launch>

and the related config file trajectory_control.yaml file

 jaka_ur:
  jaka_joint_controller:
    type: "position_controllers/JointTrajectoryController"
    joints:
      - joint_1
      - joint_2
      - joint_3
      - joint_4
      - joint_5
      - joint_6
    gains:
      joint_1:   {p: 1000.0, i: 0.0, d: 0.1, i_clamp: 0.0}
      joint_2: {p: 1000.0, i: 0.0, d: 0.1, i_clamp: 0.0}
      joint_3:  {p: 1000.0, i: 0.0, d: 0.1, i_clamp: 0.0}
      joint_4:       {p: 1000.0, i: 0.0, d: 0.1, i_clamp: 0.0}
      joint_5:    {p: 1000.0, i: 0.0, d: 0.1, i_clamp: 0.0}
      joint_6:      {p: 1000.0, i: 0.0, d: 0.1, i_clamp: 0.0}
2018-11-15 13:08:24 -0600 received badge  Notable Question (source)
2018-11-15 13:08:24 -0600 received badge  Famous Question (source)
2018-09-14 17:41:00 -0600 marked best answer build metapackage ros_controllers failed

Hi all! I git clone the metapackage from the ros_controllers into my catkin_ws/src and then I caktin_make in my ~/catkin_ws. But it failed when building the ros_controllers/velocitys. Here are the output.

[ 13%] Building CXX object ros_controllers/velocity_controllers/CMakeFiles/velocity_controllers.dir/src/joint_group_velocity_controller.cpp.o
/home/shantengfei/catkin_ws/src/ros_controllers/effort_controllers/src/joint_velocity_controller.cpp: In member function ‘void effort_controllers::JointVelocityController::setGains(const double&, const double&, const double&, const double&, const double&, const bool&)’:
/home/shantengfei/catkin_ws/src/ros_controllers/effort_controllers/src/joint_velocity_controller.cpp:91:56: error: no matching function for call to ‘control_toolbox::Pid::setGains(const double&, const double&, const double&, const double&, const double&, const bool&)’
   pid_controller_.setGains(p,i,d,i_max,i_min,antiwindup);
                                                    ^
/home/shantengfei/catkin_ws/src/ros_controllers/effort_controllers/src/joint_velocity_controller.cpp:91:56: note: candidates are:
In file included from /home/shantengfei/catkin_ws/src/ros_controllers/effort_controllers/include/effort_controllers/joint_velocity_controller.h:69:0,
                 from /home/shantengfei/catkin_ws/src/ros_controllers/effort_controllers/src/joint_velocity_controller.cpp:36:
/opt/ros/indigo/include/control_toolbox/pid.h:248:8: note: void control_toolbox::Pid::setGains(double, double, double, double, double)
   void setGains(double p, double i, double d, double i_max, double i_min);
        ^

/opt/ros/indigo/include/control_toolbox/pid.h:248:8: note:   candidate expects 5 arguments, 6 provided
/opt/ros/indigo/include/control_toolbox/pid.h:254:8: note: void control_toolbox::Pid::setGains(const control_toolbox::Pid::Gains&)
   void setGains(const Gains &gains);
        ^
/opt/ros/indigo/include/control_toolbox/pid.h:254:8: note:   candidate expects 1 argument, 6 provided
/home/shantengfei/catkin_ws/src/ros_controllers/effort_controllers/src/joint_velocity_controller.cpp: In member function ‘void effort_controllers::JointVelocityController::getGains(double&, double&, double&, double&, double&, bool&)’:
/home/shantengfei/catkin_ws/src/ros_controllers/effort_controllers/src/joint_velocity_controller.cpp:96:56: error: no matching function for call to ‘control_toolbox::Pid::getGains(double&, double&, double&, double&, double&, bool&)’
   pid_controller_.getGains(p,i,d,i_max,i_min,antiwindup);
                                                    ^
/home/shantengfei/catkin_ws/src/ros_controllers/effort_controllers/src/joint_velocity_controller.cpp:96:56: note: candidates are:
In file included from /home/shantengfei/catkin_ws/src/ros_controllers/effort_controllers/include/effort_controllers/joint_velocity_controller.h:69:0,
                 from /home/shantengfei/catkin_ws/src/ros_controllers/effort_controllers/src/joint_velocity_controller.cpp:36:
/opt/ros/indigo/include/control_toolbox/pid.h:232:8: note: void control_toolbox::Pid::getGains(double&, double&, double&, double&, double&)
   void getGains(double &p, double &i, double &d, double &i_max, double &i_min);
    ^
/opt/ros/indigo/include/control_toolbox/pid.h:232:8: note:   candidate expects 5 arguments, 6 provided
/opt/ros/indigo/include/control_toolbox/pid.h:238:9: note: control_toolbox::Pid::Gains control_toolbox::Pid::getGains()
   Gains getGains();
         ^
/opt/ros/indigo/include/control_toolbox/pid.h:238:9: note:   candidate expects 0 arguments, 6 provided
/home/shantengfei/catkin_ws/src/ros_controllers/effort_controllers/src/joint_velocity_controller.cpp: In member function ‘void effort_controllers::JointVelocityController::getGains(double&, double&, double&, double&, double&)’:
/home/shantengfei/catkin_ws/src/ros_controllers/effort_controllers/src/joint_velocity_controller.cpp:102:51: error: no matching function for call to ‘control_toolbox::Pid::getGains(double&, double&, double&, double&, double&, bool&)’
   pid_controller_.getGains(p,i,d,i_max,i_min,dummy);
                                               ^
/home/shantengfei/catkin_ws/src/ros_controllers/effort_controllers/src/joint_velocity_controller.cpp:102:51: note: candidates are:
In file included from /home/shantengfei/catkin_ws/src/ros_controllers ...
(more)
2018-09-14 17:39:19 -0600 received badge  Famous Question (source)
2018-07-13 10:41:22 -0600 received badge  Famous Question (source)
2018-06-27 15:49:09 -0600 received badge  Famous Question (source)
2018-05-22 09:21:26 -0600 received badge  Popular Question (source)
2018-05-22 09:21:26 -0600 received badge  Notable Question (source)
2018-04-30 05:42:19 -0600 received badge  Famous Question (source)
2018-04-17 05:27:15 -0600 received badge  Famous Question (source)
2018-04-17 05:27:15 -0600 received badge  Popular Question (source)
2018-04-17 05:27:15 -0600 received badge  Notable Question (source)
2018-04-17 05:17:51 -0600 received badge  Famous Question (source)
2018-04-09 04:22:55 -0600 received badge  Famous Question (source)
2018-03-09 22:28:29 -0600 received badge  Famous Question (source)
2018-03-02 16:34:36 -0600 received badge  Notable Question (source)
2018-02-06 11:56:56 -0600 received badge  Famous Question (source)
2018-01-05 03:46:51 -0600 received badge  Famous Question (source)
2017-12-22 03:48:59 -0600 received badge  Notable Question (source)
2017-12-21 03:10:34 -0600 commented question [moveit] problem about Cartesian Paths of move_group_interface

hello,I also have the same question.so you mean that the first point of the cartesian path should be the gurrent pose of

2017-12-20 00:57:37 -0600 received badge  Famous Question (source)
2017-12-06 12:51:46 -0600 received badge  Notable Question (source)
2017-12-06 04:41:02 -0600 asked a question the utilization of rviz::Panel::load and rviz::Panel::save when create a custom rviz plugin

the utilization of rviz::Panel::load and rviz::Panel::save when create a custom rviz plugin Hi all. I'm trying to write

2017-12-02 05:15:17 -0600 commented answer Fail: ABORTED: No motion plan found. No execution attempted

Hi, I have a question that before I set the pose goal, how can I know whether the pgose goal is reachable? Is there any

2017-11-29 08:33:34 -0600 received badge  Popular Question (source)
2017-11-29 08:31:47 -0600 received badge  Popular Question (source)
2017-11-29 07:34:27 -0600 asked a question Launch a new rviz plugin failed, Error:Failed to load library XXX.so,Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML.

Launch a new rviz plugin failed, Error:Failed to load library XXX.so,Make sure that you are calling the PLUGINLIB_EXPORT

2017-11-24 05:48:33 -0600 asked a question the copyJointGroupPositions function failed to get joint_values

the copyJointGroupPositions function failed to get joint_values Hi all. I'm trying to use moveit API. I get down the cod

2017-11-24 05:11:09 -0600 marked best answer Could not find library corresponding to plugin

Hi all. I'm trying to learn how to write rviz plugins from the book Mastering Ros for robotics.But there is a problem I cannot solve. I created the package and then created the teleop_pad.h file here:

#ifndef TELEOP_PAD_H
#define TELEOP_PAD_H

#include <ros/ros.h>
#include <ros/console.h>
#include <rviz/panel.h>
class QLineEdit;

namespace rviz_teleop_commander
{
    //所有的plugin都必须是rviz::panel的子类
    class TeleopPanel: public rviz::Panel
    {
        //后面需要用到Qt的信号和槽,都是Qobject的子类,所以需要声明Q_OBJECT宏
        Q_OBJECT
        public:

        //构造函数。在类中会用到QWidget的实力来实现GUI界面,这里先初始化为0
    TeleopPanel(QWidget* parent =0 );

    //重载rviz::Panel基类中的函数,用于保存、加载配置文件中的数据,在我们这个plugin
   // 中,数据就是topic的名称
   virtual void load(const rviz::Config& config);
   virtual void save(rviz::Config config) const;

   //公共槽
   public Q_SLOTS:
    // 当用户输入topic的命名并按下回车后,回调用此槽来创建一个相应名称的topic publisher
    void setTopic (const QString& topic)

//内部槽
protected Q_SLOTS:
void sendvel();                 // 发布当前的速度值
void update_Linear_Velocity();  // 根据用户的输入更新线速度值
void update_Angular_Velocity(); // 根据用户的输入更新角速度值
void updateTopic();             // 根据用户的输入更新topic name

//内部变量
protected:
//topic names输入框
QLineEdit* output_topic_editor_;
QString output_topic_;

//线速度输入框
 QLineEdit* output_topic_editor_1;
 QString output_topic_1;

 //角速度输入框
  QLineEdit* output_topic_editor_2;
 QString output_topic_2;

 //// ROS的publisher,用来发布速度topic
 ros::Publisher velocity_publisher_;

 //ROS node handle
 ros::NodeHandle nh_;
 //当前保存的线速度和角速度
 float linear_velocity_;
 float angular_velocity_;
};
}  //end namespace rviz_plugin_tutorial

#endif //TELEOP_PANEL_H

the teleop_pad.cpp file

#include <studio.h>
#include <QPainter>
#include <QLineEdit>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QTimer>

#include <geometry_msgs/Twist.h>
#include <QDebug>

#include "teleop_pad.h"
namespace rviz_teleop_commander {
//构造函数,初始化变量
TeleopPanel::TeleopPanel(QWidget *parent)
    : rviz::Panel(parent), linear_velocity_(0), angular_velocity_(0) {
  // 创建一个输入topic命名的窗口
  QVBoxLayout *topic_layout = new QVBoxLayout;
  topic_layout->addwidget(new QLabel("Teleop Topic"));
  output_topic_editor_ = new QLineEdit;
  topic_layout->addwidget(output_topic_editor_);

  // 创建一个输入线速度的窗口
  topic_layout->addwidget(new QLabel("Linear Velocity"));
  output_topic_editor_1 = new QLineEdit;
  topic_layout->addwidget(output_topic_editor_1);

  //创建一个输入角速度窗口
  topic_layout->addwidget(new QLabel("Angular Velocity"));
  output_topic_editor_2 = new QLineEdit;
  topic_layout->addwidget(output_topic_editor_2);

  QHBoxLayout *layout = new QHBoxLayout;
  layout->addLayout(topic_layout);
  setLayout(layout);

  //创建定时器,发布消息
  QTimer *output_timer = new QTimer(this);



 //设置信号与槽连接
  connect(output_topic_editor_, SIGNAL(editingFinished()), this,
          SLOT(updateTopic())); //输入topic命名,回车后,调用updateTopic()
  connect(
      output_topic_editor_1, SIGNAL(editingFinished()), this,
      SLOT(
          update_Linear_velocity())); //输入线速度值,回车后,调用update_Linear_Velocity()
  connect(
      output_topic_editor_2, SIGNAL(editingFinished()), this,
      SLOT(
          update_Angular_velocity())); //输入角速度值,回车后,调用update_Angular_Velocity()

  //设置定时器的回调函数。按周期调用sendvle
  connect(output_timer, SIGNAL(timerout()), this, SLOT(sendVel()));
  output_timer->start(100);
}

//更新线速度
void TeleopPanel::update_Linear_velocity() {
  //获取输入框内的数据
  QString temp_string = output_topic_editor_1->text();
  //将字符串转换为浮点数
  float lin = temp_string.toFloat();
  //保存当前输入值
  linear_velocity_ = lin;
}

void TeleopPanel::update_Angular_velocity {
  QString temp_string = output_topic_editor_2->text();
  float ang = temp_string.toFloat();
  angular_velocity_ = ang;
}

//更新topic命名
void TeleopPanel::setTopic(const QString &new_topic) {
  //检查topic是否改变
  if (new_topic != output_topic_) {
    output_topic_ = new_topic;
    //如果命名空,不发布任何信息
    if (output_topic_ == "") {
      velocity_publisher_.shutdown();
    }
    //否则初始化publisher
    else {


     velocity_publisher_ =
          nh.advertise<geometry_msgs::Twist>(output_topic_.toStdstring(), 1);
    }
    Q_EMIT configChanged();
  }
}

//发布消息
void TeleopPanel::sendVel() {
  if (ros::ok() && velocity_publisher_) {
    geometry_msgs::Twist msg;
    msg.linear.x = linear_velocity_;
    msg.linear.y = 0;
    msg.linear.z = 0;
    msg.angular.x = 0;
    msg.angular.y = 0;
    msg.angular.z = angular_velocity_;
    velocity_publisher_.publish(msg);

  }
}

//重载基类功能
void TeleopPanel::save(rviz::Config config) const {
  rviz::Panel::save(config);
  config.mapSetvalue("Topic", output_topic_);
}

// 重载父类的功能,加载配置数据
void TeleopPanel::load(const rviz::Config &config) {
  rviz::Panel::load(config);
  QString topic;
  if (config.mapGetString("Topic", &topic)) {
    output_topic_editor_->setText(topic);
    updateTopic();
  }
}

} // end namespace rviz_plugin_tutorials

  // 声明此类是一个rviz的插件
  #include <pluginlib/class_list_macros.h>
  PLUGINLIB_EXPORT_CLASS(rviz_telop_commander::TeleopPanel,rviz::Panel)
  //tutorial

the package.xml:

<?xml version="1.0"?>
<package format="2">
  <name>rviz_teleop_commander</name>
  <version>0.0.0</version>
  <description>The rviz_teleop_commander package</description>

  <maintainer email="shantengfei@todo.todo">shantengfei</maintainer>

  <license>TODO</license>

  <buildtool_depend>catkin</buildtool_depend>

  <build_depend ...
(more)
2017-11-24 05:10:56 -0600 received badge  Notable Question (source)
2017-11-23 07:48:37 -0600 received badge  Popular Question (source)
2017-11-23 04:25:34 -0600 marked best answer ERROR: cannot launch node of type [controller_manager/controller_manager]: can't locate node [controller_manager] in package [controller_manager]

Hi all. I installed the university_robot package and roslaunch ur_gazebo ur10.launch but there is an error output:

`ERROR: cannot launch node of type [controller_manager/controller_manager]: can't locate node [controller_manager] in package [controller_manager]

ERROR: cannot launch node of type [controller_manager/controller_manager]: can't locate node [controller_manager] in package [controller_manager]

I runrosservice list | grep controller_manager` the output is

`/controller_manager/list_controller_types
/controller_manager/list_controllers
/controller_manager/load_controller
/controller_manager/reload_controller_libraries
/controller_manager/switch_controller
/controller_manager/unload_controller

`I have installed the controller_manager. Could someone give me some advice?Thanks.

2017-11-23 04:25:22 -0600 answered a question ERROR: cannot launch node of type [controller_manager/controller_manager]: can't locate node [controller_manager] in package [controller_manager]

I have solved this problem. In my catkin_ws/src, there is a ros_control package contains nothing in it.And I have instal

2017-11-23 04:21:40 -0600 commented question ERROR: cannot launch node of type [controller_manager/controller_manager]: can't locate node [controller_manager] in package [controller_manager]

Thanks gvdhoorn. I have solved this problem. In my catkin_ws/src, there is a ros_control package contains nothing in it.

2017-11-22 21:09:42 -0600 asked a question ERROR: cannot launch node of type [controller_manager/controller_manager]: can't locate node [controller_manager] in package [controller_manager]

ERROR: cannot launch node of type [controller_manager/controller_manager]: can't locate node [controller_manager] in pac

2017-11-22 05:23:37 -0600 marked best answer OSError: [Errno 13] Permission denied: '/home/shantengfei/catkin_ws/src/jaka_ur_moveit_config/default_warehouse_mongo_db'

HI all! I'm trying create a moveit package for my own robot following the tutorial Create_a_MoveIt_Pkg_for_an_Industrial_Robot. When I finished the second part Update Configuration Files I tested the configuation.However, there was something wrong. When I start the planning _and_execution.launch, there was something output like this:

OSError: [Errno 13] Permission denied: '/home/shantengfei/catkin_ws/src/jaka_ur_moveit_config/default_warehouse_mongo_db'

[mongo_wrapper_ros_shantengfei_PC_9122_1384786663048058499-7] process has died [pid 9194, exit code 1, cmd /opt/ros/indigo/lib/warehouse_ros/mongo_wrapper_ros.py __name:=mongo_wrapper_ros_shantengfei_PC_9122_1384786663048058499 __log:=/home/shantengfei/.ros/log/e378d02c-b477-11e7-9896-7085c22fcebd/mongo_wrapper_ros_shantengfei_PC_9122_1384786663048058499-7.log].
log file: /home/shantengfei/.ros/log/e378d02c-b477-11e7-9896-7085c22fcebd/mongo_wrapper_ros_shantengfei_PC_9122_1384786663048058499-7*.log

I checked the ros package jaka_ur_moveit_config and there are just two folders: launch and config. In the launch folder, there is a default_warehouse_db.launch file which was generated when I set up the moveit assistant:

<launch>

  <arg name="reset" default="false"/>
  <!-- If not specified, we'll use a default database location -->
  <arg name="moveit_warehouse_database_path" default="$(find jaka_ur_moveit_config)/default_warehouse_mongo_db" />

  <!-- Launch the warehouse with the configured database location -->
  <include file="$(find jaka_ur_moveit_config)/launch/warehouse.launch">
    <arg name="moveit_warehouse_database_path" value="$(arg moveit_warehouse_database_path)" />
  </include>



 <!-- If we want to reset the database, run this node -->
  <node if="$(arg reset)" name="$(anon moveit_default_db_reset)" type="moveit_init_demo_warehouse" pkg="moveit_ros_warehouse" respawn="false" output="screen" />
</launch>

and here is the moveit_planning_execution.launch

<launch>

  <arg name="sim" default="true" />
  <arg name="robot_ip" unless="$(arg sim)" />

  <include file="$(find jaka_ur_moveit_config)/launch/planning_context.launch" >
    <arg name="load_robot_description" value="true" />
  </include>

  <group if="$(arg sim)">
    <include file="$(find industrial_robot_simulator)/launch/robot_interface_simulator.launch" />
  </group>

  <group unless="$(arg sim)">
    <include file="$(find [robot_interface_pkg])/launch/robot_interface.launch" >
      <arg name="robot_ip" value="$(arg robot_ip)"/>
    </include>
  </group>

  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />

  <include file="$(find jaka_ur_moveit_config)/launch/move_group.launch">
    <arg name="publish_monitored_planning_scene" value="true" />
  </include>

  <include file="$(find jaka_ur_moveit_config)/launch/moveit_rviz.launch">
    <arg name="config" value="true"/>
  </include>

  <include file="$(find jaka_ur_moveit_config)/launch/default_warehouse_db.launch" />

</launch>

As can be seen, <arg name="moveit_warehouse_database_path" default="$(find jaka_ur_moveit_config)/default_warehouse_mongo_db" />. But I didn't find the default_warehouse_mongo_db.Could someone please give a method to solve the problem? Thanks. PS: Here is the output of ls -al /home/shantengfei/catkin_ws/src/jaka_ur_moveit_config

    drwxr-xr-x 4 root        root        4096 10月 16 10:00 .
drwxrwxr-x 8 shantengfei shantengfei 4096 10月 18 22:51 ..
-rw-r--r-- 1 root        root         310 10月 16 10:00 CMakeLists.txt
drwxr-xr-x 2 root        root        4096 10月 23 15:33 config
drwxr-xr-x 2 root        root        4096 10月 17 16:32 launch
-rw-r--r-- 1 root        root        1069 10月 16 10:00 package.xml
-rw-r--r-- 1 root        root         284 10月 16 10:00 .setup_assistant

and the output of ls -al /home/shantengfei/catkin_ws/src/jaka_ur_moveit_config/launch:

drwxr-xr-x 2 root root  4096 10月 17 16:32 .
drwxr-xr-x 4 root root  4096 10月 16 10:00 ..
-rwxrwxrwx 1 root root   715 10月 16 10:00 default_warehouse_db.launch
-rw-r--r-- 1 root root  2521 10月 16 10:00 demo.launch
-rw-r--r-- 1 root root   370 10月 16 10:00 fake_moveit_controller_manager.launch.xml
-rw-r--r-- 1 root root   299 10月 17 16:32 jakaUr_moveit_controller_manager.launch.xml
-rw-r--r-- 1 root root    20 10月 16 10 ...
(more)
2017-11-20 09:11:55 -0600 asked a question which topic should I pub to move robot in rviz and Gazebo?

which topic should I pub to move robot in rviz and Gazebo? Hi all. I'm trying to write some rviz plugin attached to a 6

2017-11-20 02:26:39 -0600 received badge  Popular Question (source)
2017-11-20 01:22:34 -0600 marked best answer no tutorial in Librviz: Incorporating RViz into a Custom GUI

Hi all.I want to learn how to write an application using an RViz visualization widget but the link in this page was unuseable. Could somen one give me an availble link? Thanks!