Ask Your Question

Wedontplay's profile - activity

2019-10-14 14:59:41 -0600 received badge  Famous Question (source)
2018-10-31 09:17:37 -0600 received badge  Notable Question (source)
2017-06-07 11:25:48 -0600 received badge  Notable Question (source)
2016-02-01 10:15:08 -0600 received badge  Popular Question (source)
2015-04-24 08:00:08 -0600 received badge  Famous Question (source)
2015-02-23 19:21:30 -0600 received badge  Notable Question (source)
2015-01-01 21:07:21 -0600 received badge  Famous Question (source)
2014-11-26 13:29:24 -0600 received badge  Popular Question (source)
2014-11-24 18:27:53 -0600 answered a question rosserial_arduino avoid lost messages

After some "in depth" debugging I discovered that in my case the problem was caused by a buffer overflow on arduino serial rx buffer. In this case higher baud rates increase the problem :) Is easy to modify the buffer size on arduino source though.

2014-11-24 14:00:29 -0600 received badge  Student (source)
2014-11-24 10:14:18 -0600 asked a question rosserial_arduino avoid lost messages

Hi, i'm using rosserial_arduino package to communicate with my robot hardware. I'm noticing that some messages are lost in both ways (Arduino->Desktop & Desktop->Arduino) I'm not publishing at high speed, to be more precise messages are sent with several seconds interval between them.

Is there a way to make message delivery guaranteed? I can wrap messages in services and use the service responses as aknowledges for but it sounds pretty ugly.

2014-11-12 08:57:51 -0600 received badge  Notable Question (source)
2014-11-08 10:56:54 -0600 asked a question smach register_trasition_cb passing *cb_args

Hi, I need to publish the current state on each state transition so I'm trying to use state transition callback to do that. I just don't gat how to pass my publisher class to the callback properly (I never used python before). If I try this:

state_publisher = StatePublisher()
...
sm.register_transition_cb(sm_transition_callback, cb_args=[state_publisher])

I have this error:

cb_args[0].publish_state(active_states)
IndexError: tuple index out of range

What is the correct way to pass an object as cb_args and retrieve it inside the callback?

Tx. Gabriele

2014-11-06 17:03:50 -0600 commented answer ROS Indigo :Cannot show Graph View on smach_viewer

I got sporadic segfault errors too but I had it also before when the states weren't visualized. @hashi I signaled your solution here: link text

2014-09-18 04:56:42 -0600 received badge  Famous Question (source)
2014-07-25 02:50:43 -0600 commented question subscriber class method callback problem

Thank you!

2014-07-25 02:49:59 -0600 received badge  Popular Question (source)
2014-07-23 14:57:45 -0600 asked a question subscriber class method callback problem

Hi, i'm trying to make a node that subscribe to a topic ik_from_pose_request that as the name suggest receive pose messages and compute arm joint values with inverse kinematic.

I saw that is possible to use a class method as a subscriber callback so i made my class that basically hold the object needed to calculate the inverse kinematic using MoveIt!

Here is the class implementation file with the constructor that initialize the required objects and the callback:

#include "kinematic_solver.h"

KinematicSolver::KinematicSolver()

{   
    //building robot model                           
    robot_model_loader_ptr = new robot_model_loader::RobotModelLoader("robot_description");
    robot_model::RobotModelPtr kinematic_model = robot_model_loader_ptr->getModel();
    ROS_INFO("Model frame: %s", kinematic_model->getModelFrame().c_str());

    // Using the :moveit_core:`RobotModel`
    kinematic_state = robot_state::RobotStatePtr(new robot_state::RobotState(kinematic_model));
    kinematic_state->setToDefaultValues();
    joint_model_group_ptr = kinematic_model->getJointModelGroup("arm");
    joint_names = joint_model_group_ptr->getJointModelNames();

    // We can retreive the current set of joint values stored in the state for the right arm.
    kinematic_state->copyJointGroupPositions(joint_model_group_ptr, joint_values);
    for(int i = 0; i < joint_names.size(); ++i)
    {
    ROS_INFO("Joint %s: %f", joint_names[i].c_str(), joint_values[i]);
    }
}

KinematicSolver::~KinematicSolver()
{

}

void KinematicSolver::kinematic_solver_callback(const geometry_msgs::Pose::ConstPtr& pose)
{

    ROS_INFO("Received pose message:");
    ROS_INFO("x: %f, y: %f, z: %f", pose->position.x, pose->position.y, pose->position.z);
    ROS_INFO("q1: %f, q2: %f, q3: %f, q4: %f", pose->orientation.x, pose->orientation.y, pose->orientation.z, pose->orientation.w);

    bool found_ik = kinematic_state->setFromIK(joint_model_group_ptr, *pose, 10, 0.1);

    // Now, we can print out the IK solution (if found):
    if (found_ik)
    {
        kinematic_state->copyJointGroupPositions(joint_model_group_ptr, joint_values);
        for(std::size_t i=0; i < joint_names.size(); ++i)
        {
          ROS_INFO("Joint %s: %f", joint_names[i].c_str(), joint_values[i]);
        }
        }
        else
        {
        ROS_INFO("Did not find IK solution");
    }   

}

In my main the only things I do is to instantiate my class and subscribe to the topic:

#include <ros/ros.h>
#include "kinematic_solver.h"

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

  KinematicSolver kinematic_solver;
  ros::NodeHandle node_handle();  

  ros::Subscriber subscriber = node_handle.subscribe("ik_from_pose_request", 10, &KinematicSolver::kinematic_solver_callback, &kinematic_solver);

  return 0;
}

