UTNuclearRoboticsPublic / jog_arm

A real-time robot arm jogger.
45 stars 22 forks source link

Cannot roslaunch jog_arm successfully. Please help me out #75

Closed stevensu1838 closed 5 years ago

stevensu1838 commented 6 years ago

Hi Sir, PC config: ROS Kinetic on Ubuntu 16.04 Pkg Branches: iron-ox fork of ur_modern_driver (Kinetic-devel branch) jog_arm(Kinetic branch) First I run in Simulation with the following lines:

Next I modified your attached jog_settings.yaml in gazebo and command_out_topic part and my yaml file looks like this:

**gazebo: true # Originally, it was false in your attached file** 
collision_check: true 
command_in_type: "unitless" 
scale: 
  linear:  0.002  
  rotational:  0.005  
  joint: 0.006  
cartesian_command_in_topic:  jog_arm_server/delta_jog_cmds 
joint_command_in_topic: jog_arm_server/joint_delta_jog_cmds 
command_frame:  ee_link  
incoming_command_timeout:  5  
joint_topic:  joint_states
move_group_name:  manipulator  
lower_singularity_threshold:  30  
hard_stop_singularity_threshold: 45 
lower_collision_proximity_threshold: 0.1 
hard_stop_collision_proximity_threshold: 0.005 
planning_frame: base_link  
low_pass_filter_coeff: 6.  
publish_period: 0.005  
publish_delay: 0.001  
warning_topic: jog_arm_server/warning
joint_limit_margin: -0.1 
**command_out_topic:  arm_controller/command # Originally, it was ur_driver/joint_speed**
command_out_type: trajectory_msgs/JointTrajectory
publish_joint_positions: false
publish_joint_velocities: true
publish_joint_accelerations: false

btw, I've got a question about setting this yaml file. Can you please show me what the difference is of setting it for simulation and real robot respectively? Such as command_out_topic, I've seen settings like arm_controller/command; ur_driver/joint_speed; sia5_controller/command. This has been confusing.

Afterwards, I put your attached launch and config in directory /home/user/catkin_ws/Jog_arm_config and I changed the launch file and made it pointing toward the right yaml file: rosparam command="load" file="$(find Jog_arm_config )/jog_settings.yaml" (I tried file="$/home/user/catkin_ws/Jog_arm_config/jog_settings.yaml" as well and it didn't work neither. I might made a silly mistake here , coz I don't exactly know how to point a file when it is not actually put in a ROS package. Can you help me out?)

Finally, tried to roslaunch jog_node.launch with the following:

user@mech1349:~/catkin_ws$ source devel/setup.bash
user@mech1349:~/catkin_ws$ cd Jog_arm_config/
user@mech1349:~/catkin_ws/Jog_arm_config$ roslaunch jog_node.launch

It turns out ......

ResourceNotFound: catkin_ws
ROS path [0]=/opt/ros/kinetic/share/ros
ROS path [1]=/home/user/catkin_ws/src
ROS path [2]=/opt/ros/kinetic/share

So I move on to another way to launch it I use roslaunch jog_arm jog_with_xbox.launch to launch it directly form you Jog_arm. But it throw errors like this:

NODES
  /
    jog_arm_server (jog_arm/jog_arm_server)
    joy_node (joy/joy_node)
    xbox_to_twist (jog_arm/xbox_to_twist)

ROS_MASTER_URI=http://localhost:11311

