ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Chickenman's profile - activity

2022-08-03 12:19:15 -0500 received badge  Famous Question (source)
2020-09-29 04:09:45 -0500 received badge  Notable Question (source)
2020-02-27 15:40:27 -0500 marked best answer [Roscpp] How to subscribe to a topic once ?

Hi guys

I have a little problem here. I am writing just small code for basic joint moves of my arm manipulator in ros. I want to start with topics some services and work with parameters just to train ROS basics. I already created URDF and model in moveit but for first time a just want to move it easy way and then start with actionlib.

This is my simple code. I setup voltages there and I created publisher which is publishing arms positions and I subscribe to it. This is just Main there are 5 more proceses and one service server for comunication.

I have a problem in case 2 where I want to subscribe for the topic and read positions for one time. I have problem when i use ros::spin() it cannot stop subscribing and when i use ros::spinOnce() it just stay in a loop and never broke it. Can you help me how to read just for once and then jump to loop and wait for another prikaz(comman in english) for case.

Thank you for your time and any ideas.

prikaz is global variable

while(ros::ok() && vyp){

    if (prikaz == 0){
      printf("Prikazy na komunikaciu\n");
      printf("Napatia su vycitane, komunikacia s ramenom prebieha na nodu sa publikuju uhly\n");
      printf("Ak chcete pootocit klbom zadajte prikaz 1 \n");
      printf("Pred pootocenim je rameno odbrzdene a nastavena a spusteny motor\n");
      printf("Po pootoceni sa rameno znova zabrzdi a vypne sa motor\n");
      printf("Hybe sa konstantnou rychlostou co najpomalsie\n");
      printf("Ak chcete vycitat napatia zadajte prikaz dva 2 \n");
      printf("Ak chcete vycitat len polohy zadajte prikaz 3 \n");
      printf("Pre VYPNUTIE ZADAJTE PRIKAZ 5 \n");
      scanf("%d",&prikaz);
      clear();
    }
    printf("!!!!!!!!!!!!!!%d!!!!!!!!!!",prikaz);

    switch(prikaz){
      case 1:{
    break;
      }
      case 2:{
    while (ros::ok() && prikaz){
      ros::Subscriber sub3 = n.subscribe("D3toMain", 1000, arrayCallback); 
      ros::spinOnce();
      ROS_INFO("SOM Taaaaaam");
    }
      }
    break;
      case 3 :{
    ros::param::set("/cit_uhol", false);
    while(ros::ok() && joint.data<5){
      mainToD4_pub.publish(joint);
      joint.data++;
      loop_rate.sleep();
    }
    joint.data=0;
    prikaz=0;
    while(ros::ok()){
      ros::param::set("/cit_uhol", true);
      if(ros::param::has("/cit_uhol"))
        break;
    }
      }
    break;
      case 5:{
    //signal(SIGINT, mySigintHandler);
    //ros::spinOnce();
    vyp=false;
    break;
      }
      default:
    vyp=false;
    break;



    }

  }
  ros::param::set("/cit_uhol", false);
  ros::shutdown();
  return 0;

void arrayCallback(const std_msgs::Float64MultiArray::ConstPtr& array)
{

    int i = 0;
    ROS_INFO("SOM TUUUUUUUUUUUUUUUU");
    for(std::vector<double>::const_iterator it = array->data.begin(); it != array->data.end(); ++it)
    {
        angle[i] = *it;
        ROS_INFO("Uhol klbu %d je: %lf \n ",i+1,angle[i]);
        i++;
    }
    prikaz=0;
    return;
}
2019-04-10 03:38:31 -0500 received badge  Famous Question (source)
2018-09-10 14:41:55 -0500 received badge  Notable Question (source)
2018-09-10 05:45:23 -0500 received badge  Popular Question (source)
2018-09-10 05:02:33 -0500 commented question respawn parameter problem

I added my scripts for better understanding the problem

2018-09-10 05:02:15 -0500 edited question respawn parameter problem

respawn parameter problem Hi I am starting my launchfiles using this tutorial http://wiki.ros.org/roslaunch/API%20Usage

2018-08-20 02:17:24 -0500 asked a question respawn parameter problem in roslaunch

respawn parameter problem in roslaunch Hi I am starting my launchfiles using this tutorial http://wiki.ros.org/roslaunc

2018-08-20 02:15:19 -0500 asked a question respawn parameter problem