The problem is that with AsyncSpinner the node does not remain alive. Here the console output

[INFO] [WallTime: 1406134201.220080] Rosbridge WebSocket server started on port 8080

[ INFO] [1406134201.241428169]: Loading robot model 'Ax12-Prototype'...

[ WARN] [1406134201.241945320]: Could not identify parent group for end-effector 'EF'

[ INFO] [1406134201.245101268]: Using position only ik

[ INFO] [1406134201.245528729]: Model frame: /base_link

[ INFO] [1406134201.245820733]: Joint joint1: 0.000000

[ INFO] [1406134201.250660517]: Joint joint2: 2.617994

[ INFO] [1406134201.250967732]: Joint joint3: 2.617994

[ INFO] [1406134201.251196630]: Joint joint4: 2.617994

[ INFO] [1406134201.251405720]: Joint joint5: 0.000000

[ik_solver-3] process has finished cleanly

Where I am doing wrong? if i use ros::spin instead the node stay alive but all MoveIt object do not load.

Tx. Gabriele

2014-07-18 19:03:26 -0600 received badge  Notable Question (source)
2014-07-18 03:26:55 -0600 received badge  Enthusiast
2014-07-17 02:32:46 -0600 commented answer cmake error: attempt to add link library

issue created, yes it is solved. Thank you for your support. G.

2014-07-14 06:54:17 -0600 commented answer cmake error: attempt to add link library

Thank you, actually the second problem was caused just by a mispelling, the launch file mentioned in the tutorial "Motion Planners/C++ API" has a different name in the pr_2_moveit_tutorials package. real launch file is: motion_planning_api_tutorial.launch.

2014-07-14 06:41:26 -0600 received badge  Popular Question (source)
2014-07-14 06:40:53 -0600 received badge  Scholar (source)
2014-07-14 02:54:36 -0600 received badge  Popular Question (source)
2014-07-12 07:09:45 -0600 received badge  Supporter (source)
2014-07-11 17:19:39 -0600 asked a question Planning Scene/C++ API Tutorial missing part

Hi, as I was reading this tutorial (sorry but I don't have enough karma to post a real link):

xxxx://docs.ros.org/api/pr2_moveit_tutorials/html/planning/src/doc/planning_scene_tutorial.html

I saw that the right way to maintain current planning scene is to use the PlanningSceneMonitor:

The PlanningSceneMonitor is the recommended method to create and maintain the current planning scene (and is discussed in detail in the next tutorial)

But I haven't find in any of the other Moveit tutorials any reference to that class. Maybe I'm looking in the wrong place? Tx

2014-07-11 16:50:16 -0600 commented answer Rosserial Arduino Problem

Tx for the answer and sorry for the late reply. Actually it was a trivial problem related to the fact i was running ubuntu on a virtual machine and arduino program had some problems handling the serial port itself.

2014-07-11 16:47:32 -0600 asked a question cmake error: attempt to add link library

Hi, as starting point to work with Moveit and my custom robot i downloaded and modified

xxx://github.com/ros-planning/moveit_pr2

i put the folder in my catkin workspace under /src, renamed everything according to my robot and used a lot of examples.

Now i need to launch some original pr2 tutorial so i downloaded same package again this time i left everything intact but when i launch catkin_make i get lot's linking errors like this one:

CMake Error at moveit_pr2-hydro-devel/pr2_moveit_tutorials/planning/CMakeLists.txt:18 (target_link_libraries): Attempt to add link library "/opt/ros/hydro/lib/libimage_transport.so" to target "move_group_interface_tutorial" which is not built in this directory.

If I delete the modified package version I use with my custom robot everything compile fine but then i can't launch the examples anymore. If I launch

rospack find pr2_moveit_tutorials

I see correctly:

/home/gabri/catkin_ws/src/moveit_pr2-hydro-devel/pr2_moveit_tutorials

but when I launch the tutorial with:

roslaunch pr2_moveit_tutorials motion_planning_interface_tutorial.launch

I get this error:

[motion_planning_interface_tutorial.launch] is neither a launch file in package [pr2_moveit_tutorials] nor is [pr2_moveit_tutorials] a launch file name

What am I missing? Thanks

2014-07-04 13:32:47 -0600 received badge  Famous Question (source)
2014-06-16 07:19:17 -0600 received badge  Notable Question (source)
2014-06-15 21:10:25 -0600 received badge  Popular Question (source)
2014-06-15 13:30:52 -0600 asked a question Rosserial Arduino Problem

Hi, i just started using ROS and i'm trying to use rosserial_arduino. I'm trying to get the examples working but I have some problems, when I launch:

rosrun rosserial_python serial_node.py /dev/ttyACM0

I have this error on the console:

[ERROR] [WallTime: 1402855665.112426] Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino

I read other threads and i loaded the sketch on a Mega 2650 and a UNO with atmega328 to exclude memory issues but i have always the same error.

Some additional information:

$rospack find rosserial
[rospack] Error: stack/package rosserial not found

$rospack find rosserial_arduino
/opt/ros/hydro/share/rosserial_arduino

$rospack find rosserial_python
/opt/ros/hydro/share/rosserial_python

$rosmsg show Adc
[rosserial_arduino/Adc]:
uint16 adc0
uint16 adc1
uint16 adc2
uint16 adc3
uint16 adc4
uint16 adc5

I'm running Hydro on Ubuntu 13.04 64-bit

Any help would be appreciated