process[joy_node-1]: started with pid [21556]
process[xbox_to_twist-2]: started with pid [21557]
process[jog_arm_server-3]: started with pid [21571]
[ERROR] [1541577097.248599003]: Couldn't open joystick /dev/input/js0. Will retry every second.
[ INFO] [1541577097.323917235]: Loading robot model 'ur5'...
[ WARN] [1541577097.323992265]: Skipping virtual joint 'fixed_base' because its child frame 'base_link' does not match the URDF frame 'world'
[ INFO] [1541577097.324015867]: No root/virtual joint specified in SRDF. Assuming fixed joint
[ INFO] [1541577097.898556759, 3096.691000000]: Loading robot model 'ur5'...
[ WARN] [1541577097.898704453, 3096.692000000]: Skipping virtual joint 'fixed_base' because its child frame 'base_link' does not match the URDF frame 'world'
[ INFO] [1541577097.898722744, 3096.692000000]: No root/virtual joint specified in SRDF. Assuming fixed joint
[ INFO] [1541577097.926738277, 3096.717000000]: Loading robot model 'ur5'...
[ WARN] [1541577097.926801273, 3096.717000000]: Skipping virtual joint 'fixed_base' because its child frame 'base_link' does not match the URDF frame 'world'
[ INFO] [1541577097.926857407, 3096.717000000]: No root/virtual joint specified in SRDF. Assuming fixed joint
[ INFO] [1541577097.931447767, 3096.724000000]: Waiting for first joint msg.
[ INFO] [1541577097.960109311, 3096.753000000]: Loading robot model 'ur5'...
[ WARN] [1541577097.960146028, 3096.753000000]: Skipping virtual joint 'fixed_base' because its child frame 'base_link' does not match the URDF frame 'world'
[ INFO] [1541577097.960182352, 3096.753000000]: No root/virtual joint specified in SRDF. Assuming fixed joint
[FATAL] [1541577097.970789099, 3096.763000000]: Group 'arm' was not found.
terminate called after throwing an instance of 'std::runtime_error'
  what():  Group 'arm' was not found.
[jog_arm_server-3] process has died [pid 21571, exit code -6, cmd /home/user/catkin_ws/devel/lib/jog_arm/jog_arm_server __name:=jog_arm_server __log:=/home/user/.ros/log/ba9d8b54-e25a-11e8-af8b-4c72b9268f33/jog_arm_server-3.log].
log file: /home/user/.ros/log/ba9d8b54-e25a-11e8-af8b-4c72b9268f33/jog_arm_server-3*.log
^C[joy_node-1] killing on exit
[xbox_to_twist-2] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done

Can you please kindly walk me through how to roslaunch your package successfully? Sorry about the lengthy explanation and please let me summarize a bit: Q 1 how do I modify the setting yaml.file for a UR5 arm differently for both simulation and the real robot? Much appreciated, if you could attach your jog_node and yaml files of UR5! Q 2 A dummy question. How do point a yaml in my launch file when it is not put in a package in catkin_ws/ src? Q3 How shall I exactly launch the pkg? by roslaunch jog_arm jog_with_xbox.launch or roslaunch jog_node.launch? My target for now it to jog the UR5 with a xbox/3D mouse and then I would move on to Leap Motion.

Thank you so much for your time and kindness. I like your package very much and I hope to make use of it. Thank you again.

Steven New Zealand

AndyZe commented 6 years ago

Instead of that path, try this:

/home/$USER/catkin_ws/Jog_arm_config/jog_settings.yaml (I like that you made a new folder for your settings)

The example you're looking at is for a real robot. I'll attach my simulation config file but it might be a tiny bit different. You can do rostopic list to see what the topic names should be. gazebo_jog_settings.yaml.txt

stevensu1838 commented 6 years ago

Hi Andy, PC Ubuntu 16.40 ROS Kinetic I am getting there and now I am configuring a Xbox360 controller to test it by following Joy node wiki And everything went well. However I got errors when I run

$ rosrun joy joy_node
[ INFO] [1541653009.395673744]: Opened joystick: /dev/input/js0. deadzone_: 0.050000.
Segmentation fault (core dumped)

It is not related to Jog_arm but It takes me the whole day to proceed. Have you got this issue before?? There's a bug somewhere in the code, most likely involving a pointer. Do you know how we can figure out where exactly the code is?.

I tried it with my NUC computer which are running Ubuntu 16.40 ROS Kinetic as well and it works well. The only difference I can think of is I updated my packages on my PC. So I deleted joy package on my PC and I copies joy package from NUC to my PC(I did do catkin_make and source). It didn't work either. I am just curious why. Never mind if it is out of your expertise. Thanks a million

Cheers,

Steven

stevensu1838 commented 6 years ago

