champ icon indicating copy to clipboard operation
champ copied to clipboard

Hardware Interface read() write()

Open elpimous opened this issue 1 year ago • 2 comments

Hello @grassjelly .

in your Hardware Integration page, you mention : Publish all the actuators' current angle using sensor_msgs/JointState to 'joint_states' topic.

However, it is not used into your code.

1/ Do you have anywhere, a hardware interface with both read and write functions ?
2/ Could i read imu values, to stabilize robot walk (any idea where i could start ? My imu is working and correctly publishing.) Take care of you, Juan. Vincent

elpimous avatar Oct 14 '23 22:10 elpimous

hey Vincent, the joint_states is mainly for autonomy (odometry calculation).

You can use an IMU's reading to control the body pose here. Here's a pseudo code.

auto feedback = readIMU();
auto target_pose = req_pose_;
auto new_pose = pid(target_pose, feedback);
body_controller_.poseCommand(target_foot_positions, new_pose);
leg_controller_.velocityCommand(target_foot_positions, req_vel_, rosTimeToChampTime(ros::Time::now()));
kinematics_.inverse(target_joint_positions, target_foot_positions);

grassjelly avatar Oct 15 '23 16:10 grassjelly

Hey, Juan. Thanks for feedback I'll test it, for sure 👍

elpimous avatar Oct 15 '23 16:10 elpimous