Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XArm servoing in ROS1 - arm not moving #161

Closed
Akumar201 opened this issue Feb 6, 2023 · 3 comments
Closed

XArm servoing in ROS1 - arm not moving #161

Akumar201 opened this issue Feb 6, 2023 · 3 comments

Comments

@Akumar201
Copy link

Akumar201 commented Feb 6, 2023

Hi, I am trying to move real xarm with the example pose_tracking_example.cpp . I am trying yo use ROS2 moveit servoing as an example and replicate it in ROS1.
I am following the steps

  1. roslaunch xarm6_server.launch launch file
  2. roslaunch realMove_exec.launch launch_file
  3. roslaunch pose_tracking_example.launch launch_file

My config file for xarm is

###############################################
# Modify all parameters related to servoing here
###############################################
use_gazebo: false # Whether the robot is started in a Gazebo simulation environment

## Properties of incoming commands
command_in_type: "speed_units" # "unitless"> in the range [-1:1], as if from joystick. "speed_units"> cmds are in m/s and rad/s
scale:
  # Scale parameters are only used if command_in_type=="unitless"
  linear:  0.4  # Max linear velocity. Meters per publish_period. Unit is [m/s]. Only used for Cartesian commands.
  rotational:  0.8 # Max angular velocity. Rads per publish_period. Unit is [rad/s]. Only used for Cartesian commands.
  # Max joint angular/linear velocity. Rads or Meters per publish period. Only used for joint commands on joint_command_in_topic.
  joint: 0.5

## Properties of outgoing commands
publish_period: 0.034  # 1/Nominal publish rate [seconds]
low_latency_mode: false  # Set this to true to publish as soon as an incoming Twist command is received (publish_period is ignored)

# What type of topic does your robot driver expect?
# Currently supported are std_msgs/Float64MultiArray or trajectory_msgs/JointTrajectory
command_out_type: trajectory_msgs/JointTrajectory

# What to publish? Can save some bandwidth as most robots only require positions or velocities
publish_joint_positions: true
publish_joint_velocities: false
publish_joint_accelerations: false

## Incoming Joint State properties
low_pass_filter_coeff: 2.0  # Larger --> trust the filtered data more, trust the measurements less.

## MoveIt properties
move_group_name:  xarm6   # rewrite by robot dof
planning_frame: link_base  # The MoveIt planning frame. Often 'base_link' or 'world'

## Other frames
ee_frame_name: link_eef  # The name of the end effector link, used to return the EE pose
robot_link_command_frame:  link_base  # commands must be given in the frame of a robot link. Usually either the base or end effector

## Stopping behaviour
incoming_command_timeout:  0.2  # Stop servoing if X seconds elapse without a new command
# If 0, republish commands forever even if the robot is stationary. Otherwise, specify num. to publish.
# Important because ROS may drop some messages and we need the robot to halt reliably.
num_outgoing_halt_msgs_to_publish: 4

## Configure handling of singularities and joint limits
lower_singularity_threshold:  17.0  # Start decelerating when the condition number hits this (close to singularity)
hard_stop_singularity_threshold: 30.0 # Stop when the condition number hits this
joint_limit_margin: 0.1 # added as a buffer to joint limits [radians]. If moving quickly, make this larger.

## Topic names
cartesian_command_in_topic: servo_server/delta_twist_cmds  # Topic for incoming Cartesian twist commands
joint_command_in_topic: servo_server/delta_joint_cmds # Topic for incoming joint angle commands
joint_topic: joint_states
status_topic: servo_server/status # Publish status to this topic
command_out_topic: /xarm6_traj_controller/joint_trajectory # rewrite by robot dof