respawn parameter problem Hi I am starting my launchfiles using this tutorial http://wiki.ros.org/roslaunch/API%20Usage

2018-03-14 10:53:46 -0500 received badge  Famous Question (source)
2018-02-08 13:24:35 -0500 received badge  Famous Question (source)
2017-11-02 15:12:24 -0500 received badge  Notable Question (source)
2017-11-02 15:12:24 -0500 received badge  Popular Question (source)
2017-11-02 15:12:24 -0500 received badge  Famous Question (source)
2017-05-17 12:39:41 -0500 received badge  Popular Question (source)
2017-04-20 14:56:33 -0500 marked best answer arm navigation 6dof

Hi guys

I created moveit package and wrote drivers for my 6 dof manipulator and I also can control manipulator with moveit. I also created joint trajectory action server for moveit and simulation of robot in Gazebo. But I dont like idea that I have to plan the path and than execute. I would like to use or create teleoperation control of my robotic manipulator with joystick "real-time". So it would follow the axes X Y Z and maybe do some basic rotations around point. Can you help me how to realize that and maybe give me som hints ?

Thanks for your help

2017-04-13 14:22:32 -0500 asked a question kinect to robot arm tool calibration

Hi guys

I have my kinect placed on tool of robotic manipulator arm ABB and I am able to control it over ROS. I am also sending back to pc tool0 transformations and joint states. I would like to use transformation of toolpoint of robotic manipulator and use it for generating poinclouds of objects. But I have problems to correctly calibrate kinect sensor base which is obtaining data to the tool0 of the abb (there is some transformation and rotation). Can you give me any hints how to do this calibration maybe some packages. I could not find anything similar.

Thank you for your answer

2016-12-16 10:43:57 -0500 received badge  Taxonomist
2016-12-09 14:11:35 -0500 received badge  Notable Question (source)
2016-09-18 14:32:53 -0500 received badge  Famous Question (source)
2016-09-14 01:51:20 -0500 commented question realtime_collision_detection,

Thank you I read that but in answer half of the paragph three is 404 not found I mean the paragraph which starts: "See the MoveIt wiki for info on how to Retrieve Contact Info."

2016-09-14 01:06:57 -0500 received badge  Popular Question (source)
2016-09-13 09:50:42 -0500 asked a question realtime_collision_detection,

Hi guys!

I have my robot manipulator controlled with joystick through velocity controller interface. Is there a way to implement realtime collision detection? I read a lot of forums but cannot find proper answer. I am looking for something that is able to tell me nearest distance of links of my arm. Then I can use this distance and setup robot to stop when it reaches minimum distance. Am I able to check this information in Moveit ??

I had also read something about fast collision library (FCL) but I can only get distance from two objects but I am looking for some smart way to check this distance.

Thank you for your time and help

2016-09-09 05:50:18 -0500 received badge  Notable Question (source)
2016-08-19 04:03:16 -0500 received badge  Famous Question (source)
2016-08-12 08:02:11 -0500 received badge  Famous Question (source)
2016-08-12 08:00:16 -0500 received badge  Notable Question (source)
2016-08-12 05:26:49 -0500 received badge  Notable Question (source)
2016-08-12 05:26:49 -0500 received badge  Popular Question (source)
2016-08-10 15:32:11 -0500 answered a question TF tutorials question

Ok so I try to answer your questions. I dont have very good english so I hope you will understand.

1 When you load your urdf on a parameter server and then you run robot state publisher. It could create transformations for your robot. You dont need to create broadcaster. Robot state publisher will take as a parameter your robot_description and use it for creating transformations

2 This tutorial has nothing to do with mapping. It just shows and explains trasnformations. In the first part you create broadcaster which broadcasts transformation between base_laser and base_link. Then you choose arbitrary point in coordinate system of base_laser and transform it to coordinate system of base_link. And thats all, transformation represents rotation and translation in space. image description For better understanding I recommended you to watch this video https://www.youtube.com/watch?v=rTN4n... . Transformation is global concept used everywhere in robotics graphics and so on not just in ROS.

3 I dont know if you understand the issue but this topic http://docs.ros.org/api/sensor_msgs/h... represent and defines a data from laser scan. TF is just used to locate laser_base in space relative to the robot_base.

Last thing. Feel free to ask I am beginner too and I also don't understand everything. Year before when I began with ros I had same questions as you. I know my explanation is also not the best but I hope it helps.

2016-08-10 07:21:34 -0500 commented question invisible links in rviz

yes please share your urdf and launchfile and maybe screen of your left panel in rviz because in the picture left panel is hidden.

2016-08-09 18:55:34 -0500 commented question TF tutorials question

http://wiki.ros.org/robot_state_publi... here is how to use robot_state_publisher with your robot urdf

2016-08-09 18:50:18 -0500 commented question TF tutorials question

robot_state_publisher should do all tf broadcasting for you but I still dont understand what are you trying to do. You just want to complete tutorial and you encountered some problem or you want to use lidar for mapping ?

2016-08-09 18:45:24 -0500 commented question invisible links in rviz

are you getting some error in console or could you post foto what is appearing on your screen when you launch rviz

2016-08-09 18:29:40 -0500 commented answer [MoveIt!] How to Use the Python Move Group Interface

your move group should be running when you call

roslaunch robot_moveit_config demo.launch

"robot_moveit_config" is name of your package you setuped in setup_assistant. If it still does not work you can send me your "robot_moveit_config" and I could try to move robot on my own using python

2016-08-09 18:22:24 -0500 commented answer ros_databases

No problem. I am really grateful for your time and effort. I am glad that there are still people like you.

2016-08-09 07:57:21 -0500 marked best answer ros_databases

Hi guys

I am planning to do something like trajectory manager for my robotic application. I created pretty solid rqt plugin and also joint trajectory client, gripper client and everything that was needed for controlling my stuff but I have now huge problem with data storage. Is there any great database which is able to store messages in rows and structures. For example I want learn my robot new trajectories but I also want to record points and move arm step by step, add new trajectories and so on. I want to create something which can store trajectories and points like for example abb flexpendant if you have any experience with it. Is there any great database for this. I was reading about mongo database or rosbag. But I cannot find any usefull API documentation. I know how to store or record some messages but that is not enough. Can you please give me some hints or tips. Maybe I just did not explore everything which can these databases do. I have to say that I dont have a lot of experience with databases yet

Thank you for your time and help.

2016-08-09 07:56:42 -0500 commented answer ros_databases

Found solution http://docs.ros.org/jade/api/moveit_r... I initialize move_group in Constructor where I also initialized your database. I solve it by commenting line 1118 and every methods connected with it in move_group.cpp

2016-08-08 17:59:20 -0500 answered a question [MoveIt!] How to Use the Python Move Group Interface

Hi

I am not very skilled with python but I am using move_group with c++. For implementig that tutorial on your robot. You just need to change this command.

group = moveit_commander.MoveGroupCommander("left_arm")

Instead of "left_arm" you should put name of your planning group which you specified in moveit_setup_assistant Next important thing is to change desired goal to the real position which could your manipulator really reach.

pose_target = geometry_msgs.msg.Pose()
pose_target.orientation.w = 1.0
pose_target.position.x = 0.7
pose_target.position.y = -0.05
pose_target.position.z = 1.1
group.set_pose_target(pose_target)

Remember as it was mentioned in tutorial trajectory will be just planned and not executed

Whole code could be found here https://github.com/ros-planning/movei...

When you will running code remember that your move_group should be running.

2016-08-08 13:46:49 -0500 marked best answer Gazebo_ros_control - lwa4p

Hi

I have model of schunk_lwa4p and I want to simulate and control it in gazebo with ros controllers. Everything works fine but in URDF was specified hardware interface for actuators and for joints like this:

    <transmission name="${name}_1_trans">
      <type>transmission_interface/SimpleTransmission</type>
      <joint name="${name}_1_joint">
        <hardwareInterface>PositionJointInterface</hardwareInterface>
        <hardwareInterface>VelocityJointInterface</hardwareInterface>
      </joint>
      <actuator name="${name}_1_motor">
        <mechanicalReduction>1</mechanicalReduction>
        <hardwareInterface>PositionJointInterface</hardwareInterface>
        <hardwareInterface>VelocityJointInterface</hardwareInterface>
      </actuator>
    </transmission>

When I am starting robot simulation Position controller works fine but I got this warning

