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

Combine RVIZ controller and rosservice controller #247

Open
khuechuong opened this issue Dec 22, 2024 · 5 comments
Open

Combine RVIZ controller and rosservice controller #247

khuechuong opened this issue Dec 22, 2024 · 5 comments

Comments

@khuechuong
Copy link

roslaunch xarm_planner xarm_planner_realHW.launch controls the xarm via rosservice.

roslaunch xarm5_moveit_config realMove_exec.launc controls the xarm via rviz.

Is there a way I can have launch file that is a combination of roslaunch xarm5_moveit_config realMove_exec.launch and roslaunch xarm_planner xarm_planner_realHW.launch? In case I can't use rosservice, I can use rviz to move joints.

@penglongxiang
Copy link
Contributor

Actually both the specified launch files use Moveit planner and ros-controller to control xArm. The launch files from xarm_bringup use services provided by xarm_api package, if this is what you are referring to.

While it is not recommended to use the two methods combined at the same time, since they operate in different mode of the robot, mode 1 for moveit and mostly mode 0 for the service, and the states and commands may have conflicts if not programmed properly.

The service servers are actually also launched in your mentioned launch files (for moveit), the switching between the two control method requires mode change and then setting state to 0. It is important to read through our document and do small step command test between the two methods before you actually do so in your application, making sure there is no sudden jump back upon mode switching to ensure safety. Also, please update your xarm_ros code and controller firmware to the latest version to make sure the known bugs has been fixed.

@khuechuong
Copy link
Author

roslaunch xarm5_moveit_config realMove_exec.launch I didn't see any rosservice that could receive a pose and plan end-defector to the position.

@khuechuong
Copy link
Author

@penglongxiang

@penglongxiang
Copy link
Contributor

@khuechuong Please update to the latest code and try:

$ roslaunch xarm_planner xarm_planner_realHW.launch robot_ip:=<your_robot_ip> robot_dof:=5 no_gui_plan:=false

By setting no_gui_plan:=false will enable the interactive marker and motion planning panel in Rviz, you can use both the service and Rviz GUI to do motion planning. But remember to click the Start State to be current in the MotionPlanning panel->Planning->Query again after the switch from service to GUI, or the start state may not be synchronized to rviz and error may occur upon execution.

@khuechuong
Copy link
Author

@penglongxiang
So I ran roslaunch xarm_planner xarm_planner_realHW.launch
Then I used xarm_pose_plan and xarm_exec_plan to move, then I ran

$ rosservice call /xarm/set_mode 0
$ rosservice call /xarm/set_state 0

To be able to run:

rosservice call /xarm/move_joint [0,0,0,0,0] 0.35 7 0 0

Afterwards, I can't use xarm_pose_plan and xarm_exec_plan again. How do I set it so I can use it again?

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