Ask Your Question

Bastbeat's profile - activity

2020-09-04 08:22:23 -0500 received badge  Nice Answer (source)
2018-01-02 05:27:54 -0500 received badge  Famous Question (source)
2018-01-02 05:27:54 -0500 received badge  Popular Question (source)
2018-01-02 05:27:54 -0500 received badge  Notable Question (source)
2017-07-24 06:49:30 -0500 marked best answer How can I use the iksolver.cpp

I generated the file to calculate the inverseKinematics with IKFast. How can I use this file, to solve the IK from a cpp in ROS? I can not find anything about that. I'm using the solver TranslationDirection5D

2017-05-16 19:39:15 -0500 marked best answer "rosservice list" and "info" from c++

How can I access to the functions of "rosservice" from a c++? I need to know the existing services and information about each service. Thanks

2017-04-20 17:31:23 -0500 marked best answer Get Service type from C++

In this code there is a function to get the type of a Service "get_service_type()": http://ros-win32.servicerobotics.eu/t... How can I do that from C++?

2016-05-08 15:30:43 -0500 marked best answer Problem with industrial_msgs/TriState.h

When I run catkin_make(I'm working with rqt). I get this:

[ 97%] Building CXX object guiakomips3/CMakeFiles/guiakomips3.dir/include/guiakomips3/moc_akomips3.cxx.o
In file included from /opt/ros/hydro/include/industrial_msgs/RobotStatus.h:53:0,
                 from /home/ismael/catkin_workspace/src/guiakomips3/include/guiakomips3/akomips3.h:13,
                 from /home/ismael/catkin_workspace/src/guiakomips3/src/guiakomips3/akomips3.cpp:1:
/opt/ros/hydro/include/industrial_msgs/TriState.h:73:13: error: expected identifier before ‘true’
/opt/ros/hydro/include/industrial_msgs/TriState.h:73:13: error: expected ‘}’ before ‘true’
/opt/ros/hydro/include/industrial_msgs/TriState.h:73:13: error: expected unqualified-id before ‘true’
/opt/ros/hydro/include/industrial_msgs/TriState.h:78:13: error: expected identifier before ‘false’
/opt/ros/hydro/include/industrial_msgs/TriState.h:78:13: error: expected ‘}’ before ‘false’
/opt/ros/hydro/include/industrial_msgs/TriState.h:78:13: error: expected unqualified-id before ‘false’
/opt/ros/hydro/include/industrial_msgs/TriState.h:85:59: error: ‘ContainerAllocator’ was not declared in this scope
/opt/ros/hydro/include/industrial_msgs/TriState.h:85:77: error: template argument 1 is invalid
/opt/ros/hydro/include/industrial_msgs/TriState.h:85:79: error: template argument 1 is invalid
/opt/ros/hydro/include/industrial_msgs/TriState.h:85:84: error: invalid type in declaration before ‘;’ token
/opt/ros/hydro/include/industrial_msgs/TriState.h:86:59: error: ‘ContainerAllocator’ was not declared in this scope
/opt/ros/hydro/include/industrial_msgs/TriState.h:86:77: error: template argument 1 is invalid
/opt/ros/hydro/include/industrial_msgs/TriState.h:86:84: error: template argument 1 is invalid
/opt/ros/hydro/include/industrial_msgs/TriState.h:86:94: error: invalid type in declaration before ‘;’ token
/opt/ros/hydro/include/industrial_msgs/TriState.h:89:1: error: expected declaration before ‘}’ token
make[2]: *** [guiakomips3/CMakeFiles/guiakomips3.dir/src/guiakomips3/akomips3.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /opt/ros/hydro/include/industrial_msgs/RobotStatus.h:53:0,
                 from /home/ismael/catkin_workspace/build/guiakomips3/include/guiakomips3/../../../../src/guiakomips3/include/guiakomips3/akomips3.h:13,
                 from /home/ismael/catkin_workspace/build/guiakomips3/include/guiakomips3/moc_akomips3.cxx:10:
/opt/ros/hydro/include/industrial_msgs/TriState.h:73:13: error: expected identifier before ‘true’
/opt/ros/hydro/include/industrial_msgs/TriState.h:73:13: error: expected ‘}’ before ‘true’
/opt/ros/hydro/include/industrial_msgs/TriState.h:73:13: error: expected unqualified-id before ‘true’
/opt/ros/hydro/include/industrial_msgs/TriState.h:78:13: error: expected identifier before ‘false’
/opt/ros/hydro/include/industrial_msgs/TriState.h:78:13: error: expected ‘}’ before ‘false’
/opt/ros/hydro/include/industrial_msgs/TriState.h:78:13: error: expected unqualified-id before ‘false’
/opt/ros/hydro/include/industrial_msgs/TriState.h:85:59: error: ‘ContainerAllocator’ was not declared in this scope
/opt/ros/hydro/include/industrial_msgs/TriState.h:85:77: error: template argument 1 is invalid
/opt/ros/hydro/include/industrial_msgs/TriState.h:85:79: error: template argument 1 is invalid
/opt/ros/hydro/include/industrial_msgs/TriState.h:85:84: error: invalid type in declaration before ‘;’ token
/opt/ros/hydro/include/industrial_msgs/TriState.h:86:59: error: ‘ContainerAllocator’ was not declared in ...
(more)
2015-10-30 10:54:02 -0500 received badge  Famous Question (source)
2015-10-30 10:54:02 -0500 received badge  Notable Question (source)
2015-10-30 10:54:02 -0500 received badge  Popular Question (source)
2015-10-21 10:58:29 -0500 received badge  Famous Question (source)
2015-08-30 11:56:32 -0500 received badge  Notable Question (source)
2015-06-26 12:58:52 -0500 received badge  Famous Question (source)
2015-06-21 00:51:58 -0500 received badge  Taxonomist
2015-05-28 03:52:55 -0500 received badge  Famous Question (source)
2015-05-11 10:21:07 -0500 received badge  Famous Question (source)
2015-04-10 06:49:52 -0500 asked a question Robot does not move like rviz shows

Hello everyone,

I have a problem when I try to plan a path with moveit and rviz. When the calculation of the path is ready and rviz shows the movement that the robot should do, the robot start the movement, but not like the rviz-simulation. Sometimes he doesn't do the correct movement. Instead, he does a strange movements with his last joint. Normally he can reach the final points, but the movement inbetween is strange. Do you know why maybe?

Thank you!

2015-03-27 15:40:17 -0500 asked a question Angular movement with Moveit?

Hello, I would like to move my robot directly from Moveit, giving just the joints' degrees. Is that possible without a kinematic transformation?

Thank you!

2015-03-13 11:13:54 -0500 received badge  Famous Question (source)
2015-03-10 17:21:49 -0500 received badge  Famous Question (source)
2015-02-18 10:31:32 -0500 received badge  Notable Question (source)
2015-02-15 12:03:42 -0500 received badge  Famous Question (source)
2015-02-09 04:01:30 -0500 received badge  Famous Question (source)
2015-02-03 09:35:36 -0500 received badge  Popular Question (source)
2015-01-18 07:30:35 -0500 asked a question computeCartesianPath() from MoveIt doesn't create a Trajectory

Hello, I'm trying to run the code bellow, but I the computeCartesianPath()-function (inside Solverfunction) won't create a Trajectory. I based this code on the Moveit Cartesian Path Planner Plugin. Running the original code works fine.

Anybody knows what's wrong?

#include <moveit/move_group_interface/move_group.h>
#include <moveit/robot_trajectory/robot_trajectory.h>
#include <ros/ros.h>

#include <moveit/robot_model_loader/robot_model_loader.h>
#include <moveit/planning_interface/planning_interface.h>
#include <moveit/planning_scene_interface/planning_scene_interface.h>
#include <moveit/planning_scene/planning_scene.h>
#include <moveit/kinematic_constraints/utils.h>
#include <moveit_msgs/DisplayTrajectory.h>
#include <moveit_msgs/PlanningScene.h>

#include <boost/function.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/assert.hpp>
#include <math.h>
#include <moveit/robot_state/conversions.h>
#include <moveit/trajectory_processing/iterative_time_parameterization.h>

#include <tf/tf.h>
#include <tf/LinearMath/Matrix3x3.h>
#include <Eigen/Geometry>
#include <iostream>
#include <stdio.h>

#include <terminal_mocap/terminal_mocap_service.h>
#include <vector>

typedef boost::shared_ptr<move_group_interface::MoveGroup> MoveGroupPtr;
MoveGroupPtr moveit_group_;
const moveit::core::JointModelGroup* joint_model_group;