[ WARN] [1464031340.051142737, 0.613000000]: Joint arm_1_joint of transmission arm_1_trans specifies multiple hardware interfaces. Currently the default robot hardware simulation interface only supports one. Using the first entry!
[ WARN] [1464031340.052966217, 0.613000000]: Joint arm_2_joint of transmission arm_2_trans specifies multiple hardware interfaces. Currently the default robot hardware simulation interface only supports one. Using the first entry!
[ WARN] [1464031340.053790441, 0.613000000]: Joint arm_3_joint of transmission arm_3_trans specifies multiple hardware interfaces. Currently the default robot hardware simulation interface only supports one. Using the first entry!
[ WARN] [1464031340.054632026, 0.613000000]: Joint arm_4_joint of transmission arm_4_trans specifies multiple hardware interfaces. Currently the default robot hardware simulation interface only supports one. Using the first entry!
[ WARN] [1464031340.055426326, 0.613000000]: Joint arm_5_joint of transmission arm_5_trans specifies multiple hardware interfaces. Currently the default robot hardware simulation interface only supports one. Using the first entry!
[ WARN] [1464031340.056314374, 0.613000000]: Joint arm_6_joint of transmission arm_6_trans specifies multiple hardware interfaces. Currently the default robot hardware simulation interface only supports one. Using the first entry!

And then after this warning I have problem loading velocity interface

[ERROR] [1464031340.563829082, 0.947000000]: Exception thrown: Could not find resource 'arm_1_joint' in 'hardware_interface::VelocityJointInterface'.
[ERROR] [1464031340.563957255, 0.947000000]: Failed to initialize the controller
[ERROR] [1464031340.564171909, 0.948000000]: Initializing controller 'joint_group_velocity_controller' failed
[ERROR] [1464031340.564356884, 0.948000000]: Could not load controllers

Is it possible to load multiple hardware interfaces in gazebo_ros ??? or I could always load only one interface ?? I am using standart ros_control gazebo plugin.

  <gazebo>
    <plugin filename="libgazebo_ros_control.so" name="ros_control">
      <robotNamespace>arm</robotNamespace>
      <filterJointsParam>joint_names</filterJointsParam>
     <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
    </plugin>
  </gazebo>

Thank you for your time and advices.

2016-08-08 13:35:07 -0500 edited answer ros_databases

Thank you Chrissi for your help. Database works fine but when I am using it with moveit and I call movegroup constructor I got this error

Attempt to add global initializer failed, status: DuplicateKey throwSockExcep

I had this in my code when I commented it everything works fine so this is the problem

moveit::planning_interface::MoveGroup *group;
group = new moveit::planning_interface::MoveGroup(options);
ROS_INFO_STREAM("Move group interface configured.");

After debuging I found mongo::GlobalInitializerRegisterer::GlobalInitializerRegisterer causing problems

#0  0x00007ff4d54bac37 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ff4d54be028 in __GI_abort () at abort.c:89
#2  0x00007ff4d3e5c6d7 in mongo::GlobalInitializerRegisterer::GlobalInitializerRegisterer(std::string const&, boost::function<mongo::Status (mongo::InitializerContext*)> const&, std::vector<std::string, std::allocator<std::string> > const&, std::vector<std::string, std::allocator<std::string> > const&) ()    from /home/mirec/catkin_ws/devel/lib/libdatabase_client.so
#3  0x00007ff4d3dea448 in _GLOBAL__sub_I_sock.cpp ()    from /home/mirec/catkin_ws/devel/lib/libdatabase_client.so
#4  0x00007ff4d650a10a in call_init (l=<optimized out>, argc=argc@entry=1,

    argv=argv@entry=0x7ffde02cb9a8, env=env@entry=0x7ffde02cb9b8)
    at dl-init.c:78
#5  0x00007ff4d650a1f3 in call_init (env=<optimized out>, 
    argv=<optimized out>, argc=<optimized out>, l=<optimized out>)
    at dl-init.c:36
#6  _dl_init (main_map=0x7ff4d671e1c8, argc=1, argv=0x7ffde02cb9a8, 
    env=0x7ffde02cb9b8) at dl-init.c:126
#7  0x00007ff4d64fb30a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#8  0x0000000000000001 in ?? ()
#9  0x00007ffde02ccf6d in ?? ()
#10 0x0000000000000000 in ?? ()

Database client is my lib and it works fine without Moveit. I was searching internet for solution but I could find anything helpful. I know this is not problem of your package but if you could help my find any solution I would be grateful.

Thank you for your answer and help