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

[pr2eus] Add key topic-name to :send-cmd-vel-raw #481

Merged
merged 4 commits into from May 28, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions pr2eus/robot-interface.l
Expand Up @@ -1592,17 +1592,18 @@ Return value is a list of interpolatingp for all controllers, so (null (some #'i
(send self :move-to-wait :retry 1 :frame-id base-frame-id :no-wait nil)
))
(:send-cmd-vel-raw
(x y d) ;; [m] [m] [degree]
(x y d &key (topic-name cmd-vel-topic) ((:namespace ns) namespace)) ;; [m] [m] [degree]
(when (send self :simulation-modep)
(return-from :send-cmd-vel-raw t))
(unless (ros::get-topic-publisher (if namespace (format nil "~A/~A" namespace cmd-vel-topic) cmd-vel-topic))
(ros::advertise (if namespace (format nil "~A/~A" namespace cmd-vel-topic) cmd-vel-topic) geometry_msgs::Twist 1)
(when ns (setq topic-name (format nil "~A/~A" ns topic-name)))
(unless (ros::get-topic-publisher topic-name)
(ros::advertise topic-name geometry_msgs::Twist 1)
(unix:sleep 1))
(let ((msg (instance geometry_msgs::Twist :init)))
(send msg :linear :x x)
(send msg :linear :y y)
(send msg :angular :z d)
(ros::publish (if namespace (format nil "~A/~A" namespace cmd-vel-topic) cmd-vel-topic) msg)))
(ros::publish topic-name msg)))
(:go-velocity
(x y d ;; [m/sec] [m/sec] [rad/sec]
&optional (msec 1000) ;; msec is total animation time [msec]
Expand Down