Hi Andy, NUC computer Ubuntu 16.40 ROS Kinetic Sorry to bother you again. Because I can't get Xbox360 working on my PC, I moved on to my NUC computer to try out your package. I downloaded kinetic branch of jog_arm and catkin_make. But I get the following errors:

mario@mario:~/catkin_ws$ git -C src/ clone -b kinetic https://github.com/UTNuclearRoboticsPublic/jog_arm.git
mario@mario:~/catkin_ws$ catkin_make

[ 96%] Built target dragonrise_to_twist
[ 97%] Linking CXX executable /home/mario/catkin_ws/devel/lib/jog_arm/jog_arm_server
/opt/ros/kinetic/lib/liburdf.so: undefined reference to `rosconsole_bridge::RegisterOutputHandlerProxy::~RegisterOutputHandlerProxy()'
collect2: error: ld returned 1 exit status
jog_arm/jog_arm/CMakeFiles/jog_arm_server.dir/build.make:185: recipe for target '/home/mario/catkin_ws/devel/lib/jog_arm/jog_arm_server' failed
make[2]: *** [/home/mario/catkin_ws/devel/lib/jog_arm/jog_arm_server] Error 1
CMakeFiles/Makefile2:6936: recipe for target 'jog_arm/jog_arm/CMakeFiles/jog_arm_server.dir/all' failed
make[1]: *** [jog_arm/jog_arm/CMakeFiles/jog_arm_server.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

I can feel I am not far. Thanks a lot

AndyZe commented 6 years ago

Maybe you need to do sudo apt install ros-kinetic-rosconsole-bridge?

To avoid more of these problems in the future, you can do sudo apt install ros-kinetic-desktop-full.

stevensu1838 commented 6 years ago

Hi Andy, You advice on sudo apt install ros-kinetic-desktop-full helped me fix the problem on my PC. The joy_node works well except [ERROR] [1541720177.655406349]: Couldn't open joystick force feedback!


user@mech1349:~$ rosrun joy joy_node
[ERROR] [1541738361.303449941]: Couldn't open joystick force feedback!
[ INFO] [1541738361.303514423]: Opened joystick: /dev/input/js0. deadzone_: 0.050000.

When I run ~$ rostopic echo /joy I do get he following: header: seq: 2811 stamp: secs: 1511 nsecs: 310000000 frame_id: '' axes: [-0.0, -0.0, 0.0, -0.0, 0.005064466502517462, 0.0, -0.0, -0.0] buttons: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

So I ignored [ERROR] [1541720177.655406349]: Couldn't open joystick force feedback! and moved on.

roslaunch ur_gazebo ur5.launch limited:=true roslaunch ur5_moveit_config ur5_moveit_planning_execution.launch sim:=true limited:=true roslaunch ur5_moveit_config moveit_rviz.launch config:=true

roslaunch jog_arm jog_with_xbox.launch (I've modified the launch file to point to /home/$USER/catkin_ws/Jog_arm_config/jog_settings.yaml )

roslaunch jog_arm jog_with_xbox.launch ... logging to /home/user/.ros/log/72cc5cb4-e3b4-11e8-92f7-4c72b9268f33/roslaunch-mech1349-25655.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://localhost:43757/

SUMMARY

PARAMETERS

NODES / jog_arm_server (jog_arm/jog_arm_server) joy_node (joy/joy_node) xbox_to_twist (jog_arm/xbox_to_twist)

So far everything went well. And please take a look at the the topic list and rqt_graph

[user@mech1349:~/catkin_ws/Jog_arm_config$ rostopic list /arm_controller/command /arm_controller/follow_joint_trajectory/cancel /arm_controller/follow_joint_trajectory/feedback /arm_controller/follow_joint_trajectory/goal /arm_controller/follow_joint_trajectory/result /arm_controller/follow_joint_trajectory/status /arm_controller/state /attached_collision_object /calibrated /clicked_point /clock /collision_object /diagnostics /execute_trajectory/cancel /execute_trajectory/feedback /execute_trajectory/goal /execute_trajectory/result /execute_trajectory/status /gazebo/link_states /gazebo/model_states /gazebo/parameter_descriptions /gazebo/parameter_updates /gazebo/set_link_state /gazebo/set_model_state /gazebo_gui/parameter_descriptions /gazebo_gui/parameter_updates /initialpose /jog_arm_server/delta_jog_cmds /jog_arm_server/joint_delta_jog_cmds /jog_arm_server/warning /joint_states /joy /joy/set_feedback /move_base_simple/goal /move_group/cancel /move_group/display_contacts /move_group/display_planned_path /move_group/feedback /move_group/goal /move_group/monitored_planning_scene /move_group/ompl/parameter_descriptions /move_group/ompl/parameter_updates /move_group/plan_execution/parameter_descriptions /move_group/plan_execution/parameter_updates /move_group/planning_scene_monitor/parameter_descriptions /move_group/planning_scene_monitor/parameter_updates /move_group/result /move_group/sense_for_plan/parameter_descriptions /move_group/sense_for_plan/parameter_updates /move_group/status /move_group/trajectory_execution/parameter_descriptions /move_group/trajectory_execution/parameter_updates /pickup/cancel /pickup/feedback /pickup/goal /pickup/result /pickup/status /place/cancel /place/feedback /place/goal /place/result /place/status /planning_scene /planning_scene_world /recognized_object_array /rosout /rosout_agg /rviz_mech1349_5037_2074678488301628112/motionplanning_planning_scene_monitor/parameter_descriptions /rviz_mech1349_5037_2074678488301628112/motionplanning_planning_scene_monitor/parameter_updates /rviz_moveit_motion_planning_display/robot_interaction_interactive_marker_topic/feedback /rviz_moveit_motion_planning_display/robot_interaction_interactive_marker_topic/update /rviz_moveit_motion_planning_display/robot_interaction_interactive_marker_topic/update_full /statistics /tf /tf_static /trajectory_execution_event

image

However, when I pushed the joystick to jog the arm, the arm did moves around a bit but not smoothly at all. Shortly, it got stuck(shown in the pic below) and then the ur_gazebo.launch terminal and joy_with_xbox launch terminal started throwing errors as below: image

errors in ur_gazebo.launch terminal:

First valid point will be reached in 0.005s. [ WARN] [1541723070.551394169, 43.754000000]: Dropping first 6 trajectory point(s) out of 30, as they occur before the current time. First valid point will be reached in 0.001s. [ WARN] [1541723070.551739016, 43.754000000]: Dropping first 1 trajectory point(s) out of 30, as they occur before the current time. First valid point will be reached in 0.005s. [ WARN] [1541723070.591420430, 43.793000000]: Dropping first 4 trajectory point(s) out of 30, as they occur before the current time. First valid point will be reached in 0.001s. ^C[ WARN] [1541723070.671399927, 43.873000000]: Dropping first 6 trajectory point(s) out of 30, as they occur before the current time. First valid point will be reached in 0.002s.

errors in joy_with_xbox.launch terminal:

[INFO] [1541719399.683772027, 287.860000000]: Waiting for first joint msg. [ INFO] [1541719399.710985860, 287.887000000]: Loading robot model 'ur5'... [ WARN] [1541719399.711019170, 287.887000000]: Skipping virtual joint 'fixed_base' because its child frame 'base_link' does not match the URDF frame 'world' [ INFO] [1541719399.711035453, 287.888000000]: No root/virtual joint specified in SRDF. Assuming fixed joint [ INFO] [1541719399.864272936, 288.041000000]: Received first joint msg. [ INFO] [1541719399.864314391, 288.041000000]: Waiting for first command msg. [ WARN] [1541719400.568619221, 288.745000000]: Deprecation warning: Trajectory execution service is deprecated (was replaced by an action). Replace 'MoveGroupExecuteService' with 'MoveGroupExecuteTrajectoryAction' in move_group.launch [ INFO] [1541719400.571282245, 288.748000000]: Ready to take commands for planning group manipulator. [ INFO] [1541719400.576106268, 288.752000000]: Waiting for first joint msg. [ INFO] [1541719400.584702829, 288.761000000]: Received first joint msg. [ INFO] [1541719400.584740269, 288.761000000]: Waiting for first command msg. [ INFO] [1541719401.527577170, 289.702000000]: Received first command msg. [ INFO] [1541719401.527672627, 289.702000000]: Received first command msg. [ WARN] [1541719401.579174894, 289.753000000]: Stale joint trajectory msg. Try a larger 'incoming_command_timeout' parameter. [ WARN] [1541719401.579215201, 289.753000000]: Did input from the controller get interrupted? Are calculations taking too long? ^C[jog_arm_server-1] killing on exit terminate called after throwing an instance of 'class_loader::LibraryUnloadException' what(): Attempt to unload library that class_loader is unaware of. shutting down processing monitor... ... shutting down processing monitor complete done

Can you please walk me through the last obstacle to jog the arm as smoothly as you did in the demo? image Thanks a lot!

stevensu1838 commented 6 years ago

Hi Andy, I've got to apologize for having you read the long comments. I just wanted to offer you as much info as possible to save your time. In case the problem is from my yaml file(That's the only reazon I can think of ), please take a look at my xbox.launch file and jog_setting file:

```

