TechmanRobotInc / tmr_ros1

TM Robots supporting ROS1 drivers and some extended external applications. (experimental) (not support the new TM S-Series)
Other
49 stars 21 forks source link

'arm_controller/command' topic on real robot #29

Open y-ito-1985 opened 3 weeks ago

y-ito-1985 commented 3 weeks ago

We want to control a tm5-900 at 10 Hz. When a new command comes in, the robot should immediately follow the latest command, forgetting about past commands.

To realize the above concept, I first experimented with python scripts in a gazebo environment using the following command.

// command roslaunch tm_gazebo tm5-900_gazebo.launch

We have so far confirmed the desired 10 Hz operation with the following script.

// python script

from trajectory_msgs.msg import JointTrajectory pub = rospy.Publisher('arm_controller/command', JointTrajectory, queue_size=10) while True: ... // determination of arrival ... // get pose_current and pose_target, create pose_next, compute IK pub.publish(msg_jointtrajectory) // at 10 Hz

Next, we want to do the same thing as above with an real robot. We verified the connection with the robot using the following command.

// command (each terminal) roscore rosrun tm_driver tm_driver my_robot_ip

If we check the rostopic list in this situation, there is no 'arm_controller/command' topic, and it is not possible to execute the same as in the gazebo environment.

Is there an alternative approach or use of 'arm_controller/command' in a real robot environment?

y-ito-1985 commented 3 weeks ago

I found that 'arm_controller/command' is a rostopic used by a controller called joint_trajectory_controller [1]. Again, is there any way to use joint_trajectory_controller on the real robot?

[1] http://wiki.ros.org/joint_trajectory_controller

TechmanRobotIncOwner commented 2 weeks ago

Hi, y-ito-1985 sir,

You can refer to the unit of "Using Moveit! with Gazebo Simulator".
If you want to control the real robot, you can do so by changing sim:=False and typing robot_ip. 

Note:
  The real robot pose must be the same as the starting pose of the virtual robot in the Gazebo, which is the "home" pose.       
  (Let the TM real robot be in the "home" posture, that is, all joint values ​​= "0")
  (The Project_Speed of TMflow should be set to 100%)
  (Assume "network settings" are ready, the real robot_ip is 192.168.10.100, and the Listen node is running.)

Now, taking the TM5-900 robot as an example, use the commands introduced below:

   To open the terminal 1: Running with Gazebo
    $ roslaunch tm_gazebo tm5-900_gazebo.launch

   To open the terminal 2: Running with moveit! with the real TM Robot:
    $ roslaunch tm5-900-moveit_config tm5-900_moveit_planning_execution_gazebo.launch sim:=False robot_ip:=192.168.10.100 

Thank you.