Skip to content

Commit

Permalink
fix message to send
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikN committed Aug 16, 2024
1 parent aa9d0a5 commit 3cfe91d
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions packages/studio-base/src/panels/Teleop/TeleopPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,17 +289,12 @@ function TeleopPanel(props: TeleopPanelProps): JSX.Element {

const intervalMs = (1000 * 1) / config.publishRate;

if (config.stamped) {
context.publish?.(currentTopic, message);
const intervalHandle = setInterval(() => {
context.publish?.(currentTopic, message);
}, intervalMs);
} else {
context.publish?.(currentTopic, message.twist);
const intervalHandle = setInterval(() => {
context.publish?.(currentTopic, message.twist);
}, intervalMs);
}
const messageToSend = stamped ? message : message.twist;

context.publish?.(currentTopic, messageToSend);
const intervalHandle = setInterval(() => {
context.publish?.(currentTopic, messageToSend);
}, intervalMs);

return () => {
clearInterval(intervalHandle);
Expand Down

0 comments on commit 3cfe91d

Please sign in to comment.