gazebo: true # Whether the robot is started in a Gazebo simulation environment collision_check: true # Check collisions? command_in_type: "unitless" # "unitless"> in the range [-1:1], as if from joystick. "speed_units"> cmds are in m/s and rad/s scale: # Only used if command_in_type=="unitless" linear: 0.002 # Max linear velocity. Meters per publish_period. Units is [m/s] rotational: 0.005 # Max angular velocity. Rads per publish_period. Units is [rad/s] joint: 0.006 # Max joint angular/linear velocity. Rads or Meters per publish period. Units is [rad/s] or [m/s]. cartesian_command_in_topic: jog_arm_server/delta_jog_cmds # Topic for xyz commands joint_command_in_topic: jog_arm_server/joint_delta_jog_cmds # Topic for angle commands command_frame: ee_link # TF frame that incoming cmds are given in incoming_command_timeout: 5 # Stop jogging if X seconds elapse without a new cmd joint_topic: joint_states move_group_name: manipulator # Often 'manipulator' or 'arm' lower_singularity_threshold: 30 # Start decelerating when the condition number hits this (close to singularity) hard_stop_singularity_threshold: 45 # Stop when the condition number hits this lower_collision_proximity_threshold: 0.1 # Start decelerating when a collision is this far [m] hard_stop_collision_proximity_threshold: 0.005 # Stop when a collision is this far [m] planning_frame: base_link # The MoveIt! planning frame. Often 'base_link' low_pass_filter_coeff: 6. # Larger --> trust the filtered data more, trust the measurements less. publish_period: 0.005 # 1/Nominal publish rate [seconds] publish_delay: 0.001 # delay between calculation and execution start of command