## Collision checking for the entire robot body
check_collisions: true # Check collisions?
collision_check_rate: 10.0 # [Hz] Collision-checking can easily bog down a CPU if done too often.
# Two collision check algorithms are available:
# "threshold_distance" begins slowing down when nearer than a specified distance. Good if you want to tune collision thresholds manually.
# "stop_distance" stops if a collision is nearer than the worst-case stopping distance and the distance is decreasing. Requires joint acceleration limits
collision_check_type: threshold_distance
# Parameters for "threshold_distance"-type collision checking
self_collision_proximity_threshold: 0.01 # Start decelerating when a self-collision is this far [m]
scene_collision_proximity_threshold: 0.02 # Start decelerating when a scene collision is this far [m]
# Parameters for "stop_distance"-type collision checking
collision_distance_safety_factor: 1000.0 # Must be >= 1. A large safety factor is recommended to account for latency
min_allowable_collision_distance: 0.01 # Stop if a collision is closer than this [m]

I am getting no error but my arm is not moving. I have doubt as in my rqt graph nodes are different

image

logs

ROS_MASTER_URI=http://localhost:11311

process[servo_server-1]: started with pid [118350]
[ INFO] [1675711753.067126054]: Loading robot model 'xarm6'...
[ INFO] [1675711753.067553671]: No root/virtual joint specified in SRDF. Assuming fixed joint
[ WARN] [1675711753.123040036]: Kinematics solver doesn't support #attempts anymore, but only a timeout.
Please remove the parameter '/robot_description_kinematics/xarm6/kinematics_solver_attempts' from your configuration.
[ INFO] [1675711753.256145334]: Starting planning scene monitor
[ INFO] [1675711753.257055383]: Listening to '/planning_scene'
[ INFO] [1675711753.257071430]: Starting world geometry update monitor for collision objects, attached objects, octomap updates.
[ INFO] [1675711753.258011307]: Listening to '/collision_object'
[ INFO] [1675711753.258762298]: Listening to '/planning_scene_world' for planning scene world geometry
[ INFO] [1675711753.260321555]: Listening to '/attached_collision_object' for attached collision objects
[ WARN] [1675711753.572837528]: An acceleration limit is not defined for this joint; minimum stop distance should not be used for collision checking
Wohooooooooooooooooooooooooooheader: 
  seq: 0
  stamp: 0.000000000
  frame_id: link_base
child_frame_id: link_base
transform: 
  translation: 
    x: 0
    y: 0
    z: 0
  rotation: 
    x: 0
    y: 0
    z: 0
    w: 1

[ WARN] [1675711753.576346707]: Target control rate was missed
[ INFO] [1675711763.606451720]: Halting servo motion, a stop was requested.
[ INFO] [1675711763.640076905]: Stopping world geometry monitor
[ INFO] [1675711763.640273933]: Stopping planning scene monitor
[servo_server-1] process has finished cleanly
log file: /home/abc/.ros/log/b8daf7f4-a64e-11ed-bccc-2bc902a52063/servo_server-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done

I also tried printing the current EE transform using the code

`
std::cout << "Wohoooooooooooooooooooooooooo" << current_ee_tf << std::endl;

`
However, it's not getting the pose

header: 
  seq: 0
  stamp: 0.000000000
  frame_id: link_base
child_frame_id: link_base
transform: 
  translation: 
    x: 0
    y: 0
    z: 0
  rotation: 
    x: 0
    y: 0
    z: 0
    w: 1

I am not sure what thing I am missing
Any help would be much appreciated

@vimior
Copy link
Contributor

vimior commented Feb 8, 2023

@Akumar201
pose_tracking_example just provides a routine, and the sending is over.
The command_out_topic configured by moveit_servo is different from that of ROS2, it should be /xarm/xarm6_traj_controller/command

@vimior
Copy link
Contributor

vimior commented Feb 8, 2023

@Akumar201
In the future, we will provide a package similar to xarm_moveit_servo of xarm_ros2 for your reference

@Akumar201
Copy link
Author

Hi, Thank you so much for your help. The arm is taking commands now.

command_out_topic: /xarm/xarm6_traj_controller/command # rewrite by robot dof

I am closing this issue as it has been solved. If the problem persists, please comment and the issue will be reopened if appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants