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

[WIP] Fixed virtual force node to boost the rate of the topic #1909

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,31 @@

(if (not (boundp '*baxter*))
(setq *baxter* (instance baxter-robot :init)))
(setq frames (make-hash-table))
(dolist (arm (list :rarm :larm))
(sethash arm frames (send (send (send *baxter* arm :end-coords) :parent) :name))
)

(ros::rate 20)
(ros::rate 100)

(defun right-state-cb(msg)
(state-cb "/robot/end_effector/right/wrench" :rarm (send msg :wrench))
(state-cb "/robot/end_effector/right/wrench" :rarm (send msg :wrench) (send msg :header :stamp))
)

(defun left-state-cb(msg)
(state-cb "/robot/end_effector/left/wrench" :larm (send msg :wrench))
(state-cb "/robot/end_effector/left/wrench" :larm (send msg :wrench) (send msg :header :stamp))
)

(defun state-cb(advertise-topic arm wrench-msg)
(defun state-cb(advertise-topic arm wrench-msg stamp)
(let ((msg (instance geometry_msgs::WrenchStamped :init)))
(send msg :wrench wrench-msg)
(send msg :header :stamp (ros::time-now))
(send msg :header :frame_id (send (send (send *baxter* arm :end-coords) :parent) :name))
(send msg :header :stamp stamp)
(send msg :header :frame_id (gethash arm frames))
(ros::publish advertise-topic msg))
)


(ros::subscribe "/robot/limb/left/endpoint_state" baxter_core_msgs::EndpointState #'left-state-cb)
(ros::subscribe "/robot/limb/right/endpoint_state" baxter_core_msgs::EndpointState #'right-state-cb)

(ros::spin)
(ros::spin)
Loading