Publish boolean warnings to this topic

warning_topic: jog_arm_server/warning joint_limit_margin: -0.1 # added as a buffer to joint limits [radians]. If moving quickly, make this larger. command_out_topic: arm_controller/command

What type of topic does your robot driver expect?

Currently supported are std_msgs/Float64MultiArray (for ros_control JointGroupVelocityController)

or trajectory_msgs/JointTrajectory (for Universal Robots and other non-ros_control robots)

command_out_type: trajectory_msgs/JointTrajectory

Can save some bandwidth as most robots only require positions or velocities

publish_joint_positions: true publish_joint_velocities: true publish_joint_accelerations: false


For UR gazebo simulation, is my yaml file all right? 
command_out_topic is set to  arm_controller/command 
command_out_type is set to trajectory_msgs/JointTrajectory

How shall I set command_frame:  ee_link or base link?
Andy, Thank you so much for walking me through you package. Will never forget your kindness and constant support. Cheers

Steven 
AndyZe commented 6 years ago

Hi Steven, if the arm moved, the topics are correct, so don't worry about that. Either ee_link or base_link is fine when you're just testing if it works. Later you might want to think about whether to control the end-effector frame or from a global frame like base_link.

You can ignore this warning. It will always occur with Gazebo: [ WARN] [1541723070.671399927, 43.873000000]: Dropping first 6 trajectory point(s) out of 30, as they occur before the current time. First valid point will be reached in 0.002s.

