How to control a maxon motor using canopen_chain_node

asked 2019-06-13 04:59:50 -0500

lisa5669 gravatar image

updated 2019-06-13 09:57:54 -0500

Hello,

I have been following the steps in this answer to control my maxon motor using epos2.

I have successfully initialized the driver using the following command:

rosservice call /driver/init

However, I am not able to understand how to proceed further and actually control the motor. I have already tried publishing on the "rostopic - joint_position_controller/command", but that only controls the motor/joint in Rviz/Gazebo, and not the actual motor.

Can someone please tell me how do I proceed further?

edit: 1) I am running Gazebo at the same time as controlling the actual motor.

2) I currently have 3 packages, test_motor (containing the urdf and launch files of the test apparatus), test_motor_control (containing the launch files to load the controllers and convert joint states to TF transforms for rviz, etc) and test_motor_config (containing the launch files to load the URDF to ROS parameter server, to load the joint controller configuration from YAML files to parameter server and to load the controllers). Please tell me how to proceed.

3) I also tried running the test_motor_config launch file (containing the launch files to load the URDF to ROS parameter server, to load the joint controller configuration from YAML files to parameter server and to load the controllers) alone but the error is shown that the Controller Spawner couldn't find the expected controller_manager ROS interface.

edit retag flag offensive close merge delete

Comments

publishing on the "rostopic - joint_position_controller/command"

should control whatever that controller is connected to, it could be gazebo or it could be a real-world motor it all depends how it is setup. Are you running gazebo at the same time as trying to control the actual motor?

PeteBlackerThe3rd gravatar imagePeteBlackerThe3rd ( 2019-06-13 05:42:13 -0500 )edit

Yes, I am running Gazebo at the same time as controlling the actual motor.

lisa5669 gravatar imagelisa5669 ( 2019-06-13 05:47:34 -0500 )edit

That's rather confusing TBH. You're running a simulation of the hardware and the hardware at the same time? Are you trying to control them both (i.e. two different things) from the same controller? That is simply not possible.

PeteBlackerThe3rd gravatar imagePeteBlackerThe3rd ( 2019-06-13 06:53:54 -0500 )edit