moveit::core::RobotStatePtr kinematic_state;
bool insidecallback = false;
std::vector<geometry_msgs::Pose> waypoints;
std::vector<double> Trajectoryvector, Velocityvector;

void Solverfunction(std::vector<geometry_msgs::Pose> waypoints_final);


moveit_msgs::RobotTrajectory trajectory;


bool CallBackMocap(terminal_mocap::terminal_mocap_service::Request &req, terminal_mocap::terminal_mocap_service::Response &res)
{

    std::vector<tf::Transform> vector_transform;
    std::vector<geometry_msgs::Pose> waypoints;
    geometry_msgs::Pose puntos;

    printf("Inside bool \n");

    for(int points = 0; points < req.rx.size(); points++)
    {
        tf::Transform singlepoint = tf::Transform(tf::Quaternion(req.rx[points],req.ry[points],req.rz[points],req.rq[points]),tf::Vector3(req.x[points], req.y[points], req.z[points]));

        vector_transform.push_back(singlepoint);
    }

    for (int x = 0; x < vector_transform.size(); x++)
    {
        tf::poseTFToMsg(vector_transform[x], puntos);
        waypoints.push_back(puntos);
    }

    insidecallback = true;
    res.callOK = 1;

}

void Solverfunction(std::vector<geometry_msgs::Pose> waypoints_final)
{
    if (insidecallback)
    {
        double PLAN_TIME_ = 5.0;
        double CART_STEP_SIZE_ = 0.1;
        double CART_JUMP_THRESH_ = 0.1;
        bool MOVEIT_REPLAN_ = true;
        bool AVOID_COLLISIONS_ = false;

        moveit_group_->setPlanningTime(PLAN_TIME_);
        moveit_group_->allowReplanning (MOVEIT_REPLAN_);

        move_group_interface::MoveGroup::Plan plan;
        moveit_msgs::RobotTrajectory trajectory_;
        double fraction = moveit_group_->computeCartesianPath(waypoints,CART_STEP_SIZE_,CART_JUMP_THRESH_,trajectory_,AVOID_COLLISIONS_);
        printf("Calculated %.2f%% \n", fraction * 100);
        sleep(15);
        robot_trajectory::RobotTrajectory rt(kinematic_state->getRobotModel(), "manipulator");

        rt.setRobotTrajectoryMsg(*kinematic_state, trajectory_);

        ROS_INFO_STREAM("Pose reference frame: " << moveit_group_->getPoseReferenceFrame());

        trajectory_processing::IterativeParabolicTimeParameterization iptp;
        bool success = iptp.computeTimeStamps(rt);
        ROS_INFO("Computed time stamp %s \n",success?"SUCCEDED":"FAILED");


        // Get RobotTrajectory_msg from RobotTrajectory
        rt.getRobotTrajectoryMsg(trajectory_);
        // Finally plan and execute the trajectory
        plan.trajectory_ = trajectory_;


        trajectory = trajectory_;


        moveit_group_->execute(plan);

        kinematic_state = moveit_group_->getCurrentState();
    }

}


int main(int argc,char* argv[])
{
    ros::init(argc,argv,"terminal_mocap_node");
    ros::NodeHandle node;
    printf("The node terminal_mocap_node started satisfactorily! \n");

    ros::ServiceServer TerminalMocapService = node.advertiseService("terminal_mocap_service", CallBackMocap);

    moveit_group_ = MoveGroupPtr(new move_group_interface::MoveGroup("manipulator"));
    kinematic_state = moveit::core::RobotStatePtr(moveit_group_->getCurrentState());
    kinematic_state->setToDefaultValues();

    const robot_model::RobotModelConstPtr &kmodel = kinematic_state->getRobotModel();
    joint_model_group = kmodel->getJointModelGroup("manipulator");


    while(ros::ok())
    {

        Solverfunction(waypoints);
        sleep(1);

    ros::spinOnce();
    }


    ros::shutdown();
}
2015-01-08 15:54:30 -0500 received badge  Famous Question (source)
2014-11-24 04:03:20 -0500 received badge  Famous Question (source)
2014-11-22 17:55:47 -0500 received badge  Notable Question (source)
2014-11-12 23:03:55 -0500 received badge  Popular Question (source)
2014-10-29 13:22:44 -0500 received badge  Notable Question (source)
2014-10-29 13:09:47 -0500 commented answer Create service server in rqt c++

That was maybe because the plugin need more time to start. So, I used a sleep(10) before define the service and now all works fine.

2014-10-29 13:08:04 -0500 commented answer Create service server in rqt c++

I tried to add a Service to the Cartesian path planner Plugin. But I couldn't. The plugin didn't start. After many hours, I realized that I should define the service (service = getNodeHandle().advertiseService("add_two_ints", &YourRqtPlugin::add, this)) at the final of the init function.

2014-10-29 10:18:49 -0500 received badge  Popular Question (source)
2014-10-28 07:09:40 -0500 received badge  Notable Question (source)
2014-10-27 11:57:50 -0500 received badge  Popular Question (source)
2014-10-25 07:36:42 -0500 asked a question Create service server in rqt c++

Hello, I need to create a service in c++ using qt. I found an example to do this in python, but not in c++.

What I need to consider to do that?

2014-10-25 06:59:19 -0500 received badge  Famous Question (source)
2014-10-22 07:22:37 -0500 commented question Rosbuild extern package

I normally copy the packages in my workspace, and then I run catkin_make

2014-10-22 07:06:45 -0500 asked a question Run Qt function from cpp

Hello, I'm using moveit with the plugin "Cartesian path planner"

This plugin is based on Qt.

I would like to call these Qt functions from other cpp. This is because I need to calculate paths just sending the points through rosbridge. Is this possible?. Maybe there is an easier way to do that.

Repository: here

2014-10-15 12:03:21 -0500 asked a question Problem with MoveGroup (Moveit)

I'm following the Moveit tutorials, but I can't create the first variable.

I found this link(https://groups.google.com/forum/#!msg/moveit-users/JohDfeDhl6U/ZFfFDsDw7W8J), but I don't understand the answer

Code:

#include <moveit/move_group_interface/move_group.h>
#include <moveit/planning_scene_interface/planning_scene_interface.h>
#include <moveit_msgs/DisplayRobotState.h>
#include <moveit_msgs/DisplayTrajectory.h>
#include <moveit_msgs/AttachedCollisionObject.h>
#include <moveit_msgs/CollisionObject.h>

int main(int argc, char **argv)
{
ros::init(argc, argv, "moveit_test");
ros::NodeHandle node_handle;
ros::AsyncSpinner spinner(1);
spinner.start();

sleep(20.0);

moveit::planning_interface::MoveGroup group("manipulator");

ros::shutdown();
}

Catkin_make:

/home/uplow/cworkspace/moveit/src/moveit_test_programming/src/testi.cpp: In function �int main(int, char**)�:
/home/uplow/cworkspace/moveit/src/moveit_test_programming/src/testi.cpp:17:39: error: no matching function for call to �moveit::planning_interface::MoveGroup::MoveGroup()
/home/uplow/cworkspace/moveit/src/moveit_test_programming/src/testi.cpp:17:39: note: candidates are:
/opt/ros/hydro/include/moveit/move_group_interface/move_group.h:122:3: note: moveit::planning_interface::MoveGroup::MoveGroup(const string&, const boost::shared_ptr<tf::Transformer>&, const ros::Duration&)
/opt/ros/hydro/include/moveit/move_group_interface/move_group.h:122:3: note:   candidate expects 3 arguments, 0 provided
/opt/ros/hydro/include/moveit/move_group_interface/move_group.h:116:3: note: moveit::planning_interface::MoveGroup::MoveGroup(const moveit::planning_interface::MoveGroup::Options&, const boost::shared_ptr<tf::Transformer>&, const ros::Duration&)
/opt/ros/hydro/include/moveit/move_group_interface/move_group.h:116:3: note:   candidate expects 3 arguments, 0 provided
/opt/ros/hydro/include/moveit/move_group_interface/move_group.h:69:7: note: moveit::planning_interface::MoveGroup::MoveGroup(const moveit::planning_interface::MoveGroup&)
/opt/ros/hydro/include/moveit/move_group_interface/move_group.h:69:7: note:   candidate expects 1 argument, 0 provided
2014-10-07 15:35:21 -0500 received badge  Notable Question (source)
2014-10-01 09:32:13 -0500 received badge  Notable Question (source)
2014-10-01 09:27:20 -0500 received badge  Notable Question (source)
2014-09-30 22:21:38 -0500 received badge  Famous Question (source)
2014-09-29 11:15:18 -0500 received badge  Popular Question (source)
2014-09-29 06:45:09 -0500 received badge  Notable Question (source)