This warning will occur when you stop pressing the joystick, so it's fine: Stale joint trajectory msg. Try a larger 'incoming_command_timeout' parameter.

So, all of your terminal output looks OK.

The UR Gazebo controllers can be a little flaky. I would recommend trying it on a real robot at this point (while staying away from the robot, using small scales in the yaml file, and keeping the E-stop close by). When I have more time, I can send you a tuned UR5 Gazebo simulation. I have done this in the past but don't have it handy at the moment.

stevensu1838 commented 6 years ago

Hi Andy, Thanks a lot for your great support. Would move on to the real robot ASAP(within 2 days). Meanwhile, I would reference your xbox_to_twist code to write my own leapmotion_to_twist.cpp. My target is to use the fingertip position/hand position to jog the TCP of UR5. When it come to xbox_to_twist.cpp code, may I please ask why geometry_msg/TwistStamped type is used instead of geometry_msg/Twist? Also, Would you mind explaining a bit about this part under Cartesian jogging in your code? Coz I could not find info about msg->buttona/msg->axes online and I think that's the part of the code where I need to feed in data from leap motion. Thanks a lot. I am new to C++ but I am trying hard to sort it out.

// Cartesian jogging
    geometry_msgs::TwistStamped twist;
    twist.header.stamp = ros::Time::now();
    // This button is binary
    twist.twist.linear.x = -msg->buttons[4] + msg->buttons[5];
    // Double buttons
    twist.twist.linear.y = msg->axes[0];
    twist.twist.linear.z = msg->axes[1];
    twist.twist.angular.x = -msg->axes[3];
    twist.twist.angular.y = msg->axes[4];
    // A binary button
    twist.twist.angular.z = -msg->buttons[0] + msg->buttons[1];

However, it was the following in the ROS joy tutorial(Writing a Simple Teleoperation Node):

void TeleopTurtle::joyCallback(const sensor_msgs::Joy::ConstPtr& joy)
  43 {
  44   geometry_msgs::Twist twist;
  45   twist.angular.z = a_scale_*joy->axes[angular_];
  46   twist.linear.x = l_scale_*joy->axes[linear_];
  47   vel_pub_.publish(twist);
  48 }

In your opinion, do I also need to work on Joint jogging part? Thank you so much for your patience and kindness again. Forgive me please if these questions are about my programming skills. In that case, I would move on to C++ first. Thanks a million

Steven

stevensu1838 commented 6 years ago

Hi Andy,

Today I tested your package with a real UR5 robot. I did it with both a Xbox360 and a space mouse. I could move the arm with both of the two devices. However, I firstly encountered error robot protective stops(in ROS terminal)many times and at the same time the Security Stopped warnings on the UR teach pendent, which made the robot get stuck shortly after jogging. I just couldn't jog the arm smoothly to move along a line. Do you have any idea to improve it?

Also, When I didn't meet the robot protective stop issues, I still felt difficult to jog the arm in a straight line.(It is important Coz I am intending to do welding with UR5 robot.) Any suggestions on how I can control the TCP to go through a straight line? Is the pose of TCP also controlable?

Btw, do you have any publish paper or documents which can help me get a deeper and better understanding of this package?

The linked video is the best try for today. The robot got stuck after a short time of jogging.

https://drive.google.com/file/d/13pALd2QQAZSVy5M54k30qtW4sSiNiP4g/view?usp=drivesdk

Thank you so much for your constant help. Thanks a millions.

Steven

Gutesnacht commented 6 years ago

Hi Steven,

I just comment on this Issue since we ran into similar problems yesterday. Nevertheless, we resolved them and are able to jog the robot (UR5) smoothly. Thank you very much for the jog_arm package and all your support @AndyZe ! I appreciate the effort you took to build that package! Wonderful work!

@stevensu1838 , To help you out, i am going to give you some of the details which we went through when installing the drivers and setting up the jog arm.

As Andy pointed out in this, you need the iron-ox ur modern driver.

Note- We build this on Ubuntu 16.04, Ros Kinetic and Version 3.5.10845 UR Polyscope

  1. Install ur_modern_driver, clone and build the iron-ox fork kinetic-devel branch of ur_modern_driver
    • When building the package, you will run into an error, that can be resolved through changes in the in the ur_hardware_interface.cpp (from here.
  2. Install jog_arm and joy (you did that i guess)
    • Regarding joy, We had some problems due to outdated packages (ros), so sudo apt-get update and
      sudo apt-get dist-upgrade resolved that, to be on the latest ros packages
  3. Launch the driver with your robot ip (roslaunch ur_modern_driver ur5_bringup.launch robot_ip:=....)
  4. Launch the MoveIt! config (roslaunch moveit_config ur5_moveit_planning_execution.launch)
  5. Launch the jog_arm package - i guess you launched the spacenav mouse, so do that
  6. Enjoy

Even though, most of this list was already mentioned by Andy, I thought i should condense this info to this topic to help out people that run into this problem.

The Key to get a smooth movement was to change to the iron-ox fork of the ur_modern_driver - before that, we had really jerky movements!

Hope this helps,

Best regards,

Lukas

stevensu1838 commented 6 years ago

Hi Lucas, Thank you so much for helping me out. I am very grateful to Andy for his constant help and great contribution, too.

May I please ask what kind of project are you guys working on with Andy's Jog arm? I personally would love to use it in welding/grinding. As far as I am aware, you don't even have to bother ROS if you simply wanna teleoperate a UR5 arm. I mean you can do teleoperation without ROS(you can google ur robot teleoperating matlab as an example). Also, I reckon some advantages of ROS has been disabled(such as Motion planning/vision controled manipulation)when we in real time jog the arm. So How on earth would We benifit from jogging the arm with ROS? I've thinking of this very hard.

I am really looking forward to your replies. I think this brain-storming may help us have a better understanding of Andy's jog arm and use it better. Thanks again for all of you. Thanks with no end.

Steven New Zealand

stevensu1838 commented 6 years ago

Hi Lucas, Btw, can you please elaborate a bit what kind of changes I shall make to the interface.cpp file? Cheers

AndyZe commented 6 years ago

Good to hear that others are having success.

@stevensu1838 your video looked good. You can turn off collision checking and make the parameters lower_singularity_threshold and upper_singularity_threshold really large if you want fewer pauses. You can make the parameter incoming_command_timeout larger, too. But, those changes can be a bit risky. That's not a ROS problem, that's an unavoidable physics problem.

Some benefits of ROS are: -Singularity handling -Collision detection -Define and switch coordinate frames easily -If you add more sensors later, that will be easier to do with ROS -Community support

Gutesnacht commented 6 years ago

Hi Steven,

You are welcomed to ask about our research. We currently use the jog_arm packet for teleportation via MARG-sensors (Magnetic Angularrate Gravity sensors). With theses sensors one can measure absolute orientation referenced to gravity and the geomagnetic field of the earth. This 3D orientation is than mapped to the robot in order to move it (if you are interested, search for AMiCUs - that was the first/previous system developed as part of the PhD Thesis from Nina Rudigkeit).

The changes you need to make to the interface are in the commit mentioned in my previous answer (replace red with the green indentation).

For the benefits of Ros, I agree with Andy's list.

Regards Lukas

stevensu1838 commented 6 years ago

Hi Lukas,

Thanks a lot for your help. I'd love to say your comments(Regarding joy, We had some problems due to outdated packages (ros), so sudo apt-get update and sudo apt-get dist-upgrade resolved that, to be on the latest ros packages)have been very helpful in terms of joy node errors:

$ rosrun joy joynode [ INFO] [1541653009.395673744]: Opened joystick: /dev/input/js0. deadzone: 0.050000. Segmentation fault (core dumped)

I mention it here just in case anyone run into the same error again. Thanks a lot for sharing ideas of using Andy's package. Regarding this, may I please ask how did you get a deep understanding of jog_arm package? Like how the pack works and how you can do further development. I've been learning and using ROS and Moveit(I've done ROS manipulation for 5 days course) for a while but I am still a beginner. So hard to see through what's going on. I've found Andy's package very useful but I've love to know it well for further development. Can you please kindly share some of your ideas on it? Thanks a lit for your help.

Cheers, Steven

stevensu1838 commented 6 years ago

Hi Andy and Lucas,

Terribly sorry to bother you again. It throws some errors:

PC Intel NUC running Ubuntu 16.40 and ROS kinetic I am right know testing the system on NUC computer in simulation and later on moving onto the real robot soon. (I move onto a NUC PC simply Coz it is portable.)

roslaunch ur_gazebo ur5.launch limited:=true roslaunch ur5_moveit_config ur5_moveit_planning_execution.launch sim:=true limited:=true roslaunch ur5_moveit_config moveit_rviz.launch config:=true roslaunch spacenav_node classic.launch

It all works well.

When I launch roslaunch jog_arm jog_with_spacenav.launch

It throws either: image Or image Please find the following my launch file:

<launch>

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

  <node name="spacenav_to_twist" pkg="jog_arm" type="spacenav_to_twist" output="screen" />

  <node name="jog_arm_server" pkg="jog_arm" type="jog_arm_server" output="screen" >
    <param name="parameter_ns" type="string" value="jog_arm_server" />
    <rosparam command="load" file="/home/mario/catkin_ws/Jog_arm_config/jog_settings.yaml" />
  </node>

</launch> 

Do you have any ideas? Thanks a million.

AndyZe commented 6 years ago

Try to clean your catkin workspace, rebuild, then open a new terminal.

stevensu1838 commented 5 years ago

Hi Andy, I'd love to say thank you for all the help that you've given me. I think with the above discussion everyone can use this package well. Now I've moved on to converting leapmotion message to twist in order to jog the arm. May I please ask if you've got your tuned UR5 Gazebo simulation? Coz my simulation still works so differently from the real robot. Thanks a million

BR, Steven

AndyZe commented 5 years ago

@stevensu1838 i made a special simulation branch for you here (kinetic-steven) https://github.com/UTNuclearRobotics/ur5_sim/tree/kinetic-steven

The Readme has instructions. Make sure you're on the right branch when you clone it. This uses a SpaceNavigator because that's what I have available. If you need to change it for an XBox controller instead, see:

stevensu1838 commented 5 years ago

Hi Andy, thank you so much for your help. I am still trying hard to use this special simulation. Will let you know when I make it. Can I please ask you a question on use a LeapMotion sensor to jog the arm by modifying your spacenav_to_twist.cpp file? I know you are also an expert of using Leap in ROS. I feel very sorry that I keep asking you questions but please believe me that I am trying hard myself. Thank you so much for your great support again. My purpose is to use a hand to jog the ur5 arm in real time to do welding. such as when the palm goes to right in a line, the UR5 will weld a straight line. Palm pose maps to the pose of UR5's TCP and Palm orientation maps to the orientation of UR5's TCP.
Which is extremely like what this guy did in the pic:

image To get the job done, I modified your spacenav_to_twist.cpp in the following way and I compile successfully. image Please find the following the rqt_graph: image image Seems node leap_pub is talking to node spacenav_to_twist successfully. But I could not move the UR5 arm at all. Can you please give me some advice. Thanks a million for your great support. For leap motion I am using leapros package from https://github.com/ros-drivers/leap_motion Thanks with no end. Cheers BR, Steven

stevensu1838 commented 5 years ago

Hi Andy, My colleague suggested that I refer to your jog_api package. And make the following change in your spacenav_to_twist code(left: your code, right: after change) image Thanks a lot for your help. I am not a great programmer but I am on the way. If you can give me some direction, I am sure I can make it

AndyZe commented 5 years ago

I don't want to get too involved in your research but it sounds like you're on a good track. What I would do is:

-In a loop, calculate the change in hand pose from the leap motion tracker -check if the change is too large. Sometimes the leap motion loses track of the hand, so you need error checking for that -apply some scaling to the change in pose, then send it as a jog command.

I'm going to close this issue now. Feel free to open a new one if a new problem pops up.

stevensu1838 commented 5 years ago

Hi Andy,

I will keep it up. thank you again for your